@algorandfoundation/algokit-utils 1.0.0-beta.3 → 1.0.0-beta.31

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 (180) hide show
  1. package/README.md +1 -1
  2. package/{dist/account.d.ts → account.d.ts} +36 -32
  3. package/account.d.ts.map +1 -0
  4. package/{dist/account.js → account.js} +55 -41
  5. package/account.js.map +1 -0
  6. package/amount.d.ts +8 -0
  7. package/amount.d.ts.map +1 -0
  8. package/amount.js +24 -0
  9. package/amount.js.map +1 -0
  10. package/app.d.ts +118 -0
  11. package/app.d.ts.map +1 -0
  12. package/app.js +541 -0
  13. package/app.js.map +1 -0
  14. package/application-client.d.ts +10 -0
  15. package/application-client.d.ts.map +1 -0
  16. package/application-client.js +15 -0
  17. package/application-client.js.map +1 -0
  18. package/deploy-app.d.ts +96 -0
  19. package/deploy-app.d.ts.map +1 -0
  20. package/{dist/deploy-app.js → deploy-app.js} +139 -114
  21. package/deploy-app.js.map +1 -0
  22. package/index.d.ts +14 -0
  23. package/index.d.ts.map +1 -0
  24. package/{dist/index.js → index.js} +6 -2
  25. package/index.js.map +1 -0
  26. package/{dist/localnet.d.ts → localnet.d.ts} +6 -6
  27. package/localnet.d.ts.map +1 -0
  28. package/{dist/localnet.js → localnet.js} +12 -12
  29. package/localnet.js.map +1 -0
  30. package/{dist/network-client.d.ts → network-client.d.ts} +15 -24
  31. package/network-client.d.ts.map +1 -0
  32. package/{dist/network-client.js → network-client.js} +16 -16
  33. package/{dist/network-client.js.map → network-client.js.map} +1 -1
  34. package/package.json +5 -93
  35. package/testing/account.d.ts +14 -0
  36. package/testing/account.d.ts.map +1 -0
  37. package/testing/account.js +31 -0
  38. package/testing/account.js.map +1 -0
  39. package/testing/fixtures/algokit-log-capture-fixture.d.ts +19 -0
  40. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
  41. package/testing/fixtures/algokit-log-capture-fixture.js +43 -0
  42. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
  43. package/testing/fixtures/algorand-fixture.d.ts +20 -0
  44. package/testing/fixtures/algorand-fixture.d.ts.map +1 -0
  45. package/testing/fixtures/algorand-fixture.js +49 -0
  46. package/testing/fixtures/algorand-fixture.js.map +1 -0
  47. package/testing/fixtures/index.d.ts +3 -0
  48. package/testing/fixtures/index.d.ts.map +1 -0
  49. package/testing/fixtures/index.js +19 -0
  50. package/testing/fixtures/index.js.map +1 -0
  51. package/testing/index.d.ts +6 -0
  52. package/testing/index.d.ts.map +1 -0
  53. package/testing/index.js +22 -0
  54. package/testing/index.js.map +1 -0
  55. package/testing/indexer.d.ts +12 -0
  56. package/testing/indexer.d.ts.map +1 -0
  57. package/testing/indexer.js +39 -0
  58. package/testing/indexer.js.map +1 -0
  59. package/testing/test-logger.d.ts +39 -0
  60. package/testing/test-logger.d.ts.map +1 -0
  61. package/testing/test-logger.js +69 -0
  62. package/testing/test-logger.js.map +1 -0
  63. package/testing/transaction-logger.d.ts +29 -0
  64. package/testing/transaction-logger.d.ts.map +1 -0
  65. package/testing/transaction-logger.js +71 -0
  66. package/testing/transaction-logger.js.map +1 -0
  67. package/transaction.d.ts +120 -0
  68. package/transaction.d.ts.map +1 -0
  69. package/transaction.js +316 -0
  70. package/transaction.js.map +1 -0
  71. package/transfer.d.ts +21 -0
  72. package/transfer.d.ts.map +1 -0
  73. package/transfer.js +65 -0
  74. package/transfer.js.map +1 -0
  75. package/types/account.d.ts +55 -0
  76. package/types/account.d.ts.map +1 -0
  77. package/types/account.js +91 -0
  78. package/types/account.js.map +1 -0
  79. package/types/algo-http-client-with-retry.d.ts.map +1 -0
  80. package/{dist → types}/algo-http-client-with-retry.js +2 -2
  81. package/types/algo-http-client-with-retry.js.map +1 -0
  82. package/{dist/types → types}/algod.d.ts +22 -9
  83. package/types/algod.d.ts.map +1 -0
  84. package/{dist/algo-amount.d.ts → types/amount.d.ts} +3 -1
  85. package/types/amount.d.ts.map +1 -0
  86. package/{dist/algo-amount.js → types/amount.js} +7 -1
  87. package/types/amount.js.map +1 -0
  88. package/types/app.d.ts +286 -0
  89. package/types/app.d.ts.map +1 -0
  90. package/types/app.js +32 -0
  91. package/types/app.js.map +1 -0
  92. package/types/application-client.d.ts +232 -0
  93. package/types/application-client.d.ts.map +1 -0
  94. package/types/application-client.js +470 -0
  95. package/types/application-client.js.map +1 -0
  96. package/types/appspec.d.ts +77 -0
  97. package/types/appspec.d.ts.map +1 -0
  98. package/types/appspec.js +15 -0
  99. package/types/appspec.js.map +1 -0
  100. package/types/config.d.ts +15 -0
  101. package/types/config.d.ts.map +1 -0
  102. package/types/config.js +27 -0
  103. package/types/config.js.map +1 -0
  104. package/{dist/types → types}/indexer.d.ts +8 -9
  105. package/{dist/types → types}/indexer.d.ts.map +1 -1
  106. package/{dist/config.d.ts → types/logging.d.ts} +2 -16
  107. package/types/logging.d.ts.map +1 -0
  108. package/{dist/config.js → types/logging.js} +5 -24
  109. package/types/logging.js.map +1 -0
  110. package/types/logic-error.d.ts +33 -0
  111. package/types/logic-error.d.ts.map +1 -0
  112. package/types/logic-error.js +46 -0
  113. package/types/logic-error.js.map +1 -0
  114. package/types/network-client.d.ts +11 -0
  115. package/types/network-client.d.ts.map +1 -0
  116. package/types/network-client.js +3 -0
  117. package/types/network-client.js.map +1 -0
  118. package/types/testing.d.ts +89 -0
  119. package/types/testing.d.ts.map +1 -0
  120. package/types/testing.js +3 -0
  121. package/types/testing.js.map +1 -0
  122. package/types/transaction.d.ts +85 -0
  123. package/types/transaction.d.ts.map +1 -0
  124. package/types/transaction.js +3 -0
  125. package/types/transaction.js.map +1 -0
  126. package/types/transfer.d.ts +32 -0
  127. package/types/transfer.d.ts.map +1 -0
  128. package/types/transfer.js +3 -0
  129. package/types/transfer.js.map +1 -0
  130. package/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
  131. package/types/urlTokenBaseHTTPClient.js.map +1 -0
  132. package/LICENSE +0 -21
  133. package/dist/account.d.ts.map +0 -1
  134. package/dist/account.js.map +0 -1
  135. package/dist/algo-amount.d.ts.map +0 -1
  136. package/dist/algo-amount.js.map +0 -1
  137. package/dist/algo-http-client-with-retry.d.ts.map +0 -1
  138. package/dist/algo-http-client-with-retry.js.map +0 -1
  139. package/dist/app.d.ts +0 -150
  140. package/dist/app.d.ts.map +0 -1
  141. package/dist/app.js +0 -156
  142. package/dist/app.js.map +0 -1
  143. package/dist/application-client.d.ts +0 -1
  144. package/dist/application-client.d.ts.map +0 -1
  145. package/dist/application-client.js +0 -69
  146. package/dist/application-client.js.map +0 -1
  147. package/dist/config.d.ts.map +0 -1
  148. package/dist/config.js.map +0 -1
  149. package/dist/deploy-app.d.ts +0 -149
  150. package/dist/deploy-app.d.ts.map +0 -1
  151. package/dist/deploy-app.js.map +0 -1
  152. package/dist/index.d.ts +0 -11
  153. package/dist/index.d.ts.map +0 -1
  154. package/dist/index.js.map +0 -1
  155. package/dist/localnet.d.ts.map +0 -1
  156. package/dist/localnet.js.map +0 -1
  157. package/dist/network-client.d.ts.map +0 -1
  158. package/dist/package.json +0 -20
  159. package/dist/transaction.d.ts +0 -152
  160. package/dist/transaction.d.ts.map +0 -1
  161. package/dist/transaction.js +0 -268
  162. package/dist/transaction.js.map +0 -1
  163. package/dist/transfer.d.ts +0 -24
  164. package/dist/transfer.d.ts.map +0 -1
  165. package/dist/transfer.js +0 -33
  166. package/dist/transfer.js.map +0 -1
  167. package/dist/types/algod.d.ts.map +0 -1
  168. package/dist/urlTokenBaseHTTPClient.d.ts.map +0 -1
  169. package/dist/urlTokenBaseHTTPClient.js.map +0 -1
  170. /package/{dist/indexer-lookup.d.ts → indexer-lookup.d.ts} +0 -0
  171. /package/{dist/indexer-lookup.d.ts.map → indexer-lookup.d.ts.map} +0 -0
  172. /package/{dist/indexer-lookup.js → indexer-lookup.js} +0 -0
  173. /package/{dist/indexer-lookup.js.map → indexer-lookup.js.map} +0 -0
  174. /package/{dist → types}/algo-http-client-with-retry.d.ts +0 -0
  175. /package/{dist/types → types}/algod.js +0 -0
  176. /package/{dist/types → types}/algod.js.map +0 -0
  177. /package/{dist/types → types}/indexer.js +0 -0
  178. /package/{dist/types → types}/indexer.js.map +0 -0
  179. /package/{dist → types}/urlTokenBaseHTTPClient.d.ts +0 -0
  180. /package/{dist → types}/urlTokenBaseHTTPClient.js +0 -0
