@algorandfoundation/algokit-utils 0.1.0 → 1.0.0-beta.11

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 (137) hide show
  1. package/account.d.ts +85 -0
  2. package/account.d.ts.map +1 -0
  3. package/account.js +148 -0
  4. package/account.js.map +1 -0
  5. package/amount.d.ts +6 -0
  6. package/amount.d.ts.map +1 -0
  7. package/amount.js +15 -0
  8. package/amount.js.map +1 -0
  9. package/app.d.ts +51 -0
  10. package/app.d.ts.map +1 -0
  11. package/app.js +265 -0
  12. package/app.js.map +1 -0
  13. package/application-client.d.ts +10 -0
  14. package/application-client.d.ts.map +1 -0
  15. package/application-client.js +15 -0
  16. package/application-client.js.map +1 -0
  17. package/deploy-app.d.ts +93 -0
  18. package/deploy-app.d.ts.map +1 -0
  19. package/deploy-app.js +411 -0
  20. package/deploy-app.js.map +1 -0
  21. package/index.d.ts +14 -0
  22. package/index.d.ts.map +1 -0
  23. package/index.js +31 -0
  24. package/index.js.map +1 -0
  25. package/indexer-lookup.d.ts +31 -0
  26. package/indexer-lookup.d.ts.map +1 -0
  27. package/indexer-lookup.js +96 -0
  28. package/indexer-lookup.js.map +1 -0
  29. package/localnet.d.ts +54 -0
  30. package/localnet.d.ts.map +1 -0
  31. package/localnet.js +121 -0
  32. package/localnet.js.map +1 -0
  33. package/network-client.d.ts +93 -0
  34. package/network-client.d.ts.map +1 -0
  35. package/network-client.js +182 -0
  36. package/network-client.js.map +1 -0
  37. package/package.json +15 -14
  38. package/testing/account.d.ts +14 -0
  39. package/testing/account.d.ts.map +1 -0
  40. package/testing/account.js +31 -0
  41. package/testing/account.js.map +1 -0
  42. package/testing/fixtures/algokit-log-capture-fixture.d.ts +19 -0
  43. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
  44. package/testing/fixtures/algokit-log-capture-fixture.js +43 -0
  45. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
  46. package/testing/fixtures/algorand-fixture.d.ts +20 -0
  47. package/testing/fixtures/algorand-fixture.d.ts.map +1 -0
  48. package/testing/fixtures/algorand-fixture.js +49 -0
  49. package/testing/fixtures/algorand-fixture.js.map +1 -0
  50. package/testing/fixtures/index.d.ts +3 -0
  51. package/testing/fixtures/index.d.ts.map +1 -0
  52. package/testing/fixtures/index.js +19 -0
  53. package/testing/fixtures/index.js.map +1 -0
  54. package/testing/index.d.ts +6 -0
  55. package/testing/index.d.ts.map +1 -0
  56. package/testing/index.js +22 -0
  57. package/testing/index.js.map +1 -0
  58. package/testing/indexer.d.ts +12 -0
  59. package/testing/indexer.d.ts.map +1 -0
  60. package/testing/indexer.js +39 -0
  61. package/testing/indexer.js.map +1 -0
  62. package/testing/test-logger.d.ts +39 -0
  63. package/testing/test-logger.d.ts.map +1 -0
  64. package/testing/test-logger.js +69 -0
  65. package/testing/test-logger.js.map +1 -0
  66. package/testing/transaction-logger.d.ts +29 -0
  67. package/testing/transaction-logger.d.ts.map +1 -0
  68. package/testing/transaction-logger.js +71 -0
  69. package/testing/transaction-logger.js.map +1 -0
  70. package/transaction.d.ts +83 -0
  71. package/transaction.d.ts.map +1 -0
  72. package/transaction.js +240 -0
  73. package/transaction.js.map +1 -0
  74. package/transfer.d.ts +11 -0
  75. package/transfer.d.ts.map +1 -0
  76. package/transfer.js +33 -0
  77. package/transfer.js.map +1 -0
  78. package/types/account.d.ts +52 -0
  79. package/types/account.d.ts.map +1 -0
  80. package/types/account.js +86 -0
  81. package/types/account.js.map +1 -0
  82. package/types/algo-http-client-with-retry.d.ts +14 -0
  83. package/types/algo-http-client-with-retry.d.ts.map +1 -0
  84. package/types/algo-http-client-with-retry.js +62 -0
  85. package/types/algo-http-client-with-retry.js.map +1 -0
  86. package/types/algod.d.ts +123 -0
  87. package/types/algod.d.ts.map +1 -0
  88. package/types/algod.js +3 -0
  89. package/types/algod.js.map +1 -0
  90. package/types/amount.d.ts +18 -0
  91. package/types/amount.d.ts.map +1 -0
  92. package/types/amount.js +31 -0
  93. package/types/amount.js.map +1 -0
  94. package/types/app.d.ts +222 -0
  95. package/types/app.d.ts.map +1 -0
  96. package/types/app.js +32 -0
  97. package/types/app.js.map +1 -0
  98. package/types/application-client.d.ts +134 -0
  99. package/types/application-client.d.ts.map +1 -0
  100. package/types/application-client.js +279 -0
  101. package/types/application-client.js.map +1 -0
  102. package/types/appspec.d.ts +77 -0
  103. package/types/appspec.d.ts.map +1 -0
  104. package/types/appspec.js +15 -0
  105. package/types/appspec.js.map +1 -0
  106. package/types/config.d.ts +15 -0
  107. package/types/config.d.ts.map +1 -0
  108. package/types/config.js +27 -0
  109. package/types/config.js.map +1 -0
  110. package/types/indexer.d.ts +313 -0
  111. package/types/indexer.d.ts.map +1 -0
  112. package/types/indexer.js +25 -0
  113. package/types/indexer.js.map +1 -0
  114. package/types/logging.d.ts +13 -0
  115. package/types/logging.d.ts.map +1 -0
  116. package/types/logging.js +27 -0
  117. package/types/logging.js.map +1 -0
  118. package/types/network-client.d.ts +11 -0
  119. package/types/network-client.d.ts.map +1 -0
  120. package/types/network-client.js +3 -0
  121. package/types/network-client.js.map +1 -0
  122. package/types/testing.d.ts +89 -0
  123. package/types/testing.d.ts.map +1 -0
  124. package/types/testing.js +3 -0
  125. package/types/testing.js.map +1 -0
  126. package/types/transaction.d.ts +51 -0
  127. package/types/transaction.d.ts.map +1 -0
  128. package/types/transaction.js +3 -0
  129. package/types/transaction.js.map +1 -0
  130. package/types/transfer.d.ts +16 -0
  131. package/types/transfer.d.ts.map +1 -0
  132. package/types/transfer.js +3 -0
  133. package/types/transfer.js.map +1 -0
  134. package/types/urlTokenBaseHTTPClient.d.ts +41 -0
  135. package/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
  136. package/types/urlTokenBaseHTTPClient.js +151 -0
  137. package/types/urlTokenBaseHTTPClient.js.map +1 -0
