@algorandfoundation/algokit-utils 1.0.0-beta.4 → 1.0.0-beta.40

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 (188) hide show
  1. package/README.md +9 -2
  2. package/{dist/account.d.ts → account.d.ts} +41 -36
  3. package/account.d.ts.map +1 -0
  4. package/{dist/account.js → account.js} +59 -44
  5. package/account.js.map +1 -0
  6. package/amount.d.ts +20 -0
  7. package/amount.d.ts.map +1 -0
  8. package/amount.js +36 -0
  9. package/amount.js.map +1 -0
  10. package/app-client.d.ts +14 -0
  11. package/app-client.d.ts.map +1 -0
  12. package/app-client.js +19 -0
  13. package/app-client.js.map +1 -0
  14. package/app-deploy.d.ts +95 -0
  15. package/app-deploy.d.ts.map +1 -0
  16. package/{dist/deploy-app.js → app-deploy.js} +158 -121
  17. package/app-deploy.js.map +1 -0
  18. package/app.d.ts +153 -0
  19. package/app.d.ts.map +1 -0
  20. package/app.js +582 -0
  21. package/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} +7 -3
  25. package/index.js.map +1 -0
  26. package/{dist/indexer-lookup.d.ts → indexer-lookup.d.ts} +11 -4
  27. package/indexer-lookup.d.ts.map +1 -0
  28. package/{dist/indexer-lookup.js → indexer-lookup.js} +19 -9
  29. package/indexer-lookup.js.map +1 -0
  30. package/{dist/localnet.d.ts → localnet.d.ts} +10 -10
  31. package/localnet.d.ts.map +1 -0
  32. package/{dist/localnet.js → localnet.js} +16 -16
  33. package/localnet.js.map +1 -0
  34. package/{dist/network-client.d.ts → network-client.d.ts} +15 -24
  35. package/network-client.d.ts.map +1 -0
  36. package/{dist/network-client.js → network-client.js} +16 -16
  37. package/{dist/network-client.js.map → network-client.js.map} +1 -1
  38. package/package.json +5 -93
  39. package/testing/account.d.ts +14 -0
  40. package/testing/account.d.ts.map +1 -0
  41. package/testing/account.js +31 -0
  42. package/testing/account.js.map +1 -0
  43. package/testing/fixtures/algokit-log-capture-fixture.d.ts +19 -0
  44. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
  45. package/testing/fixtures/algokit-log-capture-fixture.js +43 -0
  46. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
  47. package/testing/fixtures/algorand-fixture.d.ts +24 -0
  48. package/testing/fixtures/algorand-fixture.d.ts.map +1 -0
  49. package/testing/fixtures/algorand-fixture.js +60 -0
  50. package/testing/fixtures/algorand-fixture.js.map +1 -0
  51. package/testing/fixtures/index.d.ts +3 -0
  52. package/testing/fixtures/index.d.ts.map +1 -0
  53. package/testing/fixtures/index.js +19 -0
  54. package/testing/fixtures/index.js.map +1 -0
  55. package/testing/index.d.ts +6 -0
  56. package/testing/index.d.ts.map +1 -0
  57. package/testing/index.js +22 -0
  58. package/testing/index.js.map +1 -0
  59. package/testing/indexer.d.ts +12 -0
  60. package/testing/indexer.d.ts.map +1 -0
  61. package/testing/indexer.js +40 -0
  62. package/testing/indexer.js.map +1 -0
  63. package/testing/test-logger.d.ts +41 -0
  64. package/testing/test-logger.d.ts.map +1 -0
  65. package/testing/test-logger.js +71 -0
  66. package/testing/test-logger.js.map +1 -0
  67. package/testing/transaction-logger.d.ts +29 -0
  68. package/testing/transaction-logger.d.ts.map +1 -0
  69. package/testing/transaction-logger.js +71 -0
  70. package/testing/transaction-logger.js.map +1 -0
  71. package/transaction.d.ts +121 -0
  72. package/transaction.d.ts.map +1 -0
  73. package/transaction.js +364 -0
  74. package/transaction.js.map +1 -0
  75. package/transfer.d.ts +22 -0
  76. package/transfer.d.ts.map +1 -0
  77. package/transfer.js +67 -0
  78. package/transfer.js.map +1 -0
  79. package/types/account.d.ts +55 -0
  80. package/types/account.d.ts.map +1 -0
  81. package/types/account.js +91 -0
  82. package/types/account.js.map +1 -0
  83. package/types/algo-http-client-with-retry.d.ts.map +1 -0
  84. package/{dist → types}/algo-http-client-with-retry.js +2 -2
  85. package/types/algo-http-client-with-retry.js.map +1 -0
  86. package/{dist/types → types}/algod.d.ts +28 -15
  87. package/types/algod.d.ts.map +1 -0
  88. package/{dist/algo-amount.d.ts → types/amount.d.ts} +9 -3
  89. package/types/amount.d.ts.map +1 -0
  90. package/{dist/algo-amount.js → types/amount.js} +13 -3
  91. package/types/amount.js.map +1 -0
  92. package/types/app-client.d.ts +282 -0
  93. package/types/app-client.d.ts.map +1 -0
  94. package/types/app-client.js +529 -0
  95. package/types/app-client.js.map +1 -0
  96. package/types/app-spec.d.ts +141 -0
  97. package/types/app-spec.d.ts.map +1 -0
  98. package/{dist/types/appspec.js → types/app-spec.js} +5 -7
  99. package/types/app-spec.js.map +1 -0
  100. package/types/app.d.ts +285 -0
  101. package/types/app.d.ts.map +1 -0
  102. package/types/app.js +32 -0
  103. package/types/app.js.map +1 -0
  104. package/types/config.d.ts +32 -0
  105. package/types/config.d.ts.map +1 -0
  106. package/types/config.js +53 -0
  107. package/types/config.js.map +1 -0
  108. package/types/indexer.d.ts +624 -0
  109. package/types/indexer.d.ts.map +1 -0
  110. package/{dist/types → types}/indexer.js +9 -0
  111. package/types/indexer.js.map +1 -0
  112. package/{dist/config.d.ts → types/logging.d.ts} +2 -16
  113. package/types/logging.d.ts.map +1 -0
  114. package/{dist/config.js → types/logging.js} +5 -24
  115. package/types/logging.js.map +1 -0
  116. package/types/logic-error.d.ts +37 -0
  117. package/types/logic-error.d.ts.map +1 -0
  118. package/types/logic-error.js +50 -0
  119. package/types/logic-error.js.map +1 -0
  120. package/types/network-client.d.ts +11 -0
  121. package/types/network-client.d.ts.map +1 -0
  122. package/types/network-client.js +3 -0
  123. package/types/network-client.js.map +1 -0
  124. package/types/testing.d.ts +89 -0
  125. package/types/testing.d.ts.map +1 -0
  126. package/types/testing.js +3 -0
  127. package/types/testing.js.map +1 -0
  128. package/types/transaction.d.ts +112 -0
  129. package/types/transaction.d.ts.map +1 -0
  130. package/types/transaction.js +3 -0
  131. package/types/transaction.js.map +1 -0
  132. package/types/transfer.d.ts +32 -0
  133. package/types/transfer.d.ts.map +1 -0
  134. package/types/transfer.js +3 -0
  135. package/types/transfer.js.map +1 -0
  136. package/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
  137. package/types/urlTokenBaseHTTPClient.js.map +1 -0
  138. package/LICENSE +0 -21
  139. package/dist/account.d.ts.map +0 -1
  140. package/dist/account.js.map +0 -1
  141. package/dist/algo-amount.d.ts.map +0 -1
  142. package/dist/algo-amount.js.map +0 -1
  143. package/dist/algo-http-client-with-retry.d.ts.map +0 -1
  144. package/dist/algo-http-client-with-retry.js.map +0 -1
  145. package/dist/app.d.ts +0 -150
  146. package/dist/app.d.ts.map +0 -1
  147. package/dist/app.js +0 -156
  148. package/dist/app.js.map +0 -1
  149. package/dist/application-client.d.ts +0 -71
  150. package/dist/application-client.d.ts.map +0 -1
  151. package/dist/application-client.js +0 -145
  152. package/dist/application-client.js.map +0 -1
  153. package/dist/config.d.ts.map +0 -1
  154. package/dist/config.js.map +0 -1
  155. package/dist/deploy-app.d.ts +0 -149
  156. package/dist/deploy-app.d.ts.map +0 -1
  157. package/dist/deploy-app.js.map +0 -1
  158. package/dist/index.d.ts +0 -11
  159. package/dist/index.d.ts.map +0 -1
  160. package/dist/index.js.map +0 -1
  161. package/dist/indexer-lookup.d.ts.map +0 -1
  162. package/dist/indexer-lookup.js.map +0 -1
  163. package/dist/localnet.d.ts.map +0 -1
  164. package/dist/localnet.js.map +0 -1
  165. package/dist/network-client.d.ts.map +0 -1
  166. package/dist/package.json +0 -20
  167. package/dist/transaction.d.ts +0 -152
  168. package/dist/transaction.d.ts.map +0 -1
  169. package/dist/transaction.js +0 -268
  170. package/dist/transaction.js.map +0 -1
  171. package/dist/transfer.d.ts +0 -24
  172. package/dist/transfer.d.ts.map +0 -1
  173. package/dist/transfer.js +0 -33
  174. package/dist/transfer.js.map +0 -1
  175. package/dist/types/algod.d.ts.map +0 -1
  176. package/dist/types/appspec.d.ts +0 -79
  177. package/dist/types/appspec.d.ts.map +0 -1
  178. package/dist/types/appspec.js.map +0 -1
  179. package/dist/types/indexer.d.ts +0 -314
  180. package/dist/types/indexer.d.ts.map +0 -1
  181. package/dist/types/indexer.js.map +0 -1
  182. package/dist/urlTokenBaseHTTPClient.d.ts.map +0 -1
  183. package/dist/urlTokenBaseHTTPClient.js.map +0 -1
  184. /package/{dist → types}/algo-http-client-with-retry.d.ts +0 -0
  185. /package/{dist/types → types}/algod.js +0 -0
  186. /package/{dist/types → types}/algod.js.map +0 -0
  187. /package/{dist → types}/urlTokenBaseHTTPClient.d.ts +0 -0
  188. /package/{dist → types}/urlTokenBaseHTTPClient.js +0 -0