package/app.js ADDED
@@ -0,0 +1,541 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.compileTeal = exports.getAppByIndex = exports.getAppArgsForABICall = exports.getAppArgsForTransaction = exports.decodeAppState = exports.getAppBoxValuesFromABIType = exports.getAppBoxValueFromABIType = exports.getAppBoxValues = exports.getAppBoxValue = exports.getAppBoxNames = exports.getAppLocalState = exports.getAppGlobalState = exports.getABIReturn = exports.callApp = exports.updateApp = exports.createApp = void 0;
27
+ const algosdk_1 = __importStar(require("algosdk"));
28
+ const buffer_1 = require("buffer");
29
+ const _1 = require("./");
30
+ const transaction_1 = require("./transaction");
31
+ const app_1 = require("./types/app");
32
+ /**
33
+ * Creates a smart contract app, returns the details of the created app.
34
+ * @param create The parameters to create the app with
35
+ * @param algod An algod client
36
+ * @returns The details of the created app, or the transaction to create it if `skipSending`
37
+ */
38
+ async function createApp(create, algod) {
39
+ const { from, approvalProgram: approval, clearStateProgram: clear, schema, note, transactionParams, args, ...sendParams } = create;
40
+ const compiledApproval = typeof approval === 'string' ? await compileTeal(approval, algod) : undefined;
41
+ const approvalProgram = compiledApproval ? compiledApproval.compiledBase64ToBytes : approval;
42
+ const compiledClear = typeof clear === 'string' ? await compileTeal(clear, algod) : undefined;
43
+ const clearProgram = compiledClear ? compiledClear.compiledBase64ToBytes : clear;
44
+ if (args && 'method' in args) {
45
+ const atc = attachATC(sendParams);
46
+ const before = (0, transaction_1.getAtomicTransactionComposerTransactions)(atc);
47
+ atc.addMethodCall({
48
+ appID: 0,
49
+ approvalProgram: approvalProgram,
50
+ clearProgram: clearProgram,
51
+ numLocalInts: schema.localInts,
52
+ numLocalByteSlices: schema.localByteSlices,
53
+ numGlobalInts: schema.globalInts,
54
+ numGlobalByteSlices: schema.globalByteSlices,
55
+ extraPages: schema.extraPages ?? Math.floor((approvalProgram.length + clearProgram.length) / app_1.APP_PAGE_MAX_SIZE),
56
+ onComplete: algosdk_1.default.OnApplicationComplete.NoOpOC,
57
+ suggestedParams: (0, transaction_1.controlFees)(await (0, transaction_1.getTransactionParams)(transactionParams, algod), sendParams),
58
+ note: (0, transaction_1.encodeTransactionNote)(note),
59
+ ...(await getAppArgsForABICall(args, from)),
60
+ });
61
+ if (sendParams.skipSending) {
62
+ const after = atc.clone().buildGroup();
63
+ return {
64
+ transaction: after[after.length - 1].txn,
65
+ transactions: after.slice(before.length).map((t) => t.txn),
66
+ appId: 0,
67
+ appAddress: '',
68
+ compiledApproval,
69
+ compiledClear,
70
+ };
71
+ }
72
+ const result = await (0, transaction_1.sendAtomicTransactionComposer)({ atc, sendParams }, algod);
73
+ const confirmation = result.confirmations ? result.confirmations[result.confirmations?.length - 1] : undefined;
74
+ if (confirmation) {
75
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
76
+ const appId = confirmation['application-index'];
77
+ _1.Config.getLogger(sendParams.suppressLog).debug(`Created app ${appId} from creator ${(0, transaction_1.getSenderAddress)(from)}`);
78
+ return {
79
+ transactions: result.transactions,
80
+ confirmations: result.confirmations,
81
+ return: confirmation ? getABIReturn(args, confirmation) : undefined,
82
+ transaction: result.transactions[result.transactions.length - 1],
83
+ confirmation: confirmation,
84
+ appId,
85
+ appAddress: algosdk_1.default.getApplicationAddress(appId),
86
+ compiledApproval,
87
+ compiledClear,
88
+ };
89
+ }
90
+ else {
91
+ return {
92
+ transactions: result.transactions,
93
+ confirmations: result.confirmations,
94
+ return: confirmation ? getABIReturn(args, confirmation) : undefined,
95
+ transaction: result.transactions[result.transactions.length - 1],
96
+ confirmation: confirmation,
97
+ appId: 0,
98
+ appAddress: '',
99
+ compiledApproval,
100
+ compiledClear,
101
+ };
102
+ }
103
+ }
104
+ else {
105
+ const transaction = algosdk_1.default.makeApplicationCreateTxnFromObject({
106
+ approvalProgram: approvalProgram,
107
+ clearProgram: clearProgram,
108
+ numLocalInts: schema.localInts,
109
+ numLocalByteSlices: schema.localByteSlices,
110
+ numGlobalInts: schema.globalInts,
111
+ numGlobalByteSlices: schema.globalByteSlices,
112
+ extraPages: schema.extraPages ?? Math.floor((approvalProgram.length + clearProgram.length) / app_1.APP_PAGE_MAX_SIZE),
113
+ onComplete: algosdk_1.default.OnApplicationComplete.NoOpOC,
114
+ suggestedParams: await (0, transaction_1.getTransactionParams)(transactionParams, algod),
115
+ from: (0, transaction_1.getSenderAddress)(from),
116
+ note: (0, transaction_1.encodeTransactionNote)(note),
117
+ ...getAppArgsForTransaction(args),
118
+ rekeyTo: undefined,
119
+ });
120
+ const { confirmation } = await (0, transaction_1.sendTransaction)({ transaction, from, sendParams }, algod);
121
+ if (confirmation) {
122
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
123
+ const appId = confirmation['application-index'];
124
+ _1.Config.getLogger(sendParams.suppressLog).debug(`Created app ${appId} from creator ${(0, transaction_1.getSenderAddress)(from)}`);
125
+ return {
126
+ transaction,
127
+ transactions: [transaction],
128
+ confirmation,
129
+ confirmations: confirmation ? [confirmation] : undefined,
130
+ appId,
131
+ appAddress: algosdk_1.default.getApplicationAddress(appId),
132
+ return: getABIReturn(args, confirmation),
133
+ compiledApproval,
134
+ compiledClear,
135
+ };
136
+ }
137
+ else {
138
+ return { transaction, transactions: [transaction], appId: 0, appAddress: '', compiledApproval, compiledClear };
139
+ }
140
+ }
141
+ }
142
+ exports.createApp = createApp;
143
+ /**
144
+ * Updates a smart contract app.
145
+ * @param update The parameters to update the app with
146
+ * @param algod An algod client
147
+ * @returns The transaction
148
+ */
149
+ async function updateApp(update, algod) {
150
+ const { appId, from, approvalProgram: approval, clearStateProgram: clear, note, transactionParams, args, ...sendParams } = update;
151
+ const compiledApproval = typeof approval === 'string' ? await compileTeal(approval, algod) : undefined;
152
+ const approvalProgram = compiledApproval ? compiledApproval.compiledBase64ToBytes : approval;
153
+ const compiledClear = typeof clear === 'string' ? await compileTeal(clear, algod) : undefined;
154
+ const clearProgram = compiledClear ? compiledClear.compiledBase64ToBytes : clear;
155
+ _1.Config.getLogger(sendParams.suppressLog).debug(`Updating app ${appId}`);
156
+ if (args && 'method' in args) {
157
+ const atc = attachATC(sendParams);
158
+ const before = (0, transaction_1.getAtomicTransactionComposerTransactions)(atc);
159
+ atc.addMethodCall({
160
+ appID: appId,
161
+ onComplete: algosdk_1.OnApplicationComplete.UpdateApplicationOC,
162
+ approvalProgram: approvalProgram,
163
+ clearProgram: clearProgram,
164
+ suggestedParams: (0, transaction_1.controlFees)(await (0, transaction_1.getTransactionParams)(transactionParams, algod), sendParams),
165
+ note: (0, transaction_1.encodeTransactionNote)(note),
166
+ ...(await getAppArgsForABICall(args, from)),
167
+ });
168
+ if (sendParams.skipSending) {
169
+ const after = atc.clone().buildGroup();
170
+ return {
171
+ transaction: after[after.length - 1].txn,
172
+ transactions: after.slice(before.length).map((t) => t.txn),
173
+ };
174
+ }
175
+ const result = await (0, transaction_1.sendAtomicTransactionComposer)({ atc, sendParams }, algod);
176
+ const confirmation = result.confirmations ? result.confirmations[result.confirmations?.length - 1] : undefined;
177
+ return {
178
+ transactions: result.transactions,
179
+ confirmations: result.confirmations,
180
+ return: confirmation ? getABIReturn(args, confirmation) : undefined,
181
+ transaction: result.transactions[result.transactions.length - 1],
182
+ confirmation: confirmation,
183
+ };
184
+ }
185
+ else {
186
+ const transaction = algosdk_1.default.makeApplicationUpdateTxnFromObject({
187
+ appIndex: appId,
188
+ approvalProgram: approvalProgram,
189
+ clearProgram: clearProgram,
190
+ suggestedParams: await (0, transaction_1.getTransactionParams)(transactionParams, algod),
191
+ from: (0, transaction_1.getSenderAddress)(from),
192
+ note: (0, transaction_1.encodeTransactionNote)(note),
193
+ ...getAppArgsForTransaction(args),
194
+ rekeyTo: undefined,
195
+ });
196
+ const result = await (0, transaction_1.sendTransaction)({ transaction, from, sendParams }, algod);
197
+ return {
198
+ ...result,
199
+ transactions: [result.transaction],
200
+ confirmations: result.confirmation ? [result.confirmation] : undefined,
201
+ return: getABIReturn(args, result.confirmation),
202
+ compiledApproval,
203
+ compiledClear,
204
+ };
205
+ }
206
+ }
207
+ exports.updateApp = updateApp;
208
+ function attachATC(sendParams) {
209
+ if (sendParams.atc) {
210
+ sendParams.skipSending = true;
211
+ }
212
+ sendParams.atc = sendParams.atc ?? new algosdk_1.AtomicTransactionComposer();
213
+ return sendParams.atc;
214
+ }
215
+ /**
216
+ * Issues a call to a given app.
217
+ * @param call The call details.
218
+ * @param algod An algod client
219
+ * @returns The result of the call
220
+ */
221
+ async function callApp(call, algod) {
222
+ const { appId, callType, from, args, note, transactionParams, ...sendParams } = call;
223
+ if (args && 'method' in args) {
224
+ const atc = attachATC(sendParams);
225
+ const before = (0, transaction_1.getAtomicTransactionComposerTransactions)(atc);
226
+ atc.addMethodCall({
227
+ appID: appId,
228
+ suggestedParams: (0, transaction_1.controlFees)(await (0, transaction_1.getTransactionParams)(transactionParams, algod), sendParams),
229
+ note: (0, transaction_1.encodeTransactionNote)(note),
230
+ onComplete: callType === 'normal'
231
+ ? algosdk_1.OnApplicationComplete.NoOpOC
232
+ : callType === 'clearstate'
233
+ ? algosdk_1.OnApplicationComplete.ClearStateOC
234
+ : callType === 'closeout'
235
+ ? algosdk_1.OnApplicationComplete.CloseOutOC
236
+ : callType === 'delete'
237
+ ? algosdk_1.OnApplicationComplete.DeleteApplicationOC
238
+ : algosdk_1.OnApplicationComplete.OptInOC,
239
+ ...(await getAppArgsForABICall(args, from)),
240
+ });
241
+ if (sendParams.skipSending) {
242
+ const after = atc.clone().buildGroup();
243
+ return {
244
+ transaction: after[after.length - 1].txn,
245
+ transactions: after.slice(before.length).map((t) => t.txn),
246
+ };
247
+ }
248
+ const result = await (0, transaction_1.sendAtomicTransactionComposer)({ atc, sendParams }, algod);
249
+ const confirmation = result.confirmations ? result.confirmations[result.confirmations?.length - 1] : undefined;
250
+ return {
251
+ transactions: result.transactions,
252
+ confirmations: result.confirmations,
253
+ return: confirmation ? getABIReturn(args, confirmation) : undefined,
254
+ transaction: result.transactions[result.transactions.length - 1],
255
+ confirmation: confirmation,
256
+ };
257
+ }
258
+ const appCallParams = {
259
+ appIndex: appId,
260
+ from: (0, transaction_1.getSenderAddress)(from),
261
+ suggestedParams: await (0, transaction_1.getTransactionParams)(transactionParams, algod),
262
+ ...getAppArgsForTransaction(args),
263
+ note: (0, transaction_1.encodeTransactionNote)(note),
264
+ rekeyTo: undefined,
265
+ };
266
+ let transaction;
267
+ switch (callType) {
268
+ case 'optin':
269
+ transaction = algosdk_1.default.makeApplicationOptInTxnFromObject(appCallParams);
270
+ break;
271
+ case 'clearstate':
272
+ transaction = algosdk_1.default.makeApplicationClearStateTxnFromObject(appCallParams);
273
+ break;
274
+ case 'closeout':
275
+ transaction = algosdk_1.default.makeApplicationCloseOutTxnFromObject(appCallParams);
276
+ break;
277
+ case 'delete':
278
+ transaction = algosdk_1.default.makeApplicationDeleteTxnFromObject(appCallParams);
279
+ break;
280
+ case 'normal':
281
+ transaction = algosdk_1.default.makeApplicationNoOpTxnFromObject(appCallParams);
282
+ break;
283
+ }
284
+ const result = await (0, transaction_1.sendTransaction)({ transaction, from, sendParams }, algod);
285
+ return {
286
+ ...result,
287
+ transactions: [result.transaction],
288
+ confirmations: result.confirmation ? [result.confirmation] : undefined,
289
+ return: getABIReturn(args, result.confirmation),
290
+ };
291
+ }
292
+ exports.callApp = callApp;
293
+ function getABIReturn(args, confirmation) {
294
+ if (!args || !('method' in args)) {
295
+ return undefined;
296
+ }
297
+ const method = 'txnCount' in args.method ? args.method : new algosdk_1.ABIMethod(args.method);
298
+ if (method.returns.type !== 'void' && confirmation) {
299
+ // The parseMethodResponse method mutates the second parameter :(
300
+ const resultDummy = {
301
+ txID: '',
302
+ method,
303
+ rawReturnValue: new Uint8Array(),
304
+ };
305
+ const response = algosdk_1.AtomicTransactionComposer.parseMethodResponse(method, resultDummy, confirmation);
306
+ return !response.decodeError
307
+ ? {
308
+ rawReturnValue: response.rawReturnValue,
309
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
310
+ returnValue: response.returnValue,
311
+ decodeError: undefined,
312
+ }
313
+ : {
314
+ rawReturnValue: undefined,
315
+ returnValue: undefined,
316
+ decodeError: response.decodeError,
317
+ };
318
+ }
319
+ return undefined;
320
+ }
321
+ exports.getABIReturn = getABIReturn;
322
+ /**
323
+ * Returns the current global state values for the given app ID
324
+ * @param appId The ID of the app return global state for
325
+ * @param algod An algod client instance
326
+ * @returns The current global state
327
+ */
328
+ async function getAppGlobalState(appId, algod) {
329
+ const appInfo = await getAppByIndex(appId, algod);
330
+ if (!appInfo.params || !appInfo.params['global-state']) {
331
+ throw new Error("Couldn't find global state");
332
+ }
333
+ return decodeAppState(appInfo.params['global-state']);
334
+ }
335
+ exports.getAppGlobalState = getAppGlobalState;
336
+ /**
337
+ * Returns the current global state values for the given app ID and account
338
+ * @param appId The ID of the app return global state for
339
+ * @param account Either the string address of an account or an account object for the account to get local state for the given app
340
+ * @param algod An algod client instance
341
+ * @returns The current local state for the given (app, account) combination
342
+ */
343
+ async function getAppLocalState(appId, account, algod) {
344
+ const accountAddress = typeof account === 'string' ? account : (0, transaction_1.getSenderAddress)(account);
345
+ const appInfo = await algod.accountApplicationInformation(accountAddress, appId).do();
346
+ if (!appInfo['app-local-state'] || !appInfo['app-local-state']['key-value']) {
347
+ throw new Error("Couldn't find local state");
348
+ }
349
+ return decodeAppState(appInfo['app-local-state']['key-value']);
350
+ }
351
+ exports.getAppLocalState = getAppLocalState;
352
+ /**
353
+ * Returns the names of the boxes for the given app.
354
+ * @param appId The ID of the app return box names for
355
+ * @param algod An algod client instance
356
+ * @returns The current box names
357
+ */
358
+ async function getAppBoxNames(appId, algod) {
359
+ const boxResult = await algod.getApplicationBoxes(appId).do();
360
+ return boxResult.boxes.map((b) => {
361
+ return {
362
+ nameRaw: b.name,
363
+ nameBase64: buffer_1.Buffer.from(b.name).toString('base64'),
364
+ name: buffer_1.Buffer.from(b.name).toString('utf-8'),
365
+ };
366
+ });
367
+ }
368
+ exports.getAppBoxNames = getAppBoxNames;
369
+ /**
370
+ * Returns the value of the given box name for the given app.
371
+ * @param appId The ID of the app return box names for
372
+ * @param boxName The name of the box to return either as a string, binary array or @see BoxName
373
+ * @param algod An algod client instance
374
+ * @returns The current box value as a byte array
375
+ */
376
+ async function getAppBoxValue(appId, boxName, algod) {
377
+ const name = typeof boxName === 'string' ? new Uint8Array(buffer_1.Buffer.from(boxName, 'utf-8')) : 'name' in boxName ? boxName.nameRaw : boxName;
378
+ const boxResult = await algod.getApplicationBoxByName(appId, name).do();
379
+ return boxResult.value;
380
+ }
381
+ exports.getAppBoxValue = getAppBoxValue;
382
+ /**
383
+ * Returns the value of the given box names for the given app.
384
+ * @param appId The ID of the app return box names for
385
+ * @param boxNames The names of the boxes to return either as a string, binary array or @see BoxName
386
+ * @param algod An algod client instance
387
+ * @returns The current box values as a byte array in the same order as the passed in box names
388
+ */
389
+ async function getAppBoxValues(appId, boxNames, algod) {
390
+ return await Promise.all(boxNames.map(async (boxName) => await getAppBoxValue(appId, boxName, algod)));
391
+ }
392
+ exports.getAppBoxValues = getAppBoxValues;
393
+ /**
394
+ * Returns the value of the given box name for the given app decoded based on the given ABI type.
395
+ * @param request The parameters for the box value request
396
+ * @param algod An algod client instance
397
+ * @returns The current box value as an ABI value
398
+ */
399
+ async function getAppBoxValueFromABIType(request, algod) {
400
+ const { appId, boxName, type } = request;
401
+ const value = await getAppBoxValue(appId, boxName, algod);
402
+ return type.decode(value);
403
+ }
404
+ exports.getAppBoxValueFromABIType = getAppBoxValueFromABIType;
405
+ /**
406
+ * Returns the value of the given box names for the given app decoded based on the given ABI type.
407
+ * @param request The parameters for the box value request
408
+ * @param algod An algod client instance
409
+ * @returns The current box values as an ABI value in the same order as the passed in box names
410
+ */
411
+ async function getAppBoxValuesFromABIType(request, algod) {
412
+ const { appId, boxNames, type } = request;
413
+ return await Promise.all(boxNames.map(async (boxName) => await getAppBoxValueFromABIType({ appId, boxName, type }, algod)));
414
+ }
415
+ exports.getAppBoxValuesFromABIType = getAppBoxValuesFromABIType;
416
+ // Converts an array of global-state or global-state-deltas to a more
417
+ // friendly generic object
418
+ function decodeAppState(state) {
419
+ const stateValues = {};
420
+ // Start with empty set
421
+ for (const stateVal of state) {
422
+ const keyBase64 = stateVal.key;
423
+ const keyRaw = buffer_1.Buffer.from(keyBase64, 'base64');
424
+ const key = keyRaw.toString('utf-8');
425
+ const tealValue = stateVal.value;
426
+ const dataTypeFlag = 'action' in tealValue ? tealValue.action : tealValue.type;
427
+ let valueBase64;
428
+ let valueRaw;
429
+ switch (dataTypeFlag) {
430
+ case 1:
431
+ valueBase64 = 'bytes' in tealValue ? tealValue.bytes : '';
432
+ valueRaw = buffer_1.Buffer.from(valueBase64, 'base64');
433
+ stateValues[key] = {
434
+ keyRaw,
435
+ keyBase64,
436
+ valueRaw: new Uint8Array(valueRaw),
437
+ valueBase64: valueBase64,
438
+ value: valueRaw.toString('utf-8'),
439
+ };
440
+ break;
441
+ case 2:
442
+ // eslint-disable-next-line no-case-declarations
443
+ const value = 'uint' in tealValue ? tealValue.uint : 0;
444
+ stateValues[key] = {
445
+ keyRaw,
446
+ keyBase64,
447
+ value,
448
+ };
449
+ break;
450
+ default:
451
+ throw new Error(`Received unknown state data type of ${dataTypeFlag}`);
452
+ }
453
+ }
454
+ return stateValues;
455
+ }
456
+ exports.decodeAppState = decodeAppState;
457
+ /** Returns the app args ready to load onto an app @see {Transaction} object */
458
+ function getAppArgsForTransaction(args) {
459
+ if (!args)
460
+ return undefined;
461
+ const encoder = new TextEncoder();
462
+ return {
463
+ accounts: args?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk_1.default.encodeAddress(a.publicKey))),
464
+ appArgs: args?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a)),
465
+ boxes: args?.boxes
466
+ ?.map((b) => (typeof b === 'object' && 'appId' in b ? b : { appId: 0, name: b }))
467
+ ?.map((ref) => ({
468
+ appIndex: ref.appId,
469
+ name: typeof ref.name === 'string' ? encoder.encode(ref.name) : ref.name,
470
+ })),
471
+ foreignApps: args?.apps,
472
+ foreignAssets: args?.assets,
473
+ lease: typeof args?.lease === 'string' ? encoder.encode(args?.lease) : args?.lease,
474
+ };
475
+ }
476
+ exports.getAppArgsForTransaction = getAppArgsForTransaction;
477
+ /** Returns the app args ready to load onto an ABI method call in @see AtomicTransactionComposer */
478
+ async function getAppArgsForABICall(args, from) {
479
+ const encoder = new TextEncoder();
480
+ const signer = (0, transaction_1.getSenderTransactionSigner)(from);
481
+ const methodArgs = await Promise.all(args.args?.map(async (a) => {
482
+ if (typeof a !== 'object') {
483
+ return a;
484
+ }
485
+ // Handle the various forms of transactions to wrangle them for ATC
486
+ return 'txn' in a
487
+ ? a
488
+ : 'then' in a
489
+ ? { txn: (await a).transaction, signer }
490
+ : 'transaction' in a
491
+ ? { txn: a.transaction, signer }
492
+ : 'txID' in a
493
+ ? { txn: a, signer }
494
+ : a;
495
+ }));
496
+ return {
497
+ method: 'txnCount' in args.method ? args.method : new algosdk_1.ABIMethod(args.method),
498
+ sender: (0, transaction_1.getSenderAddress)(from),
499
+ signer: signer,
500
+ boxes: args.boxes
501
+ ?.map((b) => (typeof b === 'object' && 'appId' in b ? b : { appId: 0, name: b }))
502
+ ?.map((ref) => ({
503
+ appIndex: ref.appId,
504
+ name: typeof ref.name === 'string' ? encoder.encode(ref.name) : ref.name,
505
+ })),
506
+ lease: typeof args.lease === 'string' ? encoder.encode(args.lease) : args.lease,
507
+ methodArgs: methodArgs,
508
+ rekeyTo: undefined,
509
+ };
510
+ }
511
+ exports.getAppArgsForABICall = getAppArgsForABICall;
512
+ /**
513
+ * Gets the current data for the given app from algod.
514
+ *
515
+ * @param appId The id of the app
516
+ * @param algod An algod client
517
+ * @returns The data about the app
518
+ */
519
+ async function getAppByIndex(appId, algod) {
520
+ return (await algod.getApplicationByID(appId).do());
521
+ }
522
+ exports.getAppByIndex = getAppByIndex;
523
+ /**
524
+ * Compiles the given TEAL using algod and returns the result.
525
+ *
526
+ * @param algod An algod client
527
+ * @param tealCode The TEAL code
528
+ * @returns The information about the compiled file
529
+ */
530
+ async function compileTeal(tealCode, algod) {
531
+ const compiled = await algod.compile(tealCode).sourcemap(true).do();
532
+ return {
533
+ teal: tealCode,
534
+ compiled: compiled.result,
535
+ compiledHash: compiled.hash,
536
+ compiledBase64ToBytes: new Uint8Array(buffer_1.Buffer.from(compiled.result, 'base64')),
537
+ sourceMap: new algosdk_1.SourceMap(compiled['sourcemap']),
538
+ };
539
+ }
540
+ exports.compileTeal = compileTeal;
541
+ //# sourceMappingURL=app.js.map
package/app.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings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* Create a new ApplicationClient instance
5
+ * @param appDetails The details of the app
6
+ * @param algod An algod instance
7
+ * @returns The application client
8
+ */
9
+ export declare function getApplicationClient(appDetails: AppSpecAppDetails, algod: Algodv2): ApplicationClient;
10
+ //# sourceMappingURL=application-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application-client.d.ts","sourceRoot":"","sources":["../src/application-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEjF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,qBAEjF"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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);
13
+ }
14
+ exports.getApplicationClient = getApplicationClient;
15
+ //# sourceMappingURL=application-client.js.map
@@ -0,0 +1 @@
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"}