@algorandfoundation/algokit-utils 1.0.0-beta.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/account.d.ts +35 -31
  2. package/account.d.ts.map +1 -1
  3. package/account.js +53 -39
  4. package/account.js.map +1 -1
  5. package/amount.d.ts +8 -0
  6. package/amount.d.ts.map +1 -0
  7. package/amount.js +24 -0
  8. package/amount.js.map +1 -0
  9. package/app.d.ts +64 -145
  10. package/app.d.ts.map +1 -1
  11. package/app.js +197 -39
  12. package/app.js.map +1 -1
  13. package/application-client.d.ts +9 -112
  14. package/application-client.d.ts.map +1 -1
  15. package/application-client.js +11 -254
  16. package/application-client.js.map +1 -1
  17. package/deploy-app.d.ts +20 -91
  18. package/deploy-app.d.ts.map +1 -1
  19. package/deploy-app.js +84 -93
  20. package/deploy-app.js.map +1 -1
  21. package/index.d.ts +4 -2
  22. package/index.d.ts.map +1 -1
  23. package/index.js +5 -2
  24. package/index.js.map +1 -1
  25. package/localnet.d.ts +4 -4
  26. package/localnet.d.ts.map +1 -1
  27. package/localnet.js +10 -10
  28. package/localnet.js.map +1 -1
  29. package/network-client.d.ts +11 -20
  30. package/network-client.d.ts.map +1 -1
  31. package/network-client.js +11 -11
  32. package/network-client.js.map +1 -1
  33. package/package.json +2 -2
  34. package/testing/account.d.ts +14 -0
  35. package/testing/account.d.ts.map +1 -0
  36. package/testing/account.js +31 -0
  37. package/testing/account.js.map +1 -0
  38. package/testing/fixtures/algokit-log-capture-fixture.d.ts +19 -0
  39. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
  40. package/testing/fixtures/algokit-log-capture-fixture.js +43 -0
  41. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
  42. package/testing/fixtures/algorand-fixture.d.ts +20 -0
  43. package/testing/fixtures/algorand-fixture.d.ts.map +1 -0
  44. package/testing/fixtures/algorand-fixture.js +49 -0
  45. package/testing/fixtures/algorand-fixture.js.map +1 -0
  46. package/testing/fixtures/index.d.ts +3 -0
  47. package/testing/fixtures/index.d.ts.map +1 -0
  48. package/testing/fixtures/index.js +19 -0
  49. package/testing/fixtures/index.js.map +1 -0
  50. package/testing/index.d.ts +6 -0
  51. package/testing/index.d.ts.map +1 -0
  52. package/testing/index.js +22 -0
  53. package/testing/index.js.map +1 -0
  54. package/testing/indexer.d.ts +12 -0
  55. package/testing/indexer.d.ts.map +1 -0
  56. package/testing/indexer.js +39 -0
  57. package/testing/indexer.js.map +1 -0
  58. package/testing/test-logger.d.ts +39 -0
  59. package/testing/test-logger.d.ts.map +1 -0
  60. package/testing/test-logger.js +69 -0
  61. package/testing/test-logger.js.map +1 -0
  62. package/testing/transaction-logger.d.ts +29 -0
  63. package/testing/transaction-logger.d.ts.map +1 -0
  64. package/testing/transaction-logger.js +71 -0
  65. package/testing/transaction-logger.js.map +1 -0
  66. package/transaction.d.ts +4 -81
  67. package/transaction.d.ts.map +1 -1
  68. package/transaction.js +39 -89
  69. package/transaction.js.map +1 -1
  70. package/transfer.d.ts +13 -16
  71. package/transfer.d.ts.map +1 -1
  72. package/transfer.js +35 -3
  73. package/transfer.js.map +1 -1
  74. package/types/account.d.ts +52 -0
  75. package/types/account.d.ts.map +1 -0
  76. package/types/account.js +86 -0
  77. package/types/account.js.map +1 -0
  78. package/types/algo-http-client-with-retry.d.ts.map +1 -0
  79. package/{algo-http-client-with-retry.js → types/algo-http-client-with-retry.js} +2 -2
  80. package/types/algo-http-client-with-retry.js.map +1 -0
  81. package/types/algod.d.ts +22 -9
  82. package/types/algod.d.ts.map +1 -1
  83. package/{algo-amount.d.ts → types/amount.d.ts} +3 -1
  84. package/types/amount.d.ts.map +1 -0
  85. package/{algo-amount.js → types/amount.js} +7 -1
  86. package/types/amount.js.map +1 -0
  87. package/types/app.d.ts +279 -0
  88. package/types/app.d.ts.map +1 -0
  89. package/types/app.js +32 -0
  90. package/types/app.js.map +1 -0
  91. package/types/application-client.d.ts +229 -0
  92. package/types/application-client.d.ts.map +1 -0
  93. package/types/application-client.js +470 -0
  94. package/types/application-client.js.map +1 -0
  95. package/types/appspec.d.ts +1 -2
  96. package/types/appspec.d.ts.map +1 -1
  97. package/types/appspec.js.map +1 -1
  98. package/types/config.d.ts +15 -0
  99. package/types/config.d.ts.map +1 -0
  100. package/types/config.js +27 -0
  101. package/types/config.js.map +1 -0
  102. package/types/indexer.d.ts +8 -9
  103. package/types/indexer.d.ts.map +1 -1
  104. package/{config.d.ts → types/logging.d.ts} +2 -16
  105. package/types/logging.d.ts.map +1 -0
  106. package/{config.js → types/logging.js} +5 -24
  107. package/types/logging.js.map +1 -0
  108. package/types/logic-error.d.ts +33 -0
  109. package/types/logic-error.d.ts.map +1 -0
  110. package/types/logic-error.js +46 -0
  111. package/types/logic-error.js.map +1 -0
  112. package/types/network-client.d.ts +11 -0
  113. package/types/network-client.d.ts.map +1 -0
  114. package/types/network-client.js +3 -0
  115. package/types/network-client.js.map +1 -0
  116. package/types/testing.d.ts +89 -0
  117. package/types/testing.d.ts.map +1 -0
  118. package/types/testing.js +3 -0
  119. package/types/testing.js.map +1 -0
  120. package/types/transaction.d.ts +67 -0
  121. package/types/transaction.d.ts.map +1 -0
  122. package/types/transaction.js +3 -0
  123. package/types/transaction.js.map +1 -0
  124. package/types/transfer.d.ts +32 -0
  125. package/types/transfer.d.ts.map +1 -0
  126. package/types/transfer.js +3 -0
  127. package/types/transfer.js.map +1 -0
  128. package/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
  129. package/types/urlTokenBaseHTTPClient.js.map +1 -0
  130. package/algo-amount.d.ts.map +0 -1
  131. package/algo-amount.js.map +0 -1
  132. package/algo-http-client-with-retry.d.ts.map +0 -1
  133. package/algo-http-client-with-retry.js.map +0 -1
  134. package/config.d.ts.map +0 -1
  135. package/config.js.map +0 -1
  136. package/urlTokenBaseHTTPClient.d.ts.map +0 -1
  137. package/urlTokenBaseHTTPClient.js.map +0 -1
  138. /package/{algo-http-client-with-retry.d.ts → types/algo-http-client-with-retry.d.ts} +0 -0
  139. /package/{urlTokenBaseHTTPClient.d.ts → types/urlTokenBaseHTTPClient.d.ts} +0 -0
  140. /package/{urlTokenBaseHTTPClient.js → types/urlTokenBaseHTTPClient.js} +0 -0
