@algorandfoundation/algokit-client-generator 3.0.6 → 4.0.0-beta.1
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/README.md +4 -2
- package/cli.js +1 -1
- package/cli.js.map +1 -1
- package/cli.mjs +1 -1
- package/cli.mjs.map +1 -1
- package/client/{call-factory.d.ts → app-client.d.ts} +1 -1
- package/client/app-client.js +288 -0
- package/client/app-client.js.map +1 -0
- package/client/app-client.mjs +286 -0
- package/client/app-client.mjs.map +1 -0
- package/client/{call-client.d.ts → app-factory.d.ts} +1 -1
- package/client/app-factory.js +238 -0
- package/client/app-factory.js.map +1 -0
- package/client/app-factory.mjs +236 -0
- package/client/app-factory.mjs.map +1 -0
- package/client/app-types.js +196 -98
- package/client/app-types.js.map +1 -1
- package/client/app-types.mjs +196 -79
- package/client/app-types.mjs.map +1 -1
- package/client/call-composer-types.js +23 -53
- package/client/call-composer-types.js.map +1 -1
- package/client/call-composer-types.mjs +23 -34
- package/client/call-composer-types.mjs.map +1 -1
- package/client/call-composer.js +43 -57
- package/client/call-composer.js.map +1 -1
- package/client/call-composer.mjs +45 -40
- package/client/call-composer.mjs.map +1 -1
- package/client/deploy-types.d.ts +8 -4
- package/client/deploy-types.js +52 -34
- package/client/deploy-types.js.map +1 -1
- package/client/deploy-types.mjs +53 -36
- package/client/deploy-types.mjs.map +1 -1
- package/client/generate.d.ts +2 -2
- package/client/generate.js +18 -6
- package/client/generate.js.map +1 -1
- package/client/generate.mjs +18 -6
- package/client/generate.mjs.map +1 -1
- package/client/generator-context.d.ts +4 -4
- package/client/generator-context.js +5 -24
- package/client/generator-context.js.map +1 -1
- package/client/generator-context.mjs +5 -5
- package/client/generator-context.mjs.map +1 -1
- package/client/helpers/get-call-config-summary.d.ts +8 -3
- package/client/helpers/get-call-config-summary.js +22 -20
- package/client/helpers/get-call-config-summary.js.map +1 -1
- package/client/helpers/get-call-config-summary.mjs +22 -20
- package/client/helpers/get-call-config-summary.mjs.map +1 -1
- package/client/helpers/get-equivalent-type.d.ts +6 -1
- package/client/helpers/get-equivalent-type.js +10 -6
- package/client/helpers/get-equivalent-type.js.map +1 -1
- package/client/helpers/get-equivalent-type.mjs +10 -6
- package/client/helpers/get-equivalent-type.mjs.map +1 -1
- package/client/imports.js +18 -24
- package/client/imports.js.map +1 -1
- package/client/imports.mjs +18 -24
- package/client/imports.mjs.map +1 -1
- package/client/params-factory.d.ts +3 -0
- package/client/params-factory.js +126 -0
- package/client/params-factory.js.map +1 -0
- package/client/params-factory.mjs +124 -0
- package/client/params-factory.mjs.map +1 -0
- package/client/utility-types.d.ts +0 -7
- package/client/utility-types.js +37 -50
- package/client/utility-types.js.map +1 -1
- package/client/utility-types.mjs +38 -50
- package/client/utility-types.mjs.map +1 -1
- package/output/writer.js +17 -3
- package/output/writer.js.map +1 -1
- package/output/writer.mjs +17 -3
- package/output/writer.mjs.map +1 -1
- package/package.json +4 -3
- package/schema/application.schema.json.js +2 -2
- package/schema/application.schema.json.mjs +2 -2
- package/schema/arc56.schema.json.js +787 -0
- package/schema/arc56.schema.json.js.map +1 -0
- package/schema/arc56.schema.json.mjs +780 -0
- package/schema/arc56.schema.json.mjs.map +1 -0
- package/schema/load.d.ts +3 -3
- package/schema/load.js +21 -7
- package/schema/load.js.map +1 -1
- package/schema/load.mjs +22 -8
- package/schema/load.mjs.map +1 -1
- package/client/call-client.js +0 -341
- package/client/call-client.js.map +0 -1
- package/client/call-client.mjs +0 -320
- package/client/call-client.mjs.map +0 -1
- package/client/call-factory.js +0 -142
- package/client/call-factory.js.map +0 -1
- package/client/call-factory.mjs +0 -121
- package/client/call-factory.mjs.map +0 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ABIMethod } from 'algosdk';
|
|
2
|
+
|
|
1
3
|
const BARE_CALL = Symbol('bare');
|
|
2
4
|
const getCallConfigSummary = (app) => {
|
|
3
5
|
const result = {
|
|
@@ -8,47 +10,47 @@ const getCallConfigSummary = (app) => {
|
|
|
8
10
|
optInMethods: [],
|
|
9
11
|
closeOutMethods: [],
|
|
10
12
|
};
|
|
11
|
-
if (app.
|
|
12
|
-
addToConfig(result, BARE_CALL, app.
|
|
13
|
+
if (app.bareActions) {
|
|
14
|
+
addToConfig(result, BARE_CALL, app.bareActions);
|
|
13
15
|
}
|
|
14
|
-
if (app.
|
|
15
|
-
for (const
|
|
16
|
-
if (
|
|
17
|
-
addToConfig(result,
|
|
16
|
+
if (app.methods) {
|
|
17
|
+
for (const m of app.methods) {
|
|
18
|
+
if (m.actions) {
|
|
19
|
+
addToConfig(result, new ABIMethod(m).getSignature(), m.actions);
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
return result;
|
|
22
24
|
};
|
|
23
25
|
const addToConfig = (result, method, config) => {
|
|
24
|
-
if (hasCall(config
|
|
26
|
+
if (hasCall(config, 'NoOp')) {
|
|
25
27
|
result.callMethods.push(method);
|
|
26
28
|
}
|
|
27
|
-
if (hasCreate(config
|
|
28
|
-
hasCreate(config
|
|
29
|
-
hasCreate(config
|
|
30
|
-
hasCreate(config
|
|
31
|
-
hasCreate(config
|
|
29
|
+
if (hasCreate(config, 'NoOp') ||
|
|
30
|
+
hasCreate(config, 'OptIn') ||
|
|
31
|
+
hasCreate(config, 'CloseOut') ||
|
|
32
|
+
hasCreate(config, 'UpdateApplication') ||
|
|
33
|
+
hasCreate(config, 'DeleteApplication')) {
|
|
32
34
|
result.createMethods.push(method);
|
|
33
35
|
}
|
|
34
|
-
if (hasCall(config
|
|
36
|
+
if (hasCall(config, 'DeleteApplication')) {
|
|
35
37
|
result.deleteMethods.push(method);
|
|
36
38
|
}
|
|
37
|
-
if (hasCall(config
|
|
39
|
+
if (hasCall(config, 'UpdateApplication')) {
|
|
38
40
|
result.updateMethods.push(method);
|
|
39
41
|
}
|
|
40
|
-
if (hasCall(config
|
|
42
|
+
if (hasCall(config, 'OptIn')) {
|
|
41
43
|
result.optInMethods.push(method);
|
|
42
44
|
}
|
|
43
|
-
if (hasCall(config
|
|
45
|
+
if (hasCall(config, 'CloseOut')) {
|
|
44
46
|
result.closeOutMethods.push(method);
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
|
-
const hasCall = (config) => {
|
|
48
|
-
return config
|
|
49
|
+
const hasCall = (config, action) => {
|
|
50
|
+
return config?.call.includes(action);
|
|
49
51
|
};
|
|
50
|
-
const hasCreate = (config) => {
|
|
51
|
-
return config
|
|
52
|
+
const hasCreate = (config, action) => {
|
|
53
|
+
return (config?.create).includes(action);
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
export { BARE_CALL, getCallConfigSummary };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-call-config-summary.mjs","sources":["../../../src/client/helpers/get-call-config-summary.ts"],"sourcesContent":["import { pascalCase } from 'change-case'\nimport {
|
|
1
|
+
{"version":3,"file":"get-call-config-summary.mjs","sources":["../../../src/client/helpers/get-call-config-summary.ts"],"sourcesContent":["import { pascalCase } from 'change-case'\nimport { Arc56Contract } from '@algorandfoundation/algokit-utils/types/app-arc56'\nimport { ABIMethod } from 'algosdk'\n\nexport const BARE_CALL = Symbol('bare')\n\nexport type MethodIdentifier = string | typeof BARE_CALL\n\nexport type MethodList = Array<MethodIdentifier>\n\nexport type OnComplete = 'NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication'\n\nexport type Actions = {\n create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]\n call: OnComplete[]\n}\n\nexport type CallConfigSummary = {\n createMethods: MethodList\n callMethods: MethodList\n deleteMethods: MethodList\n updateMethods: MethodList\n optInMethods: MethodList\n closeOutMethods: MethodList\n}\nexport const getCallConfigSummary = (app: Arc56Contract) => {\n const result: CallConfigSummary = {\n createMethods: [],\n callMethods: [],\n deleteMethods: [],\n updateMethods: [],\n optInMethods: [],\n closeOutMethods: [],\n }\n if (app.bareActions) {\n addToConfig(result, BARE_CALL, app.bareActions)\n }\n if (app.methods) {\n for (const m of app.methods) {\n if (m.actions) {\n addToConfig(result, new ABIMethod(m).getSignature(), m.actions)\n }\n }\n }\n return result\n}\n\nexport const getCreateOnComplete = (app: Arc56Contract, method: MethodIdentifier) => {\n const actions = method === BARE_CALL ? app.bareActions : app.methods?.find((m) => m.name === method)?.actions\n if (!actions) {\n return ''\n }\n const hasNoOp = actions.create.includes('NoOp')\n return `{ onCompleteAction${hasNoOp ? '?' : ''}: ${getCreateOnCompleteTypes(actions)} }`\n}\n\nconst getCreateOnCompleteTypes = (config: Actions) => {\n return config.create.map((oc) => `'${oc}' | OnApplicationComplete.${pascalCase(oc)}OC`).join(' | ')\n}\n\nconst addToConfig = (result: CallConfigSummary, method: MethodIdentifier, config: Actions) => {\n if (hasCall(config, 'NoOp')) {\n result.callMethods.push(method)\n }\n if (\n hasCreate(config, 'NoOp') ||\n hasCreate(config, 'OptIn') ||\n hasCreate(config, 'CloseOut') ||\n hasCreate(config, 'UpdateApplication') ||\n hasCreate(config, 'DeleteApplication')\n ) {\n result.createMethods.push(method)\n }\n if (hasCall(config, 'DeleteApplication')) {\n result.deleteMethods.push(method)\n }\n if (hasCall(config, 'UpdateApplication')) {\n result.updateMethods.push(method)\n }\n if (hasCall(config, 'OptIn')) {\n result.optInMethods.push(method)\n }\n if (hasCall(config, 'CloseOut')) {\n result.closeOutMethods.push(method)\n }\n}\n\nconst hasCall = (config: Actions | undefined, action: OnComplete) => {\n return config?.call.includes(action)\n}\nconst hasCreate = (config: Actions | undefined, action: OnComplete) => {\n return (config?.create as OnComplete[]).includes(action)\n}\n"],"names":[],"mappings":";;MAIa,SAAS,GAAG,MAAM,CAAC,MAAM,EAAC;AAqB1B,MAAA,oBAAoB,GAAG,CAAC,GAAkB,KAAI;AACzD,IAAA,MAAM,MAAM,GAAsB;AAChC,QAAA,aAAa,EAAE,EAAE;AACjB,QAAA,WAAW,EAAE,EAAE;AACf,QAAA,aAAa,EAAE,EAAE;AACjB,QAAA,aAAa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AAmB,CAAC,EAAE;AACxC,QAAA,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KAClC;AACD,IAAA,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;AAC5B,QAAA,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KACjC;AACD,IAAA,IAAI,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE;AAC/B,QAAA,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KACpC;AACH,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,CAAC,MAA2B,EAAE,MAAkB,KAAI;IAClE,OAAO,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACtC,CAAC,CAAA;AACD,MAAM,SAAS,GAAG,CAAC,MAA2B,EAAE,MAAkB,KAAI;IACpE,OAAO,CAAC,MAAM,EAAE,MAAuB,EAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AAC1D,CAAC;;;;"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Arc56Contract } from '@algorandfoundation/algokit-utils/types/app-arc56';
|
|
2
|
+
import { Sanitizer } from '../../util/sanitization';
|
|
3
|
+
export declare function getEquivalentType(abiTypeStr: string, ioType: 'input' | 'output', ctx: {
|
|
4
|
+
app: Arc56Contract;
|
|
5
|
+
sanitizer: Sanitizer;
|
|
6
|
+
}): string;
|
|
@@ -2,18 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
var algosdk = require('algosdk');
|
|
4
4
|
|
|
5
|
-
function getEquivalentType(abiTypeStr, ioType) {
|
|
5
|
+
function getEquivalentType(abiTypeStr, ioType, ctx) {
|
|
6
|
+
const { app, sanitizer } = ctx;
|
|
6
7
|
if (abiTypeStr == 'void') {
|
|
7
8
|
return 'void';
|
|
8
9
|
}
|
|
10
|
+
if (abiTypeStr == 'bytes') {
|
|
11
|
+
return ioType === 'input' ? 'Uint8Array | string' : 'Uint8Array';
|
|
12
|
+
}
|
|
9
13
|
if (algosdk.abiTypeIsTransaction(abiTypeStr)) {
|
|
10
|
-
return '
|
|
14
|
+
return 'AppMethodCallTransactionArgument';
|
|
11
15
|
}
|
|
12
16
|
if (abiTypeStr == algosdk.ABIReferenceType.account) {
|
|
13
17
|
return 'string | Uint8Array';
|
|
14
18
|
}
|
|
15
19
|
if (abiTypeStr == algosdk.ABIReferenceType.application || abiTypeStr == algosdk.ABIReferenceType.asset) {
|
|
16
|
-
return '
|
|
20
|
+
return 'bigint';
|
|
21
|
+
}
|
|
22
|
+
if (Object.keys(app.structs).includes(abiTypeStr)) {
|
|
23
|
+
return sanitizer.makeSafeTypeIdentifier(abiTypeStr);
|
|
17
24
|
}
|
|
18
25
|
const abiType = algosdk.ABIType.from(abiTypeStr);
|
|
19
26
|
return abiTypeToTs(abiType, ioType);
|
|
@@ -27,9 +34,6 @@ function getEquivalentType(abiTypeStr, ioType) {
|
|
|
27
34
|
if (abiType.childType instanceof algosdk.ABIByteType)
|
|
28
35
|
return 'Uint8Array';
|
|
29
36
|
const childTsType = abiTypeToTs(abiType.childType, ioType);
|
|
30
|
-
if (childTsType === 'bigint | number') {
|
|
31
|
-
return 'bigint[] | number[]';
|
|
32
|
-
}
|
|
33
37
|
return `${childTsType}[]`;
|
|
34
38
|
}
|
|
35
39
|
if (abiType instanceof algosdk.ABIArrayStaticType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-equivalent-type.js","sources":["../../../src/client/helpers/get-equivalent-type.ts"],"sourcesContent":["import {\n ABIAddressType,\n ABIArrayDynamicType,\n ABIArrayStaticType,\n ABIBoolType,\n ABIByteType,\n ABIReferenceType,\n ABIStringType,\n ABITupleType,\n ABIType,\n ABIUfixedType,\n ABIUintType,\n abiTypeIsTransaction,\n} from 'algosdk'\n\nexport function getEquivalentType(abiTypeStr: string
|
|
1
|
+
{"version":3,"file":"get-equivalent-type.js","sources":["../../../src/client/helpers/get-equivalent-type.ts"],"sourcesContent":["import { Arc56Contract } from '@algorandfoundation/algokit-utils/types/app-arc56'\nimport {\n ABIAddressType,\n ABIArrayDynamicType,\n ABIArrayStaticType,\n ABIBoolType,\n ABIByteType,\n ABIReferenceType,\n ABIStringType,\n ABITupleType,\n ABIType,\n ABIUfixedType,\n ABIUintType,\n abiTypeIsTransaction,\n} from 'algosdk'\nimport { Sanitizer } from '../../util/sanitization'\n\nexport function getEquivalentType(\n abiTypeStr: string,\n ioType: 'input' | 'output',\n ctx: { app: Arc56Contract; sanitizer: Sanitizer },\n): string {\n const { app, sanitizer } = ctx\n if (abiTypeStr == 'void') {\n return 'void'\n }\n if (abiTypeStr == 'bytes') {\n return ioType === 'input' ? 'Uint8Array | string' : 'Uint8Array'\n }\n if (abiTypeIsTransaction(abiTypeStr)) {\n return 'AppMethodCallTransactionArgument'\n }\n if (abiTypeStr == ABIReferenceType.account) {\n return 'string | Uint8Array'\n }\n if (abiTypeStr == ABIReferenceType.application || abiTypeStr == ABIReferenceType.asset) {\n return 'bigint'\n }\n if (Object.keys(app.structs).includes(abiTypeStr)) {\n return sanitizer.makeSafeTypeIdentifier(abiTypeStr)\n }\n\n const abiType = ABIType.from(abiTypeStr)\n\n return abiTypeToTs(abiType, ioType)\n\n function abiTypeToTs(abiType: ABIType, ioType: 'input' | 'output'): string {\n if (abiType instanceof ABIUintType) {\n if (abiType.bitSize <= 51) return 'number'\n return ioType === 'input' ? 'bigint | number' : 'bigint'\n }\n if (abiType instanceof ABIArrayDynamicType) {\n if (abiType.childType instanceof ABIByteType) return 'Uint8Array'\n\n const childTsType = abiTypeToTs(abiType.childType, ioType)\n return `${childTsType}[]`\n }\n if (abiType instanceof ABIArrayStaticType) {\n if (abiType.childType instanceof ABIByteType) return 'Uint8Array'\n return `[${new Array(abiType.staticLength).fill(abiTypeToTs(abiType.childType, ioType)).join(', ')}]`\n }\n if (abiType instanceof ABIAddressType) {\n return 'string'\n }\n if (abiType instanceof ABIBoolType) {\n return 'boolean'\n }\n if (abiType instanceof ABIUfixedType) {\n return 'number'\n }\n if (abiType instanceof ABITupleType) {\n return `[${abiType.childTypes.map((c) => abiTypeToTs(c, ioType)).join(', ')}]`\n }\n if (abiType instanceof ABIByteType) {\n return 'number'\n }\n if (abiType instanceof ABIStringType) {\n return 'string'\n }\n return 'unknown'\n }\n}\n"],"names":["abiTypeIsTransaction","ABIReferenceType","ABIType","ABIUintType","ABIArrayDynamicType","ABIByteType","ABIArrayStaticType","ABIAddressType","ABIBoolType","ABIUfixedType","ABITupleType","ABIStringType"],"mappings":";;;;SAiBgB,iBAAiB,CAC/B,UAAkB,EAClB,MAA0B,EAC1B,GAAiD,EAAA;AAEjD,IAAA,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,CAAA;AAC9B,IAAA,IAAI,UAAU,IAAI,MAAM,EAAE;AACxB,QAAA,OAAO,MAAM,CAAA;KACd;AACD,IAAA,IAAI,UAAU,IAAI,OAAO,EAAE;QACzB,OAAO,MAAM,KAAK,OAAO,GAAG,qBAAqB,GAAG,YAAY,CAAA;KACjE;AACD,IAAA,IAAIA,4BAAoB,CAAC,UAAU,CAAC,EAAE;AACpC,QAAA,OAAO,kCAAkC,CAAA;KAC1C;AACD,IAAA,IAAI,UAAU,IAAIC,wBAAgB,CAAC,OAAO,EAAE;AAC1C,QAAA,OAAO,qBAAqB,CAAA;KAC7B;AACD,IAAA,IAAI,UAAU,IAAIA,wBAAgB,CAAC,WAAW,IAAI,UAAU,IAAIA,wBAAgB,CAAC,KAAK,EAAE;AACtF,QAAA,OAAO,QAAQ,CAAA;KAChB;AACD,IAAA,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;AACjD,QAAA,OAAO,SAAS,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAA;KACpD;IAED,MAAM,OAAO,GAAGC,eAAO,CAAC,I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C,OAAO,CAAA,CAAA,EAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAA,CAAG,CAAA;SAC/E;AACD,QAAA,IAAI,OAAO,YAAYL,mBAAW,EAAE;AAClC,YAAA,OAAO,QAAQ,CAAA;SAChB;AACD,QAAA,IAAI,OAAO,YAAYM,qBAAa,EAAE;AACpC,YAAA,OAAO,QAAQ,CAAA;SAChB;AACD,QAAA,OAAO,SAAS,CAAA;KACjB;AACH;;;;"}
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { abiTypeIsTransaction, ABIReferenceType, ABIType, ABIUintType, ABIArrayDynamicType, ABIByteType, ABIArrayStaticType, ABIAddressType, ABIBoolType, ABIUfixedType, ABITupleType, ABIStringType } from 'algosdk';
|
|
2
2
|
|
|
3
|
-
function getEquivalentType(abiTypeStr, ioType) {
|
|
3
|
+
function getEquivalentType(abiTypeStr, ioType, ctx) {
|
|
4
|
+
const { app, sanitizer } = ctx;
|
|
4
5
|
if (abiTypeStr == 'void') {
|
|
5
6
|
return 'void';
|
|
6
7
|
}
|
|
8
|
+
if (abiTypeStr == 'bytes') {
|
|
9
|
+
return ioType === 'input' ? 'Uint8Array | string' : 'Uint8Array';
|
|
10
|
+
}
|
|
7
11
|
if (abiTypeIsTransaction(abiTypeStr)) {
|
|
8
|
-
return '
|
|
12
|
+
return 'AppMethodCallTransactionArgument';
|
|
9
13
|
}
|
|
10
14
|
if (abiTypeStr == ABIReferenceType.account) {
|
|
11
15
|
return 'string | Uint8Array';
|
|
12
16
|
}
|
|
13
17
|
if (abiTypeStr == ABIReferenceType.application || abiTypeStr == ABIReferenceType.asset) {
|
|
14
|
-
return '
|
|
18
|
+
return 'bigint';
|
|
19
|
+
}
|
|
20
|
+
if (Object.keys(app.structs).includes(abiTypeStr)) {
|
|
21
|
+
return sanitizer.makeSafeTypeIdentifier(abiTypeStr);
|
|
15
22
|
}
|
|
16
23
|
const abiType = ABIType.from(abiTypeStr);
|
|
17
24
|
return abiTypeToTs(abiType, ioType);
|
|
@@ -25,9 +32,6 @@ function getEquivalentType(abiTypeStr, ioType) {
|
|
|
25
32
|
if (abiType.childType instanceof ABIByteType)
|
|
26
33
|
return 'Uint8Array';
|
|
27
34
|
const childTsType = abiTypeToTs(abiType.childType, ioType);
|
|
28
|
-
if (childTsType === 'bigint | number') {
|
|
29
|
-
return 'bigint[] | number[]';
|
|
30
|
-
}
|
|
31
35
|
return `${childTsType}[]`;
|
|
32
36
|
}
|
|
33
37
|
if (abiType instanceof ABIArrayStaticType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-equivalent-type.mjs","sources":["../../../src/client/helpers/get-equivalent-type.ts"],"sourcesContent":["import {\n ABIAddressType,\n ABIArrayDynamicType,\n ABIArrayStaticType,\n ABIBoolType,\n ABIByteType,\n ABIReferenceType,\n ABIStringType,\n ABITupleType,\n ABIType,\n ABIUfixedType,\n ABIUintType,\n abiTypeIsTransaction,\n} from 'algosdk'\n\nexport function getEquivalentType(abiTypeStr: string
|
|
1
|
+
{"version":3,"file":"get-equivalent-type.mjs","sources":["../../../src/client/helpers/get-equivalent-type.ts"],"sourcesContent":["import { Arc56Contract } from '@algorandfoundation/algokit-utils/types/app-arc56'\nimport {\n ABIAddressType,\n ABIArrayDynamicType,\n ABIArrayStaticType,\n ABIBoolType,\n ABIByteType,\n ABIReferenceType,\n ABIStringType,\n ABITupleType,\n ABIType,\n ABIUfixedType,\n ABIUintType,\n abiTypeIsTransaction,\n} from 'algosdk'\nimport { Sanitizer } from '../../util/sanitization'\n\nexport function getEquivalentType(\n abiTypeStr: string,\n ioType: 'input' | 'output',\n ctx: { app: Arc56Contract; sanitizer: Sanitizer },\n): string {\n const { app, sanitizer } = ctx\n if (abiTypeStr == 'void') {\n return 'void'\n }\n if (abiTypeStr == 'bytes') {\n return ioType === 'input' ? 'Uint8Array | string' : 'Uint8Array'\n }\n if (abiTypeIsTransaction(abiTypeStr)) {\n return 'AppMethodCallTransactionArgument'\n }\n if (abiTypeStr == ABIReferenceType.account) {\n return 'string | Uint8Array'\n }\n if (abiTypeStr == ABIReferenceType.application || abiTypeStr == ABIReferenceType.asset) {\n return 'bigint'\n }\n if (Object.keys(app.structs).includes(abiTypeStr)) {\n return sanitizer.makeSafeTypeIdentifier(abiTypeStr)\n }\n\n const abiType = ABIType.from(abiTypeStr)\n\n return abiTypeToTs(abiType, ioType)\n\n function abiTypeToTs(abiType: ABIType, ioType: 'input' | 'output'): string {\n if (abiType instanceof ABIUintType) {\n if (abiType.bitSize <= 51) return 'number'\n return ioType === 'input' ? 'bigint | number' : 'bigint'\n }\n if (abiType instanceof ABIArrayDynamicType) {\n if (abiType.childType instanceof ABIByteType) return 'Uint8Array'\n\n const childTsType = abiTypeToTs(abiType.childType, ioType)\n return `${childTsType}[]`\n }\n if (abiType instanceof ABIArrayStaticType) {\n if (abiType.childType instanceof ABIByteType) return 'Uint8Array'\n return `[${new Array(abiType.staticLength).fill(abiTypeToTs(abiType.childType, ioType)).join(', ')}]`\n }\n if (abiType instanceof ABIAddressType) {\n return 'string'\n }\n if (abiType instanceof ABIBoolType) {\n return 'boolean'\n }\n if (abiType instanceof ABIUfixedType) {\n return 'number'\n }\n if (abiType instanceof ABITupleType) {\n return `[${abiType.childTypes.map((c) => abiTypeToTs(c, ioType)).join(', ')}]`\n }\n if (abiType instanceof ABIByteType) {\n return 'number'\n }\n if (abiType instanceof ABIStringType) {\n return 'string'\n }\n return 'unknown'\n }\n}\n"],"names":[],"mappings":";;SAiBgB,iBAAiB,CAC/B,UAAkB,EAClB,MAA0B,EAC1B,GAAiD,EAAA;AAEjD,IAAA,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,CAAA;AAC9B,IAAA,IAAI,UAAU,IAAI,MAAM,EAAE;AACxB,QAAA,OAAO,MAAM,CAAA;K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
14
|
-
|
|
15
|
-
|
|
16
|
-
} from '@algorandfoundation/algokit-utils/types/app'
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
ApplicationClient,
|
|
23
|
-
} from '@algorandfoundation/algokit-utils/types/app-client'
|
|
24
|
-
import type { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec'
|
|
25
|
-
import type { SendTransactionResult, TransactionToSign, SendTransactionFrom, SendTransactionParams } from '@algorandfoundation/algokit-utils/types/transaction'
|
|
26
|
-
import type { ABIResult, TransactionWithSigner } from 'algosdk'
|
|
27
|
-
import { Algodv2, OnApplicationComplete, Transaction, AtomicTransactionComposer, modelsv2 } from 'algosdk'`;
|
|
4
|
+
yield `
|
|
5
|
+
import { ABIReturn, AppReturn, SendAppTransactionResult } from '@algorandfoundation/algokit-utils/types/app'
|
|
6
|
+
import { Arc56Contract, getArc56ReturnValue } from '@algorandfoundation/algokit-utils/types/app-arc56'
|
|
7
|
+
import {
|
|
8
|
+
AppClient,
|
|
9
|
+
AppClientMethodCallParams,
|
|
10
|
+
AppClientParams,
|
|
11
|
+
AppClientBareCallParams,
|
|
12
|
+
CallOnComplete,
|
|
13
|
+
AppClientCompilationParams,
|
|
14
|
+
ResolveAppClientByCreatorAndName,
|
|
15
|
+
} from '@algorandfoundation/algokit-utils/types/app-client'
|
|
16
|
+
import { AppFactory, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'
|
|
17
|
+
import AlgoKitComposer, { AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
|
|
18
|
+
import { ExecuteParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'
|
|
19
|
+
import { modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'
|
|
20
|
+
import SimulateResponse = modelsv2.SimulateResponse
|
|
21
|
+
`;
|
|
28
22
|
}
|
|
29
23
|
|
|
30
24
|
exports.imports = imports;
|
package/client/imports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.js","sources":["../../src/client/imports.ts"],"sourcesContent":["import { DocumentParts } from '../output/writer'\n\nexport function* imports(): DocumentParts {\n yield
|
|
1
|
+
{"version":3,"file":"imports.js","sources":["../../src/client/imports.ts"],"sourcesContent":["import { DocumentParts } from '../output/writer'\n\nexport function* imports(): DocumentParts {\n yield `\n import { ABIReturn, AppReturn, SendAppTransactionResult } from '@algorandfoundation/algokit-utils/types/app'\n import { Arc56Contract, getArc56ReturnValue } from '@algorandfoundation/algokit-utils/types/app-arc56'\n import {\n AppClient,\n AppClientMethodCallParams,\n AppClientParams,\n AppClientBareCallParams,\n CallOnComplete,\n AppClientCompilationParams,\n ResolveAppClientByCreatorAndName,\n } from '@algorandfoundation/algokit-utils/types/app-client'\n import { AppFactory, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'\n import AlgoKitComposer, { AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'\n import { ExecuteParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'\n import { modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'\n import SimulateResponse = modelsv2.SimulateResponse\n `\n}\n"],"names":[],"mappings":";;AAEM,UAAW,OAAO,GAAA;IACtB,MAAM,CAAA;;;;;;;;;;;;;;;;;GAiBL,CAAA;AACH;;;;"}
|
package/client/imports.mjs
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
function* imports() {
|
|
2
|
-
yield `
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from '@algorandfoundation/algokit-utils/types/app'
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
ApplicationClient,
|
|
21
|
-
} from '@algorandfoundation/algokit-utils/types/app-client'
|
|
22
|
-
import type { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec'
|
|
23
|
-
import type { SendTransactionResult, TransactionToSign, SendTransactionFrom, SendTransactionParams } from '@algorandfoundation/algokit-utils/types/transaction'
|
|
24
|
-
import type { ABIResult, TransactionWithSigner } from 'algosdk'
|
|
25
|
-
import { Algodv2, OnApplicationComplete, Transaction, AtomicTransactionComposer, modelsv2 } from 'algosdk'`;
|
|
2
|
+
yield `
|
|
3
|
+
import { ABIReturn, AppReturn, SendAppTransactionResult } from '@algorandfoundation/algokit-utils/types/app'
|
|
4
|
+
import { Arc56Contract, getArc56ReturnValue } from '@algorandfoundation/algokit-utils/types/app-arc56'
|
|
5
|
+
import {
|
|
6
|
+
AppClient,
|
|
7
|
+
AppClientMethodCallParams,
|
|
8
|
+
AppClientParams,
|
|
9
|
+
AppClientBareCallParams,
|
|
10
|
+
CallOnComplete,
|
|
11
|
+
AppClientCompilationParams,
|
|
12
|
+
ResolveAppClientByCreatorAndName,
|
|
13
|
+
} from '@algorandfoundation/algokit-utils/types/app-client'
|
|
14
|
+
import { AppFactory, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'
|
|
15
|
+
import AlgoKitComposer, { AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
|
|
16
|
+
import { ExecuteParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'
|
|
17
|
+
import { modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'
|
|
18
|
+
import SimulateResponse = modelsv2.SimulateResponse
|
|
19
|
+
`;
|
|
26
20
|
}
|
|
27
21
|
|
|
28
22
|
export { imports };
|
package/client/imports.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.mjs","sources":["../../src/client/imports.ts"],"sourcesContent":["import { DocumentParts } from '../output/writer'\n\nexport function* imports(): DocumentParts {\n yield
|
|
1
|
+
{"version":3,"file":"imports.mjs","sources":["../../src/client/imports.ts"],"sourcesContent":["import { DocumentParts } from '../output/writer'\n\nexport function* imports(): DocumentParts {\n yield `\n import { ABIReturn, AppReturn, SendAppTransactionResult } from '@algorandfoundation/algokit-utils/types/app'\n import { Arc56Contract, getArc56ReturnValue } from '@algorandfoundation/algokit-utils/types/app-arc56'\n import {\n AppClient,\n AppClientMethodCallParams,\n AppClientParams,\n AppClientBareCallParams,\n CallOnComplete,\n AppClientCompilationParams,\n ResolveAppClientByCreatorAndName,\n } from '@algorandfoundation/algokit-utils/types/app-client'\n import { AppFactory, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'\n import AlgoKitComposer, { AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'\n import { ExecuteParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'\n import { modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'\n import SimulateResponse = modelsv2.SimulateResponse\n `\n}\n"],"names":[],"mappings":"AAEM,UAAW,OAAO,GAAA;IACtB,MAAM,CAAA;;;;;;;;;;;;;;;;;GAiBL,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var writer = require('../output/writer.js');
|
|
4
|
+
var getCallConfigSummary = require('./helpers/get-call-config-summary.js');
|
|
5
|
+
var deployTypes = require('./deploy-types.js');
|
|
6
|
+
var algosdk = require('algosdk');
|
|
7
|
+
|
|
8
|
+
function* paramsFactory(ctx) {
|
|
9
|
+
yield* writer.jsDoc(`Exposes methods for constructing \`AppClient\` params objects for ABI calls to the ${ctx.name} smart contract`);
|
|
10
|
+
yield `export abstract class ${ctx.name}ParamsFactory {`;
|
|
11
|
+
yield writer.IncIndent;
|
|
12
|
+
yield* opMethods(ctx);
|
|
13
|
+
for (const method of ctx.app.methods) {
|
|
14
|
+
yield* callFactoryMethod(ctx, method);
|
|
15
|
+
}
|
|
16
|
+
yield writer.DecIndent;
|
|
17
|
+
yield '}';
|
|
18
|
+
}
|
|
19
|
+
function* opMethods(ctx) {
|
|
20
|
+
const { app, callConfig } = ctx;
|
|
21
|
+
yield* operationMethod(ctx, `Constructs create ABI call params for the ${app.name} smart contract`, callConfig.createMethods, 'create', true);
|
|
22
|
+
yield* operationMethod(ctx, `Constructs update ABI call params for the ${app.name} smart contract`, callConfig.updateMethods, 'update', true);
|
|
23
|
+
yield* operationMethod(ctx, `Constructs delete ABI call params for the ${app.name} smart contract`, callConfig.deleteMethods, 'delete');
|
|
24
|
+
yield* operationMethod(ctx, `Constructs opt-in ABI call params for the ${app.name} smart contract`, callConfig.optInMethods, 'optIn');
|
|
25
|
+
yield* operationMethod(ctx, `Constructs close out ABI call params for the ${app.name} smart contract`, callConfig.closeOutMethods, 'closeOut');
|
|
26
|
+
}
|
|
27
|
+
function* operationMethod(ctx, description, methods, verb, includeCompilation) {
|
|
28
|
+
const { app, methodSignatureToUniqueName, sanitizer } = ctx;
|
|
29
|
+
if (methods.length > 0 && methods.some((m) => m !== getCallConfigSummary.BARE_CALL)) {
|
|
30
|
+
yield* writer.jsDoc(`Gets available ${verb} ABI call param factories`);
|
|
31
|
+
yield `static get ${verb}() {`;
|
|
32
|
+
yield writer.IncIndent;
|
|
33
|
+
yield `return {`;
|
|
34
|
+
yield writer.IncIndent;
|
|
35
|
+
if (['create', 'update', 'delete'].includes(verb)) {
|
|
36
|
+
yield `_resolveByMethod<TParams extends ${ctx.name}${verb[0].toUpperCase()}${verb.substring(1)}CallParams & {method: string}>(params: TParams) {`;
|
|
37
|
+
yield writer.IncIndent;
|
|
38
|
+
yield `switch(params.method) {`;
|
|
39
|
+
yield writer.IncIndent;
|
|
40
|
+
for (const methodSig of methods) {
|
|
41
|
+
if (methodSig === getCallConfigSummary.BARE_CALL)
|
|
42
|
+
continue;
|
|
43
|
+
const uniqueName = methodSignatureToUniqueName[methodSig];
|
|
44
|
+
if (uniqueName !== methodSig) {
|
|
45
|
+
yield `case '${sanitizer.makeSafeStringTypeLiteral(uniqueName)}':`;
|
|
46
|
+
}
|
|
47
|
+
yield `case '${sanitizer.makeSafeStringTypeLiteral(methodSig)}':`;
|
|
48
|
+
yield* writer.indent(`return ${ctx.name}ParamsFactory.${verb}.${sanitizer.makeSafeMethodIdentifier(uniqueName)}(params)`);
|
|
49
|
+
}
|
|
50
|
+
yield writer.DecIndentAndCloseBlock;
|
|
51
|
+
// Ordinarily we'd pop in the params.method value, but we can't here since it knows at compile time the type of params.method is never
|
|
52
|
+
yield `throw new Error(\`Unknown ' + verb + ' method\`)`;
|
|
53
|
+
yield writer.DecIndent;
|
|
54
|
+
yield '},';
|
|
55
|
+
yield writer.NewLine;
|
|
56
|
+
}
|
|
57
|
+
for (const methodSig of methods) {
|
|
58
|
+
const onComplete = verb === 'create' ? deployTypes.getCreateOnCompleteOptions(methodSig, app) : undefined;
|
|
59
|
+
if (methodSig !== getCallConfigSummary.BARE_CALL) {
|
|
60
|
+
const method = app.methods.find((m) => new algosdk.ABIMethod(m).getSignature() === methodSig);
|
|
61
|
+
const uniqueName = methodSignatureToUniqueName[methodSig];
|
|
62
|
+
yield* writer.jsDoc({
|
|
63
|
+
description: `${description} using the ${methodSig} ABI method`,
|
|
64
|
+
params: {
|
|
65
|
+
params: `Parameters for the call`,
|
|
66
|
+
},
|
|
67
|
+
returns: 'An `AppClientMethodCallParams` object for the call',
|
|
68
|
+
});
|
|
69
|
+
yield* factoryMethod({
|
|
70
|
+
isNested: true,
|
|
71
|
+
sanitizer,
|
|
72
|
+
name: sanitizer.makeSafeMethodIdentifier(uniqueName),
|
|
73
|
+
signature: methodSig,
|
|
74
|
+
args: method.args,
|
|
75
|
+
additionalParamTypes: `${includeCompilation ? ' & AppClientCompilationParams' : ''}${onComplete?.type ? ` & ${onComplete.type}` : ''}`,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
yield writer.DecIndentAndCloseBlock;
|
|
80
|
+
yield writer.DecIndentAndCloseBlock;
|
|
81
|
+
yield writer.NewLine;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function* callFactoryMethod({ methodSignatureToUniqueName, callConfig, sanitizer }, method) {
|
|
85
|
+
const methodSignature = new algosdk.ABIMethod(method).getSignature();
|
|
86
|
+
if (!callConfig.callMethods.includes(methodSignature))
|
|
87
|
+
return;
|
|
88
|
+
yield* writer.jsDoc({
|
|
89
|
+
description: `Constructs a no op call for the ${methodSignature} ABI method`,
|
|
90
|
+
abiDescription: method.desc,
|
|
91
|
+
params: {
|
|
92
|
+
params: `Parameters for the call`,
|
|
93
|
+
},
|
|
94
|
+
returns: 'An `AppClientMethodCallParams` object for the call',
|
|
95
|
+
});
|
|
96
|
+
yield* factoryMethod({
|
|
97
|
+
isNested: false,
|
|
98
|
+
sanitizer,
|
|
99
|
+
name: sanitizer.makeSafeMethodIdentifier(methodSignatureToUniqueName[methodSignature]),
|
|
100
|
+
signature: methodSignature,
|
|
101
|
+
args: method.args,
|
|
102
|
+
additionalParamTypes: ' & CallOnComplete',
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function* factoryMethod(m) {
|
|
106
|
+
const { isNested, name, signature, args, additionalParamTypes, sanitizer } = m;
|
|
107
|
+
const signatureSafe = signature && sanitizer.makeSafeStringTypeLiteral(signature);
|
|
108
|
+
yield `${isNested ? '' : 'static '}${name}(params: CallParams<'${signatureSafe}'>${additionalParamTypes}): AppClientMethodCallParams${additionalParamTypes} {`;
|
|
109
|
+
yield writer.IncIndent;
|
|
110
|
+
yield `return {`;
|
|
111
|
+
yield writer.IncIndent;
|
|
112
|
+
yield '...params,';
|
|
113
|
+
if (signature) {
|
|
114
|
+
yield `method: '${signatureSafe}' as const,`;
|
|
115
|
+
yield `args: Array.isArray(params.args) ? params.args : [${args
|
|
116
|
+
.map((a, i) => `params.args${sanitizer.getSafeMemberAccessor(sanitizer.makeSafePropertyIdentifier(a.name ?? `arg${i + 1}`))}`)
|
|
117
|
+
.join(', ')}],`;
|
|
118
|
+
}
|
|
119
|
+
yield writer.DecIndent;
|
|
120
|
+
yield '}';
|
|
121
|
+
yield writer.DecIndent;
|
|
122
|
+
yield `}${isNested ? ',' : ''}`;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
exports.paramsFactory = paramsFactory;
|
|
126
|
+
//# sourceMappingURL=params-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params-factory.js","sources":["../../src/client/params-factory.ts"],"sourcesContent":["import { DecIndent, DecIndentAndCloseBlock, DocumentParts, IncIndent, indent, jsDoc, NewLine } from '../output/writer'\nimport { GeneratorContext } from './generator-context'\nimport { BARE_CALL, MethodList } from './helpers/get-call-config-summary'\nimport { getCreateOnCompleteOptions } from './deploy-types'\nimport { Sanitizer } from '../util/sanitization'\nimport { Method } from '@algorandfoundation/algokit-utils/types/app-arc56'\nimport { ABIMethod } from 'algosdk'\n\nexport function* paramsFactory(ctx: GeneratorContext): DocumentParts {\n yield* jsDoc(`Exposes methods for constructing \\`AppClient\\` params objects for ABI calls to the ${ctx.name} smart contract`)\n yield `export abstract class ${ctx.name}ParamsFactory {`\n yield IncIndent\n\n yield* opMethods(ctx)\n\n for (const method of ctx.app.methods) {\n yield* callFactoryMethod(ctx, method)\n }\n\n yield DecIndent\n\n yield '}'\n}\n\nfunction* opMethods(ctx: GeneratorContext): DocumentParts {\n const { app, callConfig } = ctx\n\n yield* operationMethod(\n ctx,\n `Constructs create ABI call params for the ${app.name} smart contract`,\n callConfig.createMethods,\n 'create',\n true,\n )\n yield* operationMethod(\n ctx,\n `Constructs update ABI call params for the ${app.name} smart contract`,\n callConfig.updateMethods,\n 'update',\n true,\n )\n yield* operationMethod(ctx, `Constructs delete ABI call params for the ${app.name} smart contract`, callConfig.deleteMethods, 'delete')\n yield* operationMethod(ctx, `Constructs opt-in ABI call params for the ${app.name} smart contract`, callConfig.optInMethods, 'optIn')\n yield* operationMethod(\n ctx,\n `Constructs close out ABI call params for the ${app.name} smart contract`,\n callConfig.closeOutMethods,\n 'closeOut',\n )\n}\n\nfunction* operationMethod(\n ctx: GeneratorContext,\n description: string,\n methods: MethodList,\n verb: 'create' | 'update' | 'optIn' | 'closeOut' | 'delete',\n includeCompilation?: boolean,\n): DocumentParts {\n const { app, methodSignatureToUniqueName, sanitizer } = ctx\n if (methods.length > 0 && methods.some((m) => m !== BARE_CALL)) {\n yield* jsDoc(`Gets available ${verb} ABI call param factories`)\n yield `static get ${verb}() {`\n yield IncIndent\n yield `return {`\n yield IncIndent\n\n if (['create', 'update', 'delete'].includes(verb)) {\n yield `_resolveByMethod<TParams extends ${ctx.name}${verb[0].toUpperCase()}${verb.substring(1)}CallParams & {method: string}>(params: TParams) {`\n yield IncIndent\n yield `switch(params.method) {`\n yield IncIndent\n\n for (const methodSig of methods) {\n if (methodSig === BARE_CALL) continue\n\n const uniqueName = methodSignatureToUniqueName[methodSig]\n if (uniqueName !== methodSig) {\n yield `case '${sanitizer.makeSafeStringTypeLiteral(uniqueName)}':`\n }\n yield `case '${sanitizer.makeSafeStringTypeLiteral(methodSig)}':`\n yield* indent(`return ${ctx.name}ParamsFactory.${verb}.${sanitizer.makeSafeMethodIdentifier(uniqueName)}(params)`)\n }\n yield DecIndentAndCloseBlock\n\n // Ordinarily we'd pop in the params.method value, but we can't here since it knows at compile time the type of params.method is never\n yield `throw new Error(\\`Unknown ' + verb + ' method\\`)`\n yield DecIndent\n yield '},'\n yield NewLine\n }\n\n for (const methodSig of methods) {\n const onComplete = verb === 'create' ? getCreateOnCompleteOptions(methodSig, app) : undefined\n if (methodSig !== BARE_CALL) {\n const method = app.methods.find((m) => new ABIMethod(m).getSignature() === methodSig)!\n const uniqueName = methodSignatureToUniqueName[methodSig]\n yield* jsDoc({\n description: `${description} using the ${methodSig} ABI method`,\n params: {\n params: `Parameters for the call`,\n },\n returns: 'An `AppClientMethodCallParams` object for the call',\n })\n yield* factoryMethod({\n isNested: true,\n sanitizer,\n name: sanitizer.makeSafeMethodIdentifier(uniqueName),\n signature: methodSig,\n args: method.args,\n additionalParamTypes: `${includeCompilation ? ' & AppClientCompilationParams' : ''}${\n onComplete?.type ? ` & ${onComplete.type}` : ''\n }`,\n })\n }\n }\n yield DecIndentAndCloseBlock\n yield DecIndentAndCloseBlock\n yield NewLine\n }\n}\n\nfunction* callFactoryMethod({ methodSignatureToUniqueName, callConfig, sanitizer }: GeneratorContext, method: Method) {\n const methodSignature = new ABIMethod(method).getSignature()\n if (!callConfig.callMethods.includes(methodSignature)) return\n\n yield* jsDoc({\n description: `Constructs a no op call for the ${methodSignature} ABI method`,\n abiDescription: method.desc,\n params: {\n params: `Parameters for the call`,\n },\n returns: 'An `AppClientMethodCallParams` object for the call',\n })\n yield* factoryMethod({\n isNested: false,\n sanitizer,\n name: sanitizer.makeSafeMethodIdentifier(methodSignatureToUniqueName[methodSignature]),\n signature: methodSignature,\n args: method.args,\n additionalParamTypes: ' & CallOnComplete',\n })\n}\n\nfunction* factoryMethod(m: {\n isNested: boolean\n name?: string\n signature: string\n args: Array<{ name?: string }>\n additionalParamTypes?: string\n sanitizer: Sanitizer\n}) {\n const { isNested, name, signature, args, additionalParamTypes, sanitizer } = m\n const signatureSafe = signature && sanitizer.makeSafeStringTypeLiteral(signature)\n yield `${isNested ? '' : 'static '}${name}(params: CallParams<'${signatureSafe}'>${additionalParamTypes}): AppClientMethodCallParams${additionalParamTypes} {`\n yield IncIndent\n yield `return {`\n yield IncIndent\n yield '...params,'\n if (signature) {\n yield `method: '${signatureSafe}' as const,`\n yield `args: Array.isArray(params.args) ? params.args : [${args\n .map((a, i) => `params.args${sanitizer.getSafeMemberAccessor(sanitizer.makeSafePropertyIdentifier(a.name ?? `arg${i + 1}`))}`)\n .join(', ')}],`\n }\n yield DecIndent\n yield '}'\n yield DecIndent\n yield `}${isNested ? ',' : ''}`\n}\n"],"names":["jsDoc","IncIndent","DecIndent","BARE_CALL","indent","DecIndentAndCloseBlock","NewLine","getCreateOnCompleteOptions","ABIMethod"],"mappings":";;;;;;;AAQe,UAAE,aAAa,CAAC,GAAqB,EAAA;IAClD,OAAOA,YAAK,CAAC,CAAA,mFAAA,EAAsF,GAAG,CAAC,IAAI,CAAiB,eAAA,CAAA,CAAC,CAAA;AAC7H,IAAA,MAAM,CAAyB,sBAAA,EAAA,GAAG,CAAC,IAAI,iBAAiB,CAAA;AACxD,IAAA,MAAMC,gBAAS,CAAA;AAEf,IAAA,OAAO,SAAS,CAAC,GAAG,CAAC,CAAA;IAErB,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE;QACpC,OAAO,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;KACtC;AAED,IAAA,MAAMC,gBAAS,CAAA;AAEf,IAAA,MAAM,GAAG,CAAA;AACX,CAAC;AAED,UAAU,SAAS,CAAC,GAAqB,EAAA;AACvC,IAAA,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,GAAG,CAAA;IAE/B,OAAO,eAAe,CACpB,GAAG,EACH,CAAA,0CAAA,EAA6C,GAAG,CAAC,IAAI,iBAAiB,EACtE,UAAU,CAAC,aAAa,EACxB,QAAQ,EACR,IAAI,CACL,CAAA;IACD,OAAO,eAAe,CACpB,GAAG,EACH,CAAA,0CAAA,EAA6C,GAAG,CAAC,IAAI,iBAAiB,EACtE,UAAU,CAAC,aAAa,EACxB,QAAQ,EACR,IAAI,CACL,CAAA;AACD,IAAA,OAAO,eAAe,CAAC,GAAG,EAAE,6CAA6C,GAAG,CAAC,IAAI,CAAA,eAAA,CA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