package/dist/app.d.ts DELETED
@@ -1,150 +0,0 @@
1
- import algosdk, { Algodv2, SuggestedParams } from 'algosdk';
2
- import { SendTransactionFrom, SendTransactionParams, SendTransactionResult, TransactionNote } from './transaction';
3
- import { ApplicationResponse } from './types/algod';
4
- export declare const APP_PAGE_MAX_SIZE = 2048;
5
- /** Information about an Algorand app */
6
- export interface AppReference {
7
- /** The index of the app */
8
- appIndex: number;
9
- /** The Algorand address of the account associated with the app */
10
- appAddress: string;
11
- }
12
- /**
13
- * A grouping of the app ID and name of the box in an Uint8Array
14
- */
15
- export interface BoxReference {
16
- /**
17
- * A unique application index
18
- */
19
- appIndex: number;
20
- /**
21
- * Name of box to reference
22
- */
23
- name: Uint8Array | string;
24
- }
25
- /** Arguments to pass to an app call */
26
- export interface AppCallArgs {
27
- /** The address of any accounts to load in */
28
- accounts?: string[];
29
- /** Any application arguments to pass through */
30
- appArgs?: (Uint8Array | string)[];
31
- /** Any box references to load */
32
- boxes?: BoxReference[];
33
- /** IDs of any apps to load into the foreignApps array */
34
- apps?: number[];
35
- /** IDs of any assets to load into the foreignAssets array */
36
- assets?: number[];
37
- /** The optional lease for the transaction */
38
- lease?: string | Uint8Array;
39
- }
40
- /** Base interface for common data passed to an app create or update. */
41
- interface CreateOrUpdateAppParams extends SendTransactionParams {
42
- /** The account (with private key loaded) that will send the µALGOs */
43
- from: SendTransactionFrom;
44
- /** The approval program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */
45
- approvalProgram: Uint8Array | string;
46
- /** The clear state program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */
47
- clearStateProgram: Uint8Array | string;
48
- /** Optional transaction parameters */
49
- transactionParams?: SuggestedParams;
50
- /** The (optional) transaction note */
51
- note?: TransactionNote;
52
- /** The arguments passed in to the app call */
53
- args?: AppCallArgs;
54
- }
55
- /** Parameters that are passed in when creating an app. */
56
- export interface CreateAppParams extends CreateOrUpdateAppParams {
57
- /** The storage schema to request for the created app */
58
- schema: AppStorageSchema;
59
- }
60
- /** Parameters that are passed in when updating an app. */
61
- export interface UpdateAppParams extends CreateOrUpdateAppParams {
62
- /** The index of the app to update */
63
- appIndex: number;
64
- }
65
- export interface AppCallParams extends SendTransactionParams {
66
- /** The index of the app to call */
67
- appIndex: number;
68
- /** The type of call, everything except create (@see {createApp} ) and update (@see {updateApp} ) */
69
- callType: 'optin' | 'closeout' | 'clearstate' | 'delete' | 'normal';
70
- /** The account to make the call from */
71
- from: SendTransactionFrom;
72
- /** Optional transaction parameters */
73
- transactionParams?: SuggestedParams;
74
- /** The (optional) transaction note */
75
- note?: TransactionNote;
76
- /** The arguments passed in to the app call */
77
- args?: AppCallArgs;
78
- }
79
- /** Parameters representing the storage schema of an app. */
80
- export interface AppStorageSchema {
81
- /** Restricts number of ints in per-user local state */
82
- localInts: number;
83
- /** Restricts number of byte slices in per-user local state */
84
- localByteSlices: number;
85
- /** Restricts number of ints in global state */
86
- globalInts: number;
87
- /** Restricts number of byte slices in global state */
88
- globalByteSlices: number;
89
- /** Any extra pages that are needed for the smart contract; if left blank then the right number of pages will be calculated based on the teal code size */
90
- extraPages?: number;
91
- }
92
- /** Information about a compiled teal program */
93
- export interface CompiledTeal {
94
- /** Original TEAL code */
95
- teal: string;
96
- /** The compiled code */
97
- compiled: string;
98
- /** The has returned by the compiler */
99
- compiledHash: string;
100
- /** The base64 encoded code as a byte array */
101
- compiledBase64ToBytes: Uint8Array;
102
- }
103
- /**
104
- * Creates a smart contract app, returns the details of the created app.
105
- * @param create The parameters to create the app with
106
- * @param algod An algod client
107
- * @returns The details of the created app, or the transaction to create it if `skipSending`
108
- */
109
- export declare function createApp(create: CreateAppParams, algod: Algodv2): Promise<SendTransactionResult & AppReference>;
110
- /**
111
- * Updates a smart contract app.
112
- * @param update The parameters to update the app with
113
- * @param algod An algod client
114
- * @returns The transaction
115
- */
116
- export declare function updateApp(update: UpdateAppParams, algod: Algodv2): Promise<SendTransactionResult>;
117
- /**
118
- * Issues a call to a given app.
119
- * @param call The call details.
120
- * @param algod An algod client
121
- * @returns The result of the call
122
- */
123
- export declare function callApp(call: AppCallParams, algod: Algodv2): Promise<SendTransactionResult>;
124
- /** Returns the app args ready to load onto an app @see {Transaction} object */
125
- export declare function getAppArgsForTransaction(args?: AppCallArgs): {
126
- accounts: string[] | undefined;
127
- appArgs: Uint8Array[] | undefined;
128
- boxes: algosdk.BoxReference[] | undefined;
129
- foreignApps: number[] | undefined;
130
- foreignAssets: number[] | undefined;
131
- lease: Uint8Array | undefined;
132
- } | undefined;
133
- /**
134
- * Gets the current data for the given app from algod.
135
- *
136
- * @param appIndex The index of the app
137
- * @param algod An algod client
138
- * @returns The data about the app
139
- */
140
- export declare function getAppByIndex(appIndex: number, algod: Algodv2): Promise<ApplicationResponse>;
141
- /**
142
- * Compiles the given TEAL using algod and returns the result.
143
- *
144
- * @param algod An algod client
145
- * @param tealCode The TEAL code
146
- * @returns The information about the compiled file
147
- */
148
- export declare function compileTeal(tealCode: string, algod: Algodv2): Promise<CompiledTeal>;
149
- export {};
150
- //# sourceMappingURL=app.d.ts.map
package/dist/app.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAe,MAAM,SAAS,CAAA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AAO,CAAC,qBAAqB,GAAG,YAAY,CAAC,CAiCtH;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAoBvG;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAgCjG;AAED,+EAA+E;AAC/E,wBAAgB,wBAAwB,CAAC,IAAI,CAAC,EAAE,WAAW;;;;;;;cAiB1D;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,gCAEnE;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAQzF"}
package/dist/app.js DELETED
@@ -1,156 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.compileTeal = exports.getAppByIndex = exports.getAppArgsForTransaction = exports.callApp = exports.updateApp = exports.createApp = exports.APP_PAGE_MAX_SIZE = void 0;
7
- const algosdk_1 = __importDefault(require("algosdk"));
8
- const buffer_1 = require("buffer");
9
- const config_1 = require("./config");
10
- const transaction_1 = require("./transaction");
11
- exports.APP_PAGE_MAX_SIZE = 2048;
12
- /**
13
- * Creates a smart contract app, returns the details of the created app.
14
- * @param create The parameters to create the app with
15
- * @param algod An algod client
16
- * @returns The details of the created app, or the transaction to create it if `skipSending`
17
- */
18
- async function createApp(create, algod) {
19
- const { from, approvalProgram: approval, clearStateProgram: clear, schema, note, transactionParams, args, ...sendParams } = create;
20
- const approvalProgram = typeof approval === 'string' ? (await compileTeal(approval, algod)).compiledBase64ToBytes : approval;
21
- const clearProgram = typeof clear === 'string' ? (await compileTeal(clear, algod)).compiledBase64ToBytes : clear;
22
- const transaction = algosdk_1.default.makeApplicationCreateTxnFromObject({
23
- approvalProgram: approvalProgram,
24
- clearProgram: clearProgram,
25
- numLocalInts: schema.localInts,
26
- numLocalByteSlices: schema.localByteSlices,
27
- numGlobalInts: schema.globalInts,
28
- numGlobalByteSlices: schema.globalByteSlices,
29
- extraPages: schema.extraPages ?? Math.floor((approvalProgram.length + clearProgram.length) / exports.APP_PAGE_MAX_SIZE),
30
- onComplete: algosdk_1.default.OnApplicationComplete.NoOpOC,
31
- suggestedParams: await (0, transaction_1.getTransactionParams)(transactionParams, algod),
32
- from: (0, transaction_1.getSenderAddress)(from),
33
- note: (0, transaction_1.encodeTransactionNote)(note),
34
- ...getAppArgsForTransaction(args),
35
- rekeyTo: undefined,
36
- });
37
- const { confirmation } = await (0, transaction_1.sendTransaction)({ transaction, from, sendParams }, algod);
38
- if (confirmation) {
39
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
40
- const appIndex = confirmation['application-index'];
41
- config_1.AlgoKitConfig.getLogger(sendParams.suppressLog).debug(`Created app ${appIndex} from creator ${(0, transaction_1.getSenderAddress)(from)}`);
42
- return { transaction, confirmation, appIndex, appAddress: algosdk_1.default.getApplicationAddress(appIndex) };
43
- }
44
- else {
45
- return { transaction, appIndex: 0, appAddress: '' };
46
- }
47
- }
48
- exports.createApp = createApp;
49
- /**
50
- * Updates a smart contract app.
51
- * @param update The parameters to update the app with
52
- * @param algod An algod client
53
- * @returns The transaction
54
- */
55
- async function updateApp(update, algod) {
56
- const { appIndex, from, approvalProgram: approval, clearStateProgram: clear, note, transactionParams, args, ...sendParams } = update;
57
- const approvalProgram = typeof approval === 'string' ? (await compileTeal(approval, algod)).compiledBase64ToBytes : approval;
58
- const clearProgram = typeof clear === 'string' ? (await compileTeal(clear, algod)).compiledBase64ToBytes : clear;
59
- const transaction = algosdk_1.default.makeApplicationUpdateTxnFromObject({
60
- appIndex,
61
- approvalProgram: approvalProgram,
62
- clearProgram: clearProgram,
63
- suggestedParams: await (0, transaction_1.getTransactionParams)(transactionParams, algod),
64
- from: (0, transaction_1.getSenderAddress)(from),
65
- note: (0, transaction_1.encodeTransactionNote)(note),
66
- ...getAppArgsForTransaction(args),
67
- rekeyTo: undefined,
68
- });
69
- config_1.AlgoKitConfig.getLogger(sendParams.suppressLog).debug(`Updating app ${appIndex}`);
70
- return await (0, transaction_1.sendTransaction)({ transaction, from, sendParams }, algod);
71
- }
72
- exports.updateApp = updateApp;
73
- /**
74
- * Issues a call to a given app.
75
- * @param call The call details.
76
- * @param algod An algod client
77
- * @returns The result of the call
78
- */
79
- async function callApp(call, algod) {
80
- const { appIndex, callType, from, args, note, transactionParams, ...sendParams } = call;
81
- const appCallParameters = {
82
- appIndex: appIndex,
83
- from: (0, transaction_1.getSenderAddress)(from),
84
- suggestedParams: await (0, transaction_1.getTransactionParams)(transactionParams, algod),
85
- ...getAppArgsForTransaction(args),
86
- note: (0, transaction_1.encodeTransactionNote)(note),
87
- rekeyTo: undefined,
88
- };
89
- let transaction;
90
- switch (callType) {
91
- case 'optin':
92
- transaction = algosdk_1.default.makeApplicationOptInTxnFromObject(appCallParameters);
93
- break;
94
- case 'clearstate':
95
- transaction = algosdk_1.default.makeApplicationClearStateTxnFromObject(appCallParameters);
96
- break;
97
- case 'closeout':
98
- transaction = algosdk_1.default.makeApplicationCloseOutTxnFromObject(appCallParameters);
99
- break;
100
- case 'delete':
101
- transaction = algosdk_1.default.makeApplicationDeleteTxnFromObject(appCallParameters);
102
- break;
103
- case 'normal':
104
- transaction = algosdk_1.default.makeApplicationNoOpTxnFromObject(appCallParameters);
105
- break;
106
- }
107
- return await (0, transaction_1.sendTransaction)({ transaction, from, sendParams }, algod);
108
- }
109
- exports.callApp = callApp;
110
- /** Returns the app args ready to load onto an app @see {Transaction} object */
111
- function getAppArgsForTransaction(args) {
112
- if (!args)
113
- return undefined;
114
- const encoder = new TextEncoder();
115
- return {
116
- accounts: args?.accounts,
117
- appArgs: args?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a)),
118
- boxes: args?.boxes?.map((ref) => ({
119
- appIndex: ref.appIndex,
120
- name: typeof ref.name === 'string' ? encoder.encode(ref.name) : ref.name,
121
- })),
122
- foreignApps: args?.apps,
123
- foreignAssets: args?.assets,
124
- lease: typeof args?.lease === 'string' ? encoder.encode(args?.lease) : args?.lease,
125
- };
126
- }
127
- exports.getAppArgsForTransaction = getAppArgsForTransaction;
128
- /**
129
- * Gets the current data for the given app from algod.
130
- *
131
- * @param appIndex The index of the app
132
- * @param algod An algod client
133
- * @returns The data about the app
134
- */
135
- async function getAppByIndex(appIndex, algod) {
136
- return (await algod.getApplicationByID(appIndex).do());
137
- }
138
- exports.getAppByIndex = getAppByIndex;
139
- /**
140
- * Compiles the given TEAL using algod and returns the result.
141
- *
142
- * @param algod An algod client
143
- * @param tealCode The TEAL code
144
- * @returns The information about the compiled file
145
- */
146
- async function compileTeal(tealCode, algod) {
147
- const compiled = await algod.compile(tealCode).do();
148
- return {
149
- teal: tealCode,
150
- compiled: compiled.result,
151
- compiledHash: compiled.hash,
152
- compiledBase64ToBytes: new Uint8Array(buffer_1.Buffer.from(compiled.result, 'base64')),
153
- };
154
- }
155
- exports.compileTeal = compileTeal;
156
- //# sourceMappingURL=app.js.map
package/dist/app.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAwE;AACxE,mCAA+B;AAC/B,qCAAwC;AACxC,+CASsB;AAGT,QAAA,iBAAiB,GAAG,IAAI,CAAA;AA6GrC;;;;;GAKG;AACI,KAAK,UAAU,SAAS,CAAC,MAAuB,EAAE,KAAc;IACrE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EA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AC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK;KACnF,CAAA;AACH,CAAC;AAjBD,4DAiBC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,aAAa,CAAC,QAAgB,EAAE,KAAc;IAClE,OAAO,CAAC,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAwB,CAAA;AAC/E,CAAC;AAFD,sCAEC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,WAAW,CAAC,QAAgB,EAAE,KAAc;IAChE,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,eAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KAC9E,CAAA;AACH,CAAC;AARD,kCAQC"}
@@ -1,71 +0,0 @@
1
- import algosdk, { Algodv2, Indexer, SuggestedParams } from 'algosdk';
2
- import { AppCallArgs, AppReference } from './app';
3
- import { AppLookup, AppMetadata, OnSchemaBreak, OnUpdate, TealTemplateParameters } from './deploy-app';
4
- import { SendTransactionFrom, SendTransactionParams, TransactionNote } from './transaction';
5
- import { AppSpec } from './types/appspec';
6
- interface File {
7
- name: string;
8
- content: string;
9
- }
10
- export declare class ApplicationClient {
11
- private algod;
12
- private indexer;
13
- private appSpec;
14
- private sender;
15
- private params;
16
- private existingDeployments;
17
- private _appIndex;
18
- private _appAddress;
19
- private _creator;
20
- get appIndex(): number;
21
- get appAddress(): string;
22
- constructor(appDetails: {
23
- app: AppSpec | File | string;
24
- sender?: SendTransactionFrom;
25
- params?: SuggestedParams;
26
- } & ({
27
- index: number;
28
- } | {
29
- creatorAddress: string /** Optional cached value of the existing apps for the given creator */;
30
- existingDeployments?: AppLookup;
31
- }), algod: Algodv2, indexer: Indexer);
32
- deploy(deploy: {
33
- sender?: SendTransactionFrom;
34
- version: string;
35
- allowUpdate?: boolean;
36
- allowDelete?: boolean;
37
- sendParams?: Omit<SendTransactionParams, 'args' | 'skipSending' | 'skipWaiting'>;
38
- /** Any deploy-time parameters to replace in the TEAL code */
39
- deployTimeParameters?: TealTemplateParameters;
40
- /** What action to perform if a schema break is detected */
41
- onSchemaBreak?: 'replace' | 'fail' | OnSchemaBreak;
42
- /** What action to perform if a TEAL update is detected */
43
- onUpdate?: 'update' | 'replace' | 'fail' | OnUpdate;
44
- /** Any args to pass to any create transaction that is issued as part of deployment */
45
- createArgs?: AppCallArgs;
46
- /** Any args to pass to any update transaction that is issued as part of deployment */
47
- updateArgs?: AppCallArgs;
48
- /** Any args to pass to any delete transaction that is issued as part of deployment */
49
- deleteArgs?: AppCallArgs;
50
- }): Promise<AppMetadata | (import("./transaction").SendTransactionResult & AppMetadata & {
51
- deleteResult?: import("./transaction").SendTransactionResult | undefined;
52
- })>;
53
- create(create: {
54
- sender?: SendTransactionFrom;
55
- args?: AppCallArgs;
56
- note: TransactionNote;
57
- sendParams?: SendTransactionParams;
58
- }): Promise<import("./transaction").SendTransactionResult & AppReference>;
59
- call(call: {
60
- method: string;
61
- args: AppCallArgs;
62
- sender?: SendTransactionFrom;
63
- callType: 'optin' | 'closeout' | 'clearstate' | 'delete' | 'normal';
64
- note: TransactionNote;
65
- sendParams?: SendTransactionParams;
66
- }): Promise<import("./transaction").SendTransactionResult>;
67
- getABIMethod(method: string): algosdk.ABIMethod | undefined;
68
- private loadAppReference;
69
- }
70
- export {};
71
- //# sourceMappingURL=application-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"application-client.d.ts","sourceRoot":"","sources":["../src/application-client.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,eA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E,OAAO,CAAA;QACrB,WAAW,CAAC,EAAE,OAAO,CAAA;QACrB,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,aAAa,GAAG,aAAa,CAAC,CAAA;QAChF,6DAA6D;QAC7D,oBAAoB,CAAC,EAAE,sBAAsB,CAAA;QAC7C,2DAA2D;QAC3D,aAAa,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,aAAa,CAAA;QAClD,0DAA0D;QAC1D,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAA;QACnD,sFAAsF;QACtF,UAAU,CAAC,EAAE,WAAW,CAAA;QACxB,sFAAsF;QACtF,UAAU,CAAC,EAAE,WAAW,CAAA;QACxB,sFAAsF;QACtF,UAAU,CAAC,EAAE,WAAW,CAAA;KACzB;;;IAkDK,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,mBAAmB,CAAC;QAAC,IAAI,CAAC,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,eAAe,CAAC;QAAC,UAAU,CAAC,EAAE,qBAAqB,CAAA;KAAE;IAkC9H,IAAI,CAAC,IAAI,EAAE;QACf,MAAM,EAAE,MAAM,CAAA;QACd,IAAI,EAAE,WAAW,CAAA;QACjB,MAAM,CAAC,EAAE,mBAAmB,CAAA;QAC5B,QAAQ,EAAE,OAAO,GAAG,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAA;QACnE,IAAI,EAAE,eAAe,CAAA;QACrB,UAAU,CAAC,EAAE,qBAAqB,CAAA;KACnC;IA+BD,YAAY,CAAC,MAAM,EAAE,MAAM;YAIb,gBAAgB;CAkB/B"}
@@ -1,145 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ApplicationClient = void 0;
7
- const algosdk_1 = __importDefault(require("algosdk"));
8
- const app_1 = require("./app");
9
- const deploy_app_1 = require("./deploy-app");
10
- const appspec_1 = require("./types/appspec");
11
- class ApplicationClient {
12
- get appIndex() {
13
- return this._appIndex;
14
- }
15
- get appAddress() {
16
- return this._appAddress;
17
- }
18
- constructor(appDetails, algod, indexer) {
19
- const { app, sender, params, ...appIdentifier } = appDetails;
20
- this.algod = algod;
21
- this.indexer = indexer;
22
- this.appSpec = typeof app == 'string' ? JSON.parse(app) : 'contract' in app ? app : JSON.parse(app.content);
23
- if ('creatorAddress' in appIdentifier) {
24
- this._creator = appIdentifier.creatorAddress;
25
- if (appIdentifier.existingDeployments && appIdentifier.existingDeployments.creator !== this._creator) {
26
- throw new Error(`Attempt to create application client with invalid existingDeployments against a different creator (${appIdentifier.existingDeployments.creator}) instead of expected creator ${this._creator}`);
27
- }
28
- this.existingDeployments = appIdentifier.existingDeployments;
29
- this._appIndex = 0;
30
- }
31
- else {
32
- if (appIdentifier.index < 0) {
33
- throw new Error(`Attempt to create application client with invalid app index of ${appIdentifier.index}`);
34
- }
35
- this._appIndex = appIdentifier.index;
36
- }
37
- this._appAddress = algosdk_1.default.getApplicationAddress(this._appIndex);
38
- this.sender = sender;
39
- this.params = params;
40
- // todo: find create, update, delete, etc. methods from app spec
41
- }
42
- async deploy(deploy) {
43
- const { sender, version, allowUpdate, allowDelete, sendParams, ...deployArgs } = deploy;
44
- if (this._appIndex !== 0) {
45
- throw new Error(`Attempt to deploy app which already has an app index of ${this._appIndex}`);
46
- }
47
- if (!sender && !this.sender) {
48
- throw new Error('No sender provided, unable to deploy app');
49
- }
50
- return (0, deploy_app_1.deployApp)({
51
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
52
- from: sender ?? this.sender,
53
- approvalProgram: this.appSpec.source.approval,
54
- clearStateProgram: this.appSpec.source.clear,
55
- metadata: {
56
- name: this.appSpec.contract.name,
57
- version: version,
58
- updatable: allowUpdate ??
59
- ((!this.appSpec.bare_call_config.update_application && this.appSpec.bare_call_config.update_application !== 'NEVER') ||
60
- !!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]),
61
- deletable: allowDelete ??
62
- ((!this.appSpec.bare_call_config.delete_application && this.appSpec.bare_call_config.delete_application !== 'NEVER') ||
63
- !!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]),
64
- },
65
- schema: {
66
- globalByteSlices: this.appSpec.state.global.num_byte_slices,
67
- globalInts: this.appSpec.state.global.num_uints,
68
- localByteSlices: this.appSpec.state.local.num_byte_slices,
69
- localInts: this.appSpec.state.local.num_uints,
70
- },
71
- transactionParams: this.params,
72
- ...(sendParams ?? {}),
73
- ...deployArgs,
74
- }, this.algod, this.indexer);
75
- }
76
- async create(create) {
77
- const { sender, args, note, sendParams } = create;
78
- if (this._appIndex !== 0) {
79
- throw new Error(`Attempt to create app which already has an app index of ${this._appIndex}`);
80
- }
81
- if (!sender && !this.sender) {
82
- throw new Error('No sender provided, unable to create app');
83
- }
84
- return (0, app_1.createApp)({
85
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
86
- from: sender ?? this.sender,
87
- approvalProgram: this.appSpec.source.approval,
88
- clearStateProgram: this.appSpec.source.clear,
89
- schema: {
90
- globalByteSlices: this.appSpec.state.global.num_byte_slices,
91
- globalInts: this.appSpec.state.global.num_uints,
92
- localByteSlices: this.appSpec.state.local.num_byte_slices,
93
- localInts: this.appSpec.state.local.num_uints,
94
- },
95
- args: args,
96
- note: note,
97
- transactionParams: this.params,
98
- ...(sendParams ?? {}),
99
- }, this.algod);
100
- }
101
- // todo: update and other method types
102
- async call(call) {
103
- const { method, args, sender, callType, note, sendParams } = call;
104
- if (!sender && !this.sender) {
105
- throw new Error('No sender provided, unable to call app');
106
- }
107
- const abiMethod = this.getABIMethod(method);
108
- if (!abiMethod) {
109
- throw new Error(`Attempt to call ABI method ${method}, but it wasn't found`);
110
- }
111
- const appMetadata = await this.loadAppReference();
112
- // todo: validate args based on ABI definition
113
- return (0, app_1.callApp)({
114
- appIndex: appMetadata.appIndex,
115
- callType: callType,
116
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
117
- from: sender ?? this.sender,
118
- args,
119
- note: note,
120
- transactionParams: this.params,
121
- ...(sendParams ?? {}),
122
- }, this.algod);
123
- }
124
- getABIMethod(method) {
125
- return this.appSpec.contract.methods.find((m) => (method.includes('(') ? (0, appspec_1.getABISignature)(m) === method : m.name === method));
126
- }
127
- async loadAppReference() {
128
- if (!this.existingDeployments && this._creator) {
129
- this.existingDeployments = await (0, deploy_app_1.getCreatorAppsByName)(this._creator, this.indexer);
130
- }
131
- if (this.existingDeployments) {
132
- const app = this.existingDeployments.apps[this.appSpec.contract.name];
133
- if (!app) {
134
- throw new Error(`Attempt to call an app that can't be found '${this.appSpec.contract.name}' for creator '${this._creator}'.`);
135
- }
136
- return app;
137
- }
138
- return {
139
- appIndex: this._appIndex,
140
- appAddress: this._appAddress,
141
- };
142
- }
143
- }
144
- exports.ApplicationClient = ApplicationClient;
145
- //# sourceMappingURL=application-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"application-client.js","sourceRoot":"","sources":["../src/application-client.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAoE;AACpE,+BAAqE;AACrE,6CAAuI;AAEvI,6CAA0D;AAO1D,MAAa,iBAAiB;IAY5B,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAA;IACzB,CAAC;IAED,YACE,UASC,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,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,SAAS;YACxB,UAAU,EAAE,IAAI,CAAC,WAAW;SACb,CAAA;IACnB,CAAC;CACF;AAhOD,8CAgOC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,uEAAuE;AACvE,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAC1D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IACzD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IACzD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAC5D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;CAC3D,CAAA;AAED,qDAAqD;AACrD,eAAO,MAAM,aAAa,EAAE,MAM3B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,MAWxB,CAAA;AAED,qCAAqC;AACrC,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,cAAM,eAAgB,YAAW,QAAQ,CAAC,MAAM,CAAC;IAC/C,OAAO,CAAC,MAAM,CAAQ;IAEtB,IAAI,MAAM,WAET;IAED,SAAS,CAAC,gBAAgB,CAAC,EAAE,OAAO;;IAcpC,4EAA4E;IAC5E,SAAS,CAAC,SAAS,EAAE,MAAM;CAG5B;AAED,iEAAiE;AACjE,eAAO,MAAM,aAAa,iBAAwB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;AAUA,qDAAqD;AACxC,QAAA,aAAa,GAAW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