@@ -1,258 +1,15 @@
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ApplicationClient = void 0;
27
- const algosdk_1 = __importStar(require("algosdk"));
28
- const buffer_1 = require("buffer");
29
- const app_1 = require("./app");
30
- const deploy_app_1 = require("./deploy-app");
31
- const transaction_1 = require("./transaction");
32
- const appspec_1 = require("./types/appspec");
33
- class ApplicationClient {
34
- constructor(appDetails, algod, indexer) {
35
- const { app, sender, params, ...appIdentifier } = appDetails;
36
- this.algod = algod;
37
- this.indexer = indexer;
38
- this.appSpec = typeof app == 'string' ? JSON.parse(app) : app;
39
- if ('creatorAddress' in appIdentifier) {
40
- this._creator = appIdentifier.creatorAddress;
41
- if (appIdentifier.existingDeployments && appIdentifier.existingDeployments.creator !== this._creator) {
42
- throw new Error(`Attempt to create application client with invalid existingDeployments against a different creator (${appIdentifier.existingDeployments.creator}) instead of expected creator ${this._creator}`);
43
- }
44
- this.existingDeployments = appIdentifier.existingDeployments;
45
- this._appIndex = 0;
46
- }
47
- else {
48
- if (appIdentifier.index < 0) {
49
- throw new Error(`Attempt to create application client with invalid app index of ${appIdentifier.index}`);
50
- }
51
- this._appIndex = appIdentifier.index;
52
- }
53
- this._appAddress = algosdk_1.default.getApplicationAddress(this._appIndex);
54
- this.sender = sender;
55
- this.params = params;
56
- // todo: find create, update, delete, etc. methods from app spec
57
- }
58
- /**
59
- * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
60
- *
61
- * 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
62
- *
63
- * **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.
64
- *
65
- * **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.
66
- * @param deploy Deployment details
67
- * @returns The metadata and transaction result(s) of the deployment, or just the metadata if it didn't need to issue transactions
68
- */
69
- async deploy(deploy) {
70
- const { sender, version, allowUpdate, allowDelete, sendParams, ...deployArgs } = deploy;
71
- if (this._appIndex !== 0) {
72
- throw new Error(`Attempt to deploy app which already has an app index of ${this._appIndex}`);
73
- }
74
- if (!sender && !this.sender) {
75
- throw new Error('No sender provided, unable to deploy app');
76
- }
77
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
78
- const from = sender ?? this.sender;
79
- if (!this._creator) {
80
- throw new Error('Attempt to deploy a contract without having specified a creator');
81
- }
82
- if (this._creator !== (0, transaction_1.getSenderAddress)(from)) {
83
- throw new Error(`Attempt to deploy contract with a sender address (${(0, transaction_1.getSenderAddress)(from)}) that differs from the given creator address for this application client: ${this._creator}`);
84
- }
85
- const approval = buffer_1.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
86
- const clear = buffer_1.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
87
- await this.loadAppReference();
88
- const result = await (0, deploy_app_1.deployApp)({
89
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
90
- from,
91
- approvalProgram: approval,
92
- clearStateProgram: clear,
93
- metadata: {
94
- name: this.appSpec.contract.name,
95
- version: version,
96
- updatable: allowUpdate ??
97
- ((!this.appSpec.bare_call_config.update_application && this.appSpec.bare_call_config.update_application !== 'NEVER') ||
98
- !!Object.keys(this.appSpec.hints).filter((h) => !this.appSpec.hints[h].call_config.update_application && this.appSpec.hints[h].call_config.update_application !== 'NEVER')[0]),
99
- deletable: allowDelete ??
100
- ((!this.appSpec.bare_call_config.delete_application && this.appSpec.bare_call_config.delete_application !== 'NEVER') ||
101
- !!Object.keys(this.appSpec.hints).filter((h) => !this.appSpec.hints[h].call_config.delete_application && this.appSpec.hints[h].call_config.delete_application !== 'NEVER')[0]),
102
- },
103
- schema: {
104
- globalByteSlices: this.appSpec.state.global.num_byte_slices,
105
- globalInts: this.appSpec.state.global.num_uints,
106
- localByteSlices: this.appSpec.state.local.num_byte_slices,
107
- localInts: this.appSpec.state.local.num_uints,
108
- },
109
- transactionParams: this.params,
110
- ...(sendParams ?? {}),
111
- ...deployArgs,
112
- existingDeployments: this.existingDeployments,
113
- }, this.algod, this.indexer);
114
- // Nothing needed to happen
115
- if (!('transaction' in result)) {
116
- return result;
117
- }
118
- if (!this.existingDeployments) {
119
- throw new Error('Expected existingDeployments to be present');
120
- }
121
- const { transaction, confirmation, operationPerformed, ...appMetadata } = result;
122
- if ('deleteResult' in appMetadata) {
123
- delete appMetadata.deleteResult;
124
- }
125
- this.existingDeployments = {
126
- creator: this.existingDeployments.creator,
127
- apps: { ...this.existingDeployments.apps, [this.appSpec.contract.name]: appMetadata },
128
- };
129
- return result;
130
- }
131
- async create(create) {
132
- const { sender, args, note, sendParams, deployTimeParameters } = create ?? {};
133
- // todo: Add deploy-time updatable/etc.
134
- if (this._appIndex !== 0) {
135
- throw new Error(`Attempt to create app which already has an app index of ${this._appIndex}`);
136
- }
137
- if (!sender && !this.sender) {
138
- throw new Error('No sender provided, unable to create app');
139
- }
140
- const approval = buffer_1.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
141
- const clear = buffer_1.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
142
- const result = await (0, app_1.createApp)({
143
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
144
- from: sender ?? this.sender,
145
- approvalProgram: (0, deploy_app_1.performTemplateSubstitution)(approval, deployTimeParameters),
146
- clearStateProgram: (0, deploy_app_1.performTemplateSubstitution)(clear, deployTimeParameters),
147
- schema: {
148
- globalByteSlices: this.appSpec.state.global.num_byte_slices,
149
- globalInts: this.appSpec.state.global.num_uints,
150
- localByteSlices: this.appSpec.state.local.num_byte_slices,
151
- localInts: this.appSpec.state.local.num_uints,
152
- },
153
- args: args,
154
- note: note,
155
- transactionParams: this.params,
156
- ...(sendParams ?? {}),
157
- }, this.algod);
158
- if (result.confirmation) {
159
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
160
- this._appIndex = result.confirmation['application-index'];
161
- this._appAddress = (0, algosdk_1.getApplicationAddress)(this._appIndex);
162
- }
163
- return result;
164
- }
165
- async update(update) {
166
- const { sender, args, note, sendParams, deployTimeParameters } = update ?? {};
167
- if (this._appIndex === 0) {
168
- throw new Error(`Attempt to update app which doesn't have an app index defined`);
169
- }
170
- if (!sender && !this.sender) {
171
- throw new Error('No sender provided, unable to create app');
172
- }
173
- const approval = buffer_1.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
174
- const clear = buffer_1.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
175
- const result = await (0, app_1.updateApp)({
176
- appIndex: this._appIndex,
177
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
178
- from: sender ?? this.sender,
179
- approvalProgram: (0, deploy_app_1.performTemplateSubstitution)(approval, deployTimeParameters),
180
- clearStateProgram: (0, deploy_app_1.performTemplateSubstitution)(clear, deployTimeParameters),
181
- args: args,
182
- note: note,
183
- transactionParams: this.params,
184
- ...(sendParams ?? {}),
185
- }, this.algod);
186
- return result;
187
- }
188
- async call(call) {
189
- const { sender, callType, note, sendParams, ...args } = call;
190
- if (!sender && !this.sender) {
191
- throw new Error('No sender provided, unable to call app');
192
- }
193
- const appMetadata = await this.loadAppReference();
194
- if (appMetadata.appIndex === 0) {
195
- throw new Error(`Attempt to call an app that can't be found '${this.appSpec.contract.name}' for creator '${this._creator}'.`);
196
- }
197
- // todo: use this in create et. al. as well
198
- let callArgs;
199
- // ABI call
200
- if ('method' in args) {
201
- const abiMethod = this.getABIMethod(args.method);
202
- if (!abiMethod) {
203
- throw new Error(`Attempt to call ABI method ${args.method}, but it wasn't found`);
204
- }
205
- callArgs = {
206
- method: abiMethod,
207
- args: args.methodArgs,
208
- lease: args.lease,
209
- };
210
- }
211
- else {
212
- callArgs = args.args;
213
- }
214
- // todo: process ABI args as needed to make them nicer to deal with like beaker-ts???
215
- // todo: support unwrapping a logic error?
216
- return (0, app_1.callApp)({
217
- appIndex: appMetadata.appIndex,
218
- callType: callType,
219
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
220
- from: sender ?? this.sender,
221
- args: callArgs,
222
- note: note,
223
- transactionParams: this.params,
224
- ...(sendParams ?? {}),
225
- }, this.algod);
226
- }
227
- getABIMethod(method) {
228
- if (!method.includes('(')) {
229
- const methods = this.appSpec.contract.methods.filter((m) => m.name === method);
230
- if (methods.length > 1) {
231
- throw new Error(`Received a call to method ${method} in contract ${this.appSpec.contract.name}, but this resolved to multiple methods; please pass in an ABI signature instead: ${methods.map(appspec_1.getABISignature).join(', ')}`);
232
- }
233
- return methods[0];
234
- }
235
- return this.appSpec.contract.methods.find((m) => (0, appspec_1.getABISignature)(m) === method);
236
- }
237
- async loadAppReference() {
238
- if (!this.existingDeployments && this._creator) {
239
- this.existingDeployments = await (0, deploy_app_1.getCreatorAppsByName)(this._creator, this.indexer);
240
- }
241
- if (this.existingDeployments && this._appIndex === 0) {
242
- const app = this.existingDeployments.apps[this.appSpec.contract.name];
243
- if (!app) {
244
- return {
245
- appIndex: 0,
246
- appAddress: (0, algosdk_1.getApplicationAddress)(0),
247
- };
248
- }
249
- return app;
250
- }
251
- return {
252
- appIndex: this._appIndex,
253
- appAddress: this._appAddress,
254
- };
255
- }
3
+ exports.getApplicationClient = void 0;
4
+ const application_client_1 = require("./types/application-client");
5
+ /**
6
+ * Create a new ApplicationClient instance
7
+ * @param appDetails The details of the app
8
+ * @param algod An algod instance
9
+ * @returns The application client
10
+ */
11
+ function getApplicationClient(appDetails, algod) {
12
+ return new application_client_1.ApplicationClient(appDetails, algod);
256
13
  }
257
- exports.ApplicationClient = ApplicationClient;
14
+ exports.getApplicationClient = getApplicationClient;
258
15
  //# sourceMappingURL=application-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"application-client.js","sourceRoot":"","sources":["../src/application-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAyH;AACzH,mCAA+B;AAC/B,+BAAgG;AAChG,6CASqB;AACrB,+CAA6G;AAC7G,6CAA0D;AAE1D,MAAa,iBAAiB;IAY5B,YACE,UAqBC,EACD,KAAc,EACd,OAAgB;QAEhB,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,GAAG,UAAU,CAAA;QAC5D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAa,CAAC,CAAC,CAAC,GAAG,CAAA;QAE1E,IAAI,gBAA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,CAAC,WAAW;SACb,CAAA;IACnB,CAAC;CACF;AA7XD,8CA6XC"}
1
+ {"version":3,"file":"application-client.js","sourceRoot":"","sources":["../src/application-client.ts"],"names":[],"mappings":";;;AACA,mEAAiF;AAEjF;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,UAA6B,EAAE,KAAc;IAChF,OAAO,IAAI,sCAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAFD,oDAEC"}
package/deploy-app.d.ts CHANGED
@@ -1,105 +1,30 @@
1
1
  import { Algodv2, Indexer } from 'algosdk';
2
- import { AppCallArgs, AppReference, CompiledTeal, CreateAppParams } from './app';
3
- import { SendTransactionFrom, SendTransactionResult } from './transaction';
4
2
  import { ApplicationStateSchema } from './types/algod';
5
- export declare const UPDATABLE_TEMPLATE_NAME = "TMPL_UPDATABLE";
6
- export declare const DELETABLE_TEMPLATE_NAME = "TMPL_DELETABLE";
7
- export declare const APP_DEPLOY_NOTE_PREFIX = "APP_DEPLOY::";
8
- /**
9
- * The payload of the metadata to add to the transaction note when deploying an app, noting it will be prefixed with @see {APP_DEPLOY_NOTE_PREFIX}.
10
- */
11
- export interface AppDeployMetadata {
12
- /** The unique name identifier of the app within the creator account */
13
- name: string;
14
- /** The version of app that is / will be deployed */
15
- version: string;
16
- /** Whether or not the app is deletable / permanent / unspecified */
17
- deletable?: boolean;
18
- /** Whether or not the app is updatable / immutable / unspecified */
19
- updatable?: boolean;
20
- }
21
- /** The metadata that can be collected about a deployed app */
22
- export interface AppMetadata extends AppReference, AppDeployMetadata {
23
- /** The round the app was created */
24
- createdRound: number;
25
- /** The last round that the app was updated */
26
- updatedRound: number;
27
- /** The metadata when the app was created */
28
- createdMetadata: AppDeployMetadata;
29
- /** Whether or not the app is deleted */
30
- deleted: boolean;
31
- }
32
- /** A lookup of name -> Algorand app for a creator */
33
- export interface AppLookup {
34
- creator: Readonly<string>;
35
- apps: Readonly<{
36
- [name: string]: AppMetadata;
37
- }>;
38
- }
39
- /** Dictionary of deploy-time parameters to replace in a teal template.
40
- *
41
- * Note: Looks for `TMPL_{parameter}` for template replacements i.e. you can leave out the `TMPL_`.
42
- *
43
- */
44
- export interface TealTemplateParameters {
45
- [key: string]: string | bigint | number | Uint8Array;
46
- }
47
- /** What action to perform when deploying an app and an update is detected in the TEAL code */
48
- export declare enum OnUpdate {
49
- /** Fail the deployment */
50
- Fail = 0,
51
- /** Update the app */
52
- UpdateApp = 1,
53
- /** Delete the app and create a new one in its place */
54
- ReplaceApp = 2
55
- }
56
- /** What action to perform when deploying an app and a breaking schema change is detected */
57
- export declare enum OnSchemaBreak {
58
- /** Fail the deployment */
59
- Fail = 0,
60
- /** Delete the app and create a new one in its place */
61
- ReplaceApp = 1
62
- }
63
- /** The parameters to deploy an app */
64
- export interface AppDeploymentParams extends Omit<CreateAppParams, 'args' | 'note' | 'skipSending' | 'skipWaiting'> {
65
- /** The deployment metadata */
66
- metadata: AppDeployMetadata;
67
- /** Any deploy-time parameters to replace in the TEAL code */
68
- deployTimeParameters?: TealTemplateParameters;
69
- /** What action to perform if a schema break is detected */
70
- onSchemaBreak?: 'replace' | 'fail' | OnSchemaBreak;
71
- /** What action to perform if a TEAL update is detected */
72
- onUpdate?: 'update' | 'replace' | 'fail' | OnUpdate;
73
- /** Optional cached value of the existing apps for the given creator */
74
- existingDeployments?: AppLookup;
75
- /** Any args to pass to any create transaction that is issued as part of deployment */
76
- createArgs?: AppCallArgs;
77
- /** Any args to pass to any update transaction that is issued as part of deployment */
78
- updateArgs?: AppCallArgs;
79
- /** Any args to pass to any delete transaction that is issued as part of deployment */
80
- deleteArgs?: AppCallArgs;
81
- }
3
+ import { AppCompilationResult, AppDeploymentParams, AppDeployMetadata, AppLookup, AppMetadata, CompiledTeal, TealTemplateParams } from './types/app';
4
+ import { ConfirmedTransactionResult, SendTransactionFrom } from './types/transaction';
82
5
  /**
83
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.
84
7
  *
85
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
86
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
+ *
87
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.
88
13
  *
89
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.
90
15
  * @param deployment The arguments to control the app deployment
91
16
  * @param algod An algod client
92
- * @param indexer An indexer client
17
+ * @param indexer An indexer client, needed if `existingDeployments` not passed in
93
18
  * @returns The app reference of the new/existing app
94
19
  */
95
- export declare function deployApp(deployment: AppDeploymentParams, algod: Algodv2, indexer: Indexer): Promise<(SendTransactionResult & AppMetadata & {
20
+ export declare function deployApp(deployment: AppDeploymentParams, algod: Algodv2, indexer?: Indexer): Promise<Partial<AppCompilationResult> & ((ConfirmedTransactionResult & AppMetadata & {
96
21
  operationPerformed: 'create' | 'update';
97
- }) | (SendTransactionResult & AppMetadata & {
98
- deleteResult?: SendTransactionResult;
22
+ }) | (ConfirmedTransactionResult & AppMetadata & {
23
+ deleteResult: ConfirmedTransactionResult;
99
24
  operationPerformed: 'replace';
100
25
  }) | (AppMetadata & {
101
- operationPerformed: 'none';
102
- })>;
26
+ operationPerformed: 'nothing';
27
+ }))>;
103
28
  /** Returns true is there is a breaking change in the application state schema from before to after.
104
29
  * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.
105
30
  * Otherwise, there is no error, the app just doesn't store data in the extra schema :(
@@ -108,7 +33,7 @@ export declare function deployApp(deployment: AppDeploymentParams, algod: Algodv
108
33
  * @param after The new schema
109
34
  * @returns Whether or not there is a breaking change
110
35
  */
111
- export declare function schemaIsBroken(before: ApplicationStateSchema, after: ApplicationStateSchema): boolean;
36
+ export declare function isSchemaIsBroken(before: ApplicationStateSchema, after: ApplicationStateSchema): boolean;
112
37
  /**
113
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.
114
39
  *
@@ -124,7 +49,11 @@ export declare function getCreatorAppsByName(creatorAccount: SendTransactionFrom
124
49
  * @param metadata The metadata of the deployment
125
50
  * @returns The transaction note as a utf-8 string
126
51
  */
127
- export declare function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): string;
52
+ export declare function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): {
53
+ dAppName: string;
54
+ data: AppDeployMetadata;
55
+ format: string;
56
+ };
128
57
  /**
129
58
  * Replaces deploy-time deployment control parameters within the given teal code.
130
59
  *
@@ -145,10 +74,10 @@ export declare function replaceDeployTimeControlParams(tealCode: string, params:
145
74
  * Looks for `TMPL_{parameter}` for template replacements.
146
75
  *
147
76
  * @param tealCode The TEAL logic to compile
148
- * @param templateParameters Any parameters to replace in the .teal file before compiling
77
+ * @param templateParams Any parameters to replace in the .teal file before compiling
149
78
  * @returns The TEAL code with replacements
150
79
  */