@@ -0,0 +1,93 @@
1
+ import { Algodv2, Indexer } from 'algosdk';
2
+ import { ApplicationStateSchema } from './types/algod';
3
+ import { AppDeploymentParams, AppDeployMetadata, AppLookup, AppMetadata, CompiledTeal, TealTemplateParameters } from './types/app';
4
+ import { ConfirmedTransactionResult, SendTransactionFrom } from './types/transaction';
5
+ /**
6
+ * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
7
+ *
8
+ * To understand the architecture decisions behind this functionality please @see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
9
+ *
10
+ * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.
11
+ *
12
+ * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.
13
+ *
14
+ * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.
15
+ * @param deployment The arguments to control the app deployment
16
+ * @param algod An algod client
17
+ * @param indexer An indexer client, needed if `existingDeployments` not passed in
18
+ * @returns The app reference of the new/existing app
19
+ */
20
+ export declare function deployApp(deployment: AppDeploymentParams, algod: Algodv2, indexer?: Indexer): Promise<(ConfirmedTransactionResult & AppMetadata & {
21
+ operationPerformed: 'create' | 'update';
22
+ }) | (ConfirmedTransactionResult & AppMetadata & {
23
+ deleteResult: ConfirmedTransactionResult;
24
+ operationPerformed: 'replace';
25
+ }) | (AppMetadata & {
26
+ operationPerformed: 'nothing';
27
+ })>;
28
+ /** Returns true is there is a breaking change in the application state schema from before to after.
29
+ * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.
30
+ * Otherwise, there is no error, the app just doesn't store data in the extra schema :(
31
+ *
32
+ * @param before The existing schema
33
+ * @param after The new schema
34
+ * @returns Whether or not there is a breaking change
35
+ */
36
+ export declare function isSchemaIsBroken(before: ApplicationStateSchema, after: ApplicationStateSchema): boolean;
37
+ /**
38
+ * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an @see {AppDeployNote} in the transaction note of the creation transaction.
39
+ *
40
+ * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).
41
+ *
42
+ * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for
43
+ * @param indexer An indexer client
44
+ * @returns A name-based lookup of the app information (id, address)
45
+ */
46
+ export declare function getCreatorAppsByName(creatorAccount: SendTransactionFrom | string, indexer: Indexer): Promise<AppLookup>;
47
+ /**
48
+ * Return the transaction note for an app deployment.
49
+ * @param metadata The metadata of the deployment
50
+ * @returns The transaction note as a utf-8 string
51
+ */
52
+ export declare function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): {
53
+ dAppName: string;
54
+ data: AppDeployMetadata;
55
+ format: string;
56
+ };
57
+ /**
58
+ * Replaces deploy-time deployment control parameters within the given teal code.
59
+ *
60
+ * @see {UPDATABLE_TEMPLATE_NAME}
61
+ * @see {DELETABLE_TEMPLATE_NAME}
62
+ *
63
+ * @param tealCode The TEAL code to substitute
64
+ * @param params The deploy-time deployment control parameter value to replace
65
+ * @returns The replaced TEAL code
66
+ */
67
+ export declare function replaceDeployTimeControlParams(tealCode: string, params: {
68
+ updatable?: boolean;
69
+ deletable?: boolean;
70
+ }): string;
71
+ /**
72
+ * Performs template substitution of a teal file.
73
+ *
74
+ * Looks for `TMPL_{parameter}` for template replacements.
75
+ *
76
+ * @param tealCode The TEAL logic to compile
77
+ * @param templateParameters Any parameters to replace in the .teal file before compiling
78
+ * @returns The TEAL code with replacements
79
+ */
80
+ export declare function performTemplateSubstitution(tealCode: string, templateParameters?: TealTemplateParameters): string;
81
+ /**
82
+ * Performs template substitution of a teal file and compiles it, returning the compiled result.
83
+ *
84
+ * Looks for `TMPL_{parameter}` for template replacements.
85
+ *
86
+ * @param tealCode The TEAL logic to compile
87
+ * @param algod An algod client
88
+ * @param templateParameters Any parameters to replace in the .teal file before compiling
89
+ * @param deploymentMetadata The deployment metadata the app will be deployed with
90
+ * @returns The information about the compiled code
91
+ */
92
+ export declare function performTemplateSubstitutionAndCompile(tealCode: string, algod: Algodv2, templateParameters?: TealTemplateParameters, deploymentMetadata?: AppDeployMetadata): Promise<CompiledTeal>;
93
+ //# sourceMappingURL=deploy-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-app.d.ts","sourceRoot":"","sources":["../src/deploy-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAyB,OAAO,EAAmB,MAAM,SAAS,CAAA;AAKlF,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,EACT,WAAW,EAEX,YAAY,EAIZ,sBAAsB,EAEvB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAErF;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,SAAS,CAC7B,UAAU,EAAE,mBAAmB,EAC/B,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CACN,CAAC,0BAA0B,GAAG,WAAW,GAAG;IAAE,kBAAkB,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAAE,CAAC,GACxF,CAAC,0BAA0B,GAAG,WAAW,GAAG;IAAE,YAAY,EAAE,0BAA0B,CAAC;IAAC,kBAAkB,EAAE,SAAS,CAAA;CAAE,CAAC,GACxH,CAAC,WAAW,GAAG;IAAE,kBAAkB,EAAE,SAAS,CAAA;CAAE,CAAC,CACpD,CAkSA;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,EAAE,KAAK,EAAE,sBAAsB,WAE7F;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,cAAc,EAAE,mBAAmB,GAAG,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAyF7H;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,iBAAiB;;;;EAM1E;AAED;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,UAoBpH;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,sBAAsB,UAiBxG;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,qCAAqC,CACzD,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,kBAAkB,CAAC,EAAE,sBAAsB,EAC3C,kBAAkB,CAAC,EAAE,iBAAiB,GACrC,OAAO,CAAC,YAAY,CAAC,CAcvB"}
package/deploy-app.js ADDED
@@ -0,0 +1,411 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.performTemplateSubstitutionAndCompile = exports.performTemplateSubstitution = exports.replaceDeployTimeControlParams = exports.getAppDeploymentTransactionNote = exports.getCreatorAppsByName = exports.isSchemaIsBroken = exports.deployApp = void 0;
4
+ const algosdk_1 = require("algosdk");
5
+ const _1 = require("./");
6
+ const app_1 = require("./app");
7
+ const indexer_lookup_1 = require("./indexer-lookup");
8
+ const transaction_1 = require("./transaction");
9
+ const app_2 = require("./types/app");
10
+ /**
11
+ * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
12
+ *
13
+ * To understand the architecture decisions behind this functionality please @see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
14
+ *
15
+ * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.
16
+ *
17
+ * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.
18
+ *
19
+ * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.
20
+ * @param deployment The arguments to control the app deployment
21
+ * @param algod An algod client
22
+ * @param indexer An indexer client, needed if `existingDeployments` not passed in
23
+ * @returns The app reference of the new/existing app
24
+ */
25
+ async function deployApp(deployment, algod, indexer) {
26
+ const { metadata, deployTimeParameters, onSchemaBreak, onUpdate, existingDeployments, createArgs, updateArgs, deleteArgs, ...appParams } = deployment;
27
+ if (existingDeployments && existingDeployments.creator !== (0, transaction_1.getSenderAddress)(appParams.from)) {
28
+ throw new Error(`Received invalid existingDeployments value for creator ${existingDeployments.creator} when attempting to deploy for creator ${appParams.from}`);
29
+ }
30
+ if (!existingDeployments && !indexer) {
31
+ throw new Error(`Didn't receive an indexer client, but also didn't receive an existingDeployments cache - one of them must be provided`);
32
+ }
33
+ _1.Config.getLogger(appParams.suppressLog).info(`Idempotently deploying app "${metadata.name}" from creator ${(0, transaction_1.getSenderAddress)(appParams.from)} using ${appParams.approvalProgram.length} bytes of teal code and ${appParams.clearStateProgram.length} bytes of teal code`);
34
+ appParams.approvalProgram =
35
+ typeof appParams.approvalProgram === 'string'
36
+ ? (await performTemplateSubstitutionAndCompile(appParams.approvalProgram, algod, deployTimeParameters, metadata))
37
+ .compiledBase64ToBytes
38
+ : appParams.approvalProgram;
39
+ appParams.clearStateProgram =
40
+ typeof appParams.clearStateProgram === 'string'
41
+ ? (await performTemplateSubstitutionAndCompile(appParams.clearStateProgram, algod, deployTimeParameters)).compiledBase64ToBytes
42
+ : appParams.clearStateProgram;
43
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
44
+ const apps = existingDeployments ?? (await getCreatorAppsByName(appParams.from, indexer));
45
+ const create = async (skipSending) => {
46
+ const result = await (0, app_1.createApp)({
47
+ ...appParams,
48
+ args: createArgs,
49
+ note: getAppDeploymentTransactionNote(metadata),
50
+ skipSending: skipSending ?? false,
51
+ skipWaiting: false,
52
+ }, algod);
53
+ return {
54
+ transaction: result.transaction,
55
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
56
+ confirmation: result.confirmation,
57
+ appId: result.appId,
58
+ appAddress: result.appAddress,
59
+ createdMetadata: metadata,
60
+ createdRound: Number(result.confirmation?.['confirmed-round']),
61
+ updatedRound: Number(result.confirmation?.['confirmed-round']),
62
+ ...metadata,
63
+ deleted: false,
64
+ operationPerformed: 'create',
65
+ };
66
+ };
67
+ const existingApp = apps.apps[metadata.name];
68
+ if (!existingApp || existingApp.deleted) {
69
+ _1.Config.getLogger(appParams.suppressLog).info(`App ${metadata.name} not found in apps created by ${(0, transaction_1.getSenderAddress)(appParams.from)}; deploying app with version ${metadata.version}.`);
70
+ return await create();
71
+ }
72
+ _1.Config.getLogger(appParams.suppressLog).info(`Existing app ${metadata.name} found by creator ${(0, transaction_1.getSenderAddress)(appParams.from)}, with app id ${existingApp.appId} and version ${existingApp.version}.`);
73
+ const existingAppRecord = await (0, app_1.getAppByIndex)(existingApp.appId, algod);
74
+ const existingApproval = existingAppRecord.params['approval-program'];
75
+ const existingClear = existingAppRecord.params['clear-state-program'];
76
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
77
+ const existingGlobalSchema = existingAppRecord.params['global-state-schema'];
78
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
79
+ const existingLocalSchema = existingAppRecord.params['local-state-schema'];
80
+ const newGlobalSchema = {
81
+ 'num-byte-slice': appParams.schema.globalByteSlices,
82
+ 'num-uint': appParams.schema.globalInts,
83
+ };
84
+ const newLocalSchema = {
85
+ 'num-byte-slice': appParams.schema.localByteSlices,
86
+ 'num-uint': appParams.schema.localInts,
87
+ };
88
+ const newApproval = Buffer.from(appParams.approvalProgram).toString('base64');
89
+ const newClear = Buffer.from(appParams.clearStateProgram).toString('base64');
90
+ const isUpdate = newApproval !== existingApproval || newClear !== existingClear;
91
+ const isSchemaBreak = isSchemaIsBroken(existingGlobalSchema, newGlobalSchema) || isSchemaIsBroken(existingLocalSchema, newLocalSchema);
92
+ const replace = async () => {
93
+ // Create
94
+ _1.Config.getLogger(appParams.suppressLog).info(`Deploying a new ${metadata.name} app for ${(0, transaction_1.getSenderAddress)(appParams.from)}; deploying app with version ${metadata.version}.`);
95
+ const { transaction: createTransaction } = await create(true);
96
+ // Delete
97
+ _1.Config.getLogger(appParams.suppressLog).warn(`Deleting existing ${metadata.name} app with id ${existingApp.appId} from ${(0, transaction_1.getSenderAddress)(appParams.from)} account.`);
98
+ const { transaction: deleteTransaction } = await (0, app_1.callApp)({
99
+ appId: existingApp.appId,
100
+ callType: 'delete',
101
+ from: appParams.from,
102
+ args: deleteArgs,
103
+ transactionParams: appParams.transactionParams,
104
+ suppressLog: appParams.suppressLog,
105
+ skipSending: true,
106
+ }, algod);
107
+ // Ensure create and delete happen atomically
108
+ const { confirmations } = await (0, transaction_1.sendGroupOfTransactions)({
109
+ transactions: [
110
+ {
111
+ transaction: createTransaction,
112
+ signer: appParams.from,
113
+ },
114
+ {
115
+ transaction: deleteTransaction,
116
+ signer: appParams.from,
117
+ },
118
+ ],
119
+ sendParams: {
120
+ maxRoundsToWaitForConfirmation: appParams.maxRoundsToWaitForConfirmation,
121
+ skipWaiting: false,
122
+ suppressLog: true,
123
+ },
124
+ }, algod);
125
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
126
+ const createConfirmation = confirmations[0];
127
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
128
+ const deleteConfirmation = confirmations[1];
129
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
130
+ const newAppIndex = createConfirmation['application-index'];
131
+ _1.Config.getLogger(appParams.suppressLog).warn(`Sent transactions ${createTransaction.txID()} to create app with id ${newAppIndex} and ${deleteTransaction.txID()} to delete app with id ${existingApp.appId} from ${(0, transaction_1.getSenderAddress)(appParams.from)} account.`);
132
+ return {
133
+ transaction: createTransaction,
134
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
135
+ confirmation: createConfirmation,
136
+ appId: newAppIndex,
137
+ appAddress: (0, algosdk_1.getApplicationAddress)(newAppIndex),
138
+ createdMetadata: metadata,
139
+ createdRound: Number(createConfirmation['confirmed-round']),
140
+ updatedRound: Number(createConfirmation['confirmed-round']),
141
+ ...metadata,
142
+ deleted: false,
143
+ deleteResult: { transaction: deleteTransaction, confirmation: deleteConfirmation },
144
+ operationPerformed: 'replace',
145
+ };
146
+ };
147
+ const update = async () => {
148
+ _1.Config.getLogger(appParams.suppressLog).info(`Updating existing ${metadata.name} app for ${(0, transaction_1.getSenderAddress)(appParams.from)} to version ${metadata.version}.`);
149
+ const result = await (0, app_1.updateApp)({
150
+ appId: existingApp.appId,
151
+ from: appParams.from,
152
+ args: updateArgs,
153
+ note: getAppDeploymentTransactionNote(metadata),
154
+ approvalProgram: appParams.approvalProgram,
155
+ clearStateProgram: appParams.clearStateProgram,
156
+ transactionParams: appParams.transactionParams,
157
+ suppressLog: appParams.suppressLog,
158
+ skipSending: false,
159
+ skipWaiting: false,
160
+ }, algod);
161
+ return {
162
+ transaction: result.transaction,
163
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
164
+ confirmation: result.confirmation,
165
+ appId: existingApp.appId,
166
+ appAddress: existingApp.appAddress,
167
+ createdMetadata: existingApp.createdMetadata,
168
+ createdRound: existingApp.createdRound,
169
+ updatedRound: Number(result.confirmation?.['confirmed-round']),
170
+ ...metadata,
171
+ deleted: false,
172
+ operationPerformed: 'update',
173
+ };
174
+ };
175
+ if (isSchemaBreak) {
176
+ _1.Config.getLogger(appParams.suppressLog).warn(`Detected a breaking app schema change in app ${existingApp.appId}:`, {
177
+ from: {
178
+ global: existingGlobalSchema,
179
+ local: existingLocalSchema,
180
+ },
181
+ to: {
182
+ global: newGlobalSchema,
183
+ local: newLocalSchema,
184
+ },
185
+ });
186
+ if (onSchemaBreak === undefined || onSchemaBreak === 'fail' || onSchemaBreak === app_2.OnSchemaBreak.Fail) {
187
+ throw new Error('Schema break detected and onSchemaBreak=OnSchemaBreak.Fail, stopping deployment. ' +
188
+ 'If you want to try deleting and recreating the app then ' +
189
+ 're-run with onSchemaBreak=OnSchemaBreak.ReplaceApp');
190
+ }
191
+ if (existingApp.deletable) {
192
+ _1.Config.getLogger(appParams.suppressLog).info('App is deletable and onSchemaBreak=ReplaceApp, will attempt to create new app and delete old app');
193
+ }
194
+ else {
195
+ _1.Config.getLogger(appParams.suppressLog).info('App is not deletable but onSchemaBreak=ReplaceApp, will attempt to delete app, delete will most likely fail');
196
+ }
197
+ return await replace();
198
+ }
199
+ if (isUpdate) {
200
+ _1.Config.getLogger(appParams.suppressLog).info(`Detected a TEAL update in app ${existingApp.appId} for creator ${(0, transaction_1.getSenderAddress)(appParams.from)}`);
201
+ if (onUpdate === undefined || onUpdate === 'fail' || onUpdate === app_2.OnUpdate.Fail) {
202
+ throw new Error('Update detected and onUpdate=Fail, stopping deployment. ' +
203
+ 'If you want to try deleting and recreating the app then ' +
204
+ 're-run with onUpdate=UpdateApp');
205
+ }
206
+ if (onUpdate === 'update' || onUpdate === app_2.OnUpdate.UpdateApp) {
207
+ if (existingApp.updatable) {
208
+ _1.Config.getLogger(appParams.suppressLog).info(`App is updatable and onUpdate=UpdateApp, updating app...`);
209
+ }
210
+ else {
211
+ _1.Config.getLogger(appParams.suppressLog).warn(`App is not updatable but onUpdate=UpdateApp, will attempt to update app, update will most likely fail`);
212
+ }
213
+ return await update();
214
+ }
215
+ if (onUpdate === 'replace' || onUpdate === app_2.OnUpdate.ReplaceApp) {
216
+ if (existingApp.deletable) {
217
+ _1.Config.getLogger(appParams.suppressLog).warn('App is deletable and onUpdate=ReplaceApp, creating new app and deleting old app...');
218
+ }
219
+ else {
220
+ _1.Config.getLogger(appParams.suppressLog).warn('App is not deletable and onUpdate=ReplaceApp, will attempt to create new app and delete old app, delete will most likely fail');
221
+ }
222
+ return await replace();
223
+ }
224
+ }
225
+ _1.Config.getLogger(appParams.suppressLog).debug('No detected changes in app, nothing to do.');
226
+ return { ...existingApp, operationPerformed: 'nothing' };
227
+ }
228
+ exports.deployApp = deployApp;
229
+ /** Returns true is there is a breaking change in the application state schema from before to after.
230
+ * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.
231
+ * Otherwise, there is no error, the app just doesn't store data in the extra schema :(
232
+ *
233
+ * @param before The existing schema
234
+ * @param after The new schema
235
+ * @returns Whether or not there is a breaking change
236
+ */
237
+ function isSchemaIsBroken(before, after) {
238
+ return before['num-byte-slice'] < after['num-byte-slice'] || before['num-uint'] < after['num-uint'];
239
+ }
240
+ exports.isSchemaIsBroken = isSchemaIsBroken;
241
+ /**
242
+ * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an @see {AppDeployNote} in the transaction note of the creation transaction.
243
+ *
244
+ * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).
245
+ *
246
+ * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for
247
+ * @param indexer An indexer client
248
+ * @returns A name-based lookup of the app information (id, address)
249
+ */
250
+ async function getCreatorAppsByName(creatorAccount, indexer) {
251
+ const appLookup = {};
252
+ const creatorAddress = typeof creatorAccount !== 'string' ? (0, transaction_1.getSenderAddress)(creatorAccount) : creatorAccount;
253
+ // Extract all apps that account created
254
+ const createdApps = (await (0, indexer_lookup_1.lookupAccountCreatedApplicationByAddress)(indexer, creatorAddress)).map((a) => {
255
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
256
+ return { id: a.id, createdAtRound: a['created-at-round'], deleted: a.deleted };
257
+ });
258
+ // For each app that account created (in parallel)...
259
+ await Promise.all(createdApps.map(async (createdApp) => {
260
+ // Find any app transactions for that app in the round it was created (should always just be a single creation transaction)
261
+ const appTransactions = await (0, indexer_lookup_1.searchTransactions)(indexer, (s) => s
262
+ .minRound(createdApp.createdAtRound)
263
+ .txType(algosdk_1.TransactionType.appl)
264
+ .applicationID(createdApp.id)
265
+ .address(creatorAddress)
266
+ .addressRole('sender')
267
+ .notePrefix(Buffer.from(app_2.APP_DEPLOY_NOTE_DAPP).toString('base64')));
268
+ // Triple check the transaction is intact by filtering for the one we want:
269
+ // * application-id is 0 when the app is first created
270
+ // * also verify the sender to prevent a potential security risk
271
+ const appCreationTransaction = appTransactions.transactions.filter(
272
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
273
+ (t) => t['application-transaction']['application-id'] === 0 && t.sender === creatorAddress)[0];
274
+ const latestAppUpdateTransaction = appTransactions.transactions
275
+ .filter((t) => t.sender === creatorAddress)
276
+ .sort((a, b) => a['confirmed-round'] === b['confirmed-round']
277
+ ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
278
+ (b['intra-round-offset'] - a['intra-round-offset']) / 10
279
+ : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
280
+ b['confirmed-round'] - a['confirmed-round'])[0];
281
+ if (!appCreationTransaction?.note)
282
+ // No note; ignoring
283
+ return;
284
+ const parseNote = (note) => {
285
+ if (!note) {
286
+ // No note; ignoring...
287
+ return;
288
+ }
289
+ const decoder = new TextDecoder();
290
+ const noteAsBase64 = decoder.decode(Buffer.from(note));
291
+ const noteAsString = Buffer.from(noteAsBase64, 'base64').toString('utf-8');
292
+ if (!noteAsString.startsWith(`${app_2.APP_DEPLOY_NOTE_DAPP}:j{`))
293
+ // Clearly not APP_DEPLOY JSON; ignoring...
294
+ return;
295
+ return JSON.parse(noteAsString.substring(app_2.APP_DEPLOY_NOTE_DAPP.length + 2));
296
+ };
297
+ try {
298
+ const creationNote = parseNote(appCreationTransaction.note);
299
+ const updateNote = parseNote(latestAppUpdateTransaction.note);
300
+ if (creationNote?.name) {
301
+ appLookup[creationNote.name] = {
302
+ appId: createdApp.id,
303
+ appAddress: (0, algosdk_1.getApplicationAddress)(createdApp.id),
304
+ createdMetadata: creationNote,
305
+ createdRound: Number(appCreationTransaction['confirmed-round']),
306
+ ...(updateNote ?? creationNote),
307
+ updatedRound: Number(latestAppUpdateTransaction?.['confirmed-round']),
308
+ deleted: createdApp.deleted ?? false,
309
+ };
310
+ }
311
+ }
312
+ catch (e) {
313
+ _1.Config.logger.warn(`Received error trying to retrieve app with ${createdApp.id} for creator ${creatorAddress}; failing silently`, e);
314
+ return;
315
+ }
316
+ }));
317
+ return {
318
+ creator: creatorAddress,
319
+ apps: appLookup,
320
+ };
321
+ }
322
+ exports.getCreatorAppsByName = getCreatorAppsByName;
323
+ /**
324
+ * Return the transaction note for an app deployment.
325
+ * @param metadata The metadata of the deployment
326
+ * @returns The transaction note as a utf-8 string
327
+ */
328
+ function getAppDeploymentTransactionNote(metadata) {
329
+ return {
330
+ dAppName: app_2.APP_DEPLOY_NOTE_DAPP,
331
+ data: metadata,
332
+ format: 'j',
333
+ };
334
+ }
335
+ exports.getAppDeploymentTransactionNote = getAppDeploymentTransactionNote;
336
+ /**
337
+ * Replaces deploy-time deployment control parameters within the given teal code.
338
+ *
339
+ * @see {UPDATABLE_TEMPLATE_NAME}
340
+ * @see {DELETABLE_TEMPLATE_NAME}
341
+ *
342
+ * @param tealCode The TEAL code to substitute
343
+ * @param params The deploy-time deployment control parameter value to replace
344
+ * @returns The replaced TEAL code
345
+ */
346
+ function replaceDeployTimeControlParams(tealCode, params) {
347
+ if (params.updatable !== undefined) {
348
+ if (!tealCode.includes(app_2.UPDATABLE_TEMPLATE_NAME)) {
349
+ throw new Error(`Deploy-time updatability control requested for app deployment, but ${app_2.UPDATABLE_TEMPLATE_NAME} not present in TEAL code`);
350
+ }
351
+ tealCode = tealCode.replace(new RegExp(app_2.UPDATABLE_TEMPLATE_NAME, 'g'), (params.updatable ? 1 : 0).toString());
352
+ }
353
+ if (params.deletable !== undefined) {
354
+ if (!tealCode.includes(app_2.DELETABLE_TEMPLATE_NAME)) {
355
+ throw new Error(`Deploy-time deletability control requested for app deployment, but ${app_2.DELETABLE_TEMPLATE_NAME} not present in TEAL code`);
356
+ }
357
+ tealCode = tealCode.replace(new RegExp(app_2.DELETABLE_TEMPLATE_NAME, 'g'), (params.deletable ? 1 : 0).toString());
358
+ }
359
+ return tealCode;
360
+ }
361
+ exports.replaceDeployTimeControlParams = replaceDeployTimeControlParams;
362
+ /**
363
+ * Performs template substitution of a teal file.
364
+ *
365
+ * Looks for `TMPL_{parameter}` for template replacements.
366
+ *
367
+ * @param tealCode The TEAL logic to compile
368
+ * @param templateParameters Any parameters to replace in the .teal file before compiling
369
+ * @returns The TEAL code with replacements
370
+ */
371
+ function performTemplateSubstitution(tealCode, templateParameters) {
372
+ if (templateParameters !== undefined) {
373
+ for (const key in templateParameters) {
374
+ const value = templateParameters[key];
375
+ const token = `TMPL_${key.replace(/^TMPL_/, '')}`;
376
+ tealCode = tealCode.replace(new RegExp(token, 'g'), typeof value === 'string'
377
+ ? `0x${Buffer.from(value, 'utf-8').toString('hex')}`
378
+ : ArrayBuffer.isView(value)
379
+ ? `0x${Buffer.from(value).toString('hex')}`
380
+ : value.toString());
381
+ }
382
+ }
383
+ return tealCode;
384
+ }
385
+ exports.performTemplateSubstitution = performTemplateSubstitution;
386
+ /**
387
+ * Performs template substitution of a teal file and compiles it, returning the compiled result.
388
+ *
389
+ * Looks for `TMPL_{parameter}` for template replacements.
390
+ *
391
+ * @param tealCode The TEAL logic to compile
392
+ * @param algod An algod client
393
+ * @param templateParameters Any parameters to replace in the .teal file before compiling
394
+ * @param deploymentMetadata The deployment metadata the app will be deployed with
395
+ * @returns The information about the compiled code
396
+ */
397
+ async function performTemplateSubstitutionAndCompile(tealCode, algod, templateParameters, deploymentMetadata) {
398
+ tealCode = performTemplateSubstitution(tealCode, templateParameters);
399
+ if (deploymentMetadata) {
400
+ tealCode = replaceDeployTimeControlParams(tealCode, deploymentMetadata);
401
+ }
402
+ const compiled = await algod.compile(tealCode).do();
403
+ return {
404
+ teal: tealCode,
405
+ compiled: compiled.result,
406
+ compiledHash: compiled.hash,
407
+ compiledBase64ToBytes: new Uint8Array(Buffer.from(compiled.result, 'base64')),
408
+ };
409
+ }
410
+ exports.performTemplateSubstitutionAndCompile = performTemplateSubstitutionAndCompile;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AAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;oBAC3C,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CACrB,CAAA;SACF;KACF;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AAjBD,kEAiBC;AAED;;;;;;;;;;GAUG;AACI,KAAK,UAAU,qCAAqC,CACzD,QAAgB,EAChB,KAAc,EACd,kBAA2C,EAC3C,kBAAsC;IAEtC,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;IAEpE,IAAI,kBAAkB,EAAE;QACtB,QAAQ,GAAG,8BAA8B,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;KACxE;IAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAA;IACnD,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,QAAQ,CAAC,MAAM;QACzB,YAAY,EAAE,QAAQ,CAAC,IAAI;QAC3B,qBAAqB,EAAE,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KAC9E,CAAA;AACH,CAAC;AAnBD,sFAmBC"}
package/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { UpdatableConfig } from './types/config';
2
+ export * from './account';
3
+ export * from './amount';
4
+ export * from './app';
5
+ export * from './application-client';
6
+ export * from './deploy-app';
7
+ export * from './indexer-lookup';
8
+ export * from './localnet';
9
+ export * from './network-client';
10
+ export * from './transaction';
11
+ export * from './transfer';
12
+ /** The AlgoKit config. To update it use the configure method. */
13
+ export declare const Config: UpdatableConfig;
14
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,sBAAsB,CAAA;AACpC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAE1B,iEAAiE;AACjE,eAAO,MAAM,MAAM,iBAAwB,CAAA"}
package/index.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Config = void 0;
18
+ const config_1 = require("./types/config");
19
+ __exportStar(require("./account"), exports);
20
+ __exportStar(require("./amount"), exports);
21
+ __exportStar(require("./app"), exports);
22
+ __exportStar(require("./application-client"), exports);
23
+ __exportStar(require("./deploy-app"), exports);
24
+ __exportStar(require("./indexer-lookup"), exports);
25
+ __exportStar(require("./localnet"), exports);
26
+ __exportStar(require("./network-client"), exports);
27
+ __exportStar(require("./transaction"), exports);
28
+ __exportStar(require("./transfer"), exports);
29
+ /** The AlgoKit config. To update it use the configure method. */
30
+ exports.Config = new config_1.UpdatableConfig();
31
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAgD;AAEhD,4CAAyB;AACzB,2CAAwB;AACxB,wCAAqB;AACrB,uDAAoC;AACpC,+CAA4B;AAC5B,mDAAgC;AAChC,6CAA0B;AAC1B,mDAAgC;AAChC,gDAA6B;AAC7B,6CAA0B;AAE1B,iEAAiE;AACpD,QAAA,MAAM,GAAG,IAAI,wBAAe,EAAE,CAAA"}
@@ -0,0 +1,31 @@
1
+ import { Indexer } from 'algosdk';
2
+ import SearchForTransactions from 'algosdk/dist/types/client/v2/indexer/searchForTransactions';
3
+ import { ApplicationResult, TransactionLookupResult, TransactionSearchResults } from './types/indexer';
4
+ /**
5
+ * Looks up a transaction by ID using Indexer.
6
+ * @param indexer An indexer client
7
+ * @param transactionId The ID of the transaction to look up
8
+ * @returns The result of the look-up
9
+ */
10
+ export declare function lookupTransactionById(transactionId: string, indexer: Indexer): Promise<TransactionLookupResult>;
11
+ /**
12
+ * Looks up applications that were created by the given address.
13
+ * @param indexer An indexer instance
14
+ * @param address The address of the creator to look up
15
+ * @param getAll Whether or not to include deleted applications
16
+ * @param paginationLimit The number of records to return per paginated request, default @see {DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT}
17
+ * @returns The list of application results
18
+ */
19
+ export declare function lookupAccountCreatedApplicationByAddress(indexer: Indexer, address: string, getAll?: boolean | undefined, paginationLimit?: number): Promise<ApplicationResult[]>;
20
+ /**
21
+ * Allows transactions to be searched for the given criteria.
22
+ * @param indexer An indexer client
23
+ * @param searchCriteria The criteria to search for
24
+ * @param paginationLimit The number of records to return per paginated request, default @see {DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT}
25
+ * @returns The search results
26
+ */
27
+ export declare function searchTransactions(indexer: Indexer, searchCriteria: (s: SearchForTransactions) => SearchForTransactions, paginationLimit?: number): Promise<TransactionSearchResults>;
28
+ export declare function executePaginatedRequest<TResult, TRequest extends {
29
+ do: () => Promise<any>;
30
+ }>(extractItems: (response: any) => TResult[], buildRequest: (nextToken?: string) => TRequest): Promise<TResult[]>;
31
+ //# sourceMappingURL=indexer-lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer-lookup.d.ts","sourceRoot":"","sources":["../src/indexer-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,qBAAqB,MAAM,4DAA4D,CAAA;AAC9F,OAAO,EAAkC,iBAAiB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAItI;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAErH;AAED;;;;;;;GAOG;AACH,wBAAsB,wCAAwC,CAC5D,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,OAAO,GAAG,SAAqB,EACvC,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAmB9B;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,qBAAqB,EACnE,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,wBAAwB,CAAC,CA0BnC;AAID,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,QAAQ,SAAS;IAAE,EAAE,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,EAEhG,YAAY,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,OAAO,EAAE,EAC1C,YAAY,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,QAAQ,GAC7C,OAAO,CAAC,OAAO,EAAE,CAAC,CAoBpB"}