151
- export declare function performTemplateSubstitution(tealCode: string, templateParameters?: TealTemplateParameters): string;
80
+ export declare function performTemplateSubstitution(tealCode: string, templateParams?: TealTemplateParams): string;
152
81
  /**
153
82
  * Performs template substitution of a teal file and compiles it, returning the compiled result.
154
83
  *
@@ -156,9 +85,9 @@ export declare function performTemplateSubstitution(tealCode: string, templatePa
156
85
  *
157
86
  * @param tealCode The TEAL logic to compile
158
87
  * @param algod An algod client
159
- * @param templateParameters Any parameters to replace in the .teal file before compiling
88
+ * @param templateParams Any parameters to replace in the .teal file before compiling
160
89
  * @param deploymentMetadata The deployment metadata the app will be deployed with
161
90
  * @returns The information about the compiled code
162
91
  */
163
- export declare function performTemplateSubstitutionAndCompile(tealCode: string, algod: Algodv2, templateParameters?: TealTemplateParameters, deploymentMetadata?: AppDeployMetadata): Promise<CompiledTeal>;
92
+ export declare function performTemplateSubstitutionAndCompile(tealCode: string, algod: Algodv2, templateParams?: TealTemplateParams, deploymentMetadata?: AppDeployMetadata): Promise<CompiledTeal>;
164
93
  //# sourceMappingURL=deploy-app.d.ts.map
@@ -1 +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;AAClF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAW,YAAY,EAAa,eAAe,EAA4B,MAAM,OAAO,CAAA;AAG9H,OAAO,EAA6C,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AACrH,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAEtD,eAAO,MAAM,uBAAuB,mBAAmB,CAAA;AACvD,eAAO,MAAM,uBAAuB,mBAAmB,CAAA;AACvD,eAAO,MAAM,sBAAsB,iBAAiB,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAA;IACf,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,8DAA8D;AAC9D,MAAM,WAAW,WAAY,SAAQ,YAAY,EAAE,iBAAiB;IAClE,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,eAAe,EAAE,iBAAiB,CAAA;IAClC,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,qDAAqD;AACrD,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IACzB,IAAI,EAAE,QAAQ,CAAC;QACb,CAAC,IAAI,EA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