@algorandfoundation/algokit-utils 1.0.0-beta.8 → 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 (141) hide show
  1. package/account.d.ts +91 -0
  2. package/account.d.ts.map +1 -0
  3. package/account.js +158 -0
  4. package/account.js.map +1 -0
  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 +108 -0
  10. package/app.d.ts.map +1 -0
  11. package/app.js +423 -0
  12. package/app.js.map +1 -0
  13. package/application-client.d.ts +10 -0
  14. package/application-client.d.ts.map +1 -0
  15. package/application-client.js +15 -0
  16. package/application-client.js.map +1 -0
  17. package/deploy-app.d.ts +93 -0
  18. package/deploy-app.d.ts.map +1 -0
  19. package/deploy-app.js +410 -0
  20. package/deploy-app.js.map +1 -0
  21. package/index.d.ts +14 -0
  22. package/index.d.ts.map +1 -0
  23. package/index.js +5 -2
  24. package/index.js.map +1 -0
  25. package/indexer-lookup.d.ts +31 -0
  26. package/indexer-lookup.d.ts.map +1 -0
  27. package/indexer-lookup.js +96 -0
  28. package/indexer-lookup.js.map +1 -0
  29. package/localnet.d.ts +54 -0
  30. package/localnet.d.ts.map +1 -0
  31. package/localnet.js +121 -0
  32. package/localnet.js.map +1 -0
  33. package/network-client.d.ts +93 -0
  34. package/network-client.d.ts.map +1 -0
  35. package/network-client.js +182 -0
  36. package/network-client.js.map +1 -0
  37. package/package.json +3 -3
  38. package/testing/account.d.ts +14 -0
  39. package/testing/account.d.ts.map +1 -0
  40. package/testing/account.js +31 -0
  41. package/testing/account.js.map +1 -0
  42. package/testing/fixtures/algokit-log-capture-fixture.d.ts +19 -0
  43. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
  44. package/testing/fixtures/algokit-log-capture-fixture.js +43 -0
  45. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
  46. package/testing/fixtures/algorand-fixture.d.ts +20 -0
  47. package/testing/fixtures/algorand-fixture.d.ts.map +1 -0
  48. package/testing/fixtures/algorand-fixture.js +49 -0
  49. package/testing/fixtures/algorand-fixture.js.map +1 -0
  50. package/testing/fixtures/index.d.ts +3 -0
  51. package/testing/fixtures/index.d.ts.map +1 -0
  52. package/testing/fixtures/index.js +19 -0
  53. package/testing/fixtures/index.js.map +1 -0
  54. package/testing/index.d.ts +6 -0
  55. package/testing/index.d.ts.map +1 -0
  56. package/testing/index.js +22 -0
  57. package/testing/index.js.map +1 -0
  58. package/testing/indexer.d.ts +12 -0
  59. package/testing/indexer.d.ts.map +1 -0
  60. package/testing/indexer.js +39 -0
  61. package/testing/indexer.js.map +1 -0
  62. package/testing/test-logger.d.ts +39 -0
  63. package/testing/test-logger.d.ts.map +1 -0
  64. package/testing/test-logger.js +69 -0
  65. package/testing/test-logger.js.map +1 -0
  66. package/testing/transaction-logger.d.ts +29 -0
  67. package/testing/transaction-logger.d.ts.map +1 -0
  68. package/testing/transaction-logger.js +71 -0
  69. package/testing/transaction-logger.js.map +1 -0
  70. package/transaction.d.ts +80 -0
  71. package/transaction.d.ts.map +1 -0
  72. package/transaction.js +256 -0
  73. package/transaction.js.map +1 -0
  74. package/transfer.d.ts +21 -0
  75. package/transfer.d.ts.map +1 -0
  76. package/transfer.js +65 -0
  77. package/transfer.js.map +1 -0
  78. package/types/account.d.ts +52 -0
  79. package/types/account.d.ts.map +1 -0
  80. package/types/account.js +86 -0
  81. package/types/account.js.map +1 -0
  82. package/types/algo-http-client-with-retry.d.ts +14 -0
  83. package/types/algo-http-client-with-retry.d.ts.map +1 -0
  84. package/types/algo-http-client-with-retry.js +62 -0
  85. package/types/algo-http-client-with-retry.js.map +1 -0
  86. package/types/algod.d.ts +137 -0
  87. package/types/algod.d.ts.map +1 -0
  88. package/types/algod.js +3 -0
  89. package/types/algod.js.map +1 -0
  90. package/types/amount.d.ts +20 -0
  91. package/types/amount.d.ts.map +1 -0
  92. package/types/amount.js +37 -0
  93. package/types/amount.js.map +1 -0
  94. package/types/app.d.ts +279 -0
  95. package/types/app.d.ts.map +1 -0
  96. package/types/app.js +32 -0
  97. package/types/app.js.map +1 -0
  98. package/types/application-client.d.ts +229 -0
  99. package/types/application-client.d.ts.map +1 -0
  100. package/types/application-client.js +470 -0
  101. package/types/application-client.js.map +1 -0
  102. package/types/appspec.d.ts +77 -0
  103. package/types/appspec.d.ts.map +1 -0
  104. package/types/appspec.js +15 -0
  105. package/types/appspec.js.map +1 -0
  106. package/types/config.d.ts +15 -0
  107. package/types/config.d.ts.map +1 -0
  108. package/types/config.js +27 -0
  109. package/types/config.js.map +1 -0
  110. package/types/indexer.d.ts +313 -0
  111. package/types/indexer.d.ts.map +1 -0
  112. package/types/indexer.js +25 -0
  113. package/types/indexer.js.map +1 -0
  114. package/types/logging.d.ts +13 -0
  115. package/types/logging.d.ts.map +1 -0
  116. package/types/logging.js +27 -0
  117. package/types/logging.js.map +1 -0
  118. package/types/logic-error.d.ts +33 -0
  119. package/types/logic-error.d.ts.map +1 -0
  120. package/types/logic-error.js +46 -0
  121. package/types/logic-error.js.map +1 -0
  122. package/types/network-client.d.ts +11 -0
  123. package/types/network-client.d.ts.map +1 -0
  124. package/types/network-client.js +3 -0
  125. package/types/network-client.js.map +1 -0
  126. package/types/testing.d.ts +89 -0
  127. package/types/testing.d.ts.map +1 -0
  128. package/types/testing.js +3 -0
  129. package/types/testing.js.map +1 -0
  130. package/types/transaction.d.ts +67 -0
  131. package/types/transaction.d.ts.map +1 -0
  132. package/types/transaction.js +3 -0
  133. package/types/transaction.js.map +1 -0
  134. package/types/transfer.d.ts +32 -0
  135. package/types/transfer.d.ts.map +1 -0
  136. package/types/transfer.js +3 -0
  137. package/types/transfer.js.map +1 -0
  138. package/types/urlTokenBaseHTTPClient.d.ts +41 -0
  139. package/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
  140. package/types/urlTokenBaseHTTPClient.js +151 -0
  141. package/types/urlTokenBaseHTTPClient.js.map +1 -0
@@ -0,0 +1,313 @@
1
+ import { TransactionType } from 'algosdk';
2
+ import { TealKeyValue } from 'algosdk/dist/types/client/v2/algod/models/types';
3
+ /** https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */
4
+ export interface TransactionSearchResults {
5
+ 'current-round': string;
6
+ 'next-token': string;
7
+ transactions: TransactionResult[];
8
+ }
9
+ /** https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */
10
+ export interface AccountLookupResult {
11
+ 'current-round': string;
12
+ account: AccountResult;
13
+ }
14
+ /** https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */
15
+ export interface AssetsLookupResult {
16
+ 'current-round': string;
17
+ 'next-token': string;
18
+ assets: AssetHolding[];
19
+ }
20
+ /** https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */
21
+ export interface AssetsCreatedLookupResult {
22
+ 'current-round': string;
23
+ 'next-token': string;
24
+ assets: AssetResult[];
25
+ }
26
+ /** https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */
27
+ export interface ApplicationCreatedLookupResult {
28
+ 'current-round': string;
29
+ 'next-token': string;
30
+ applications: ApplicationResult[];
31
+ }
32
+ /** https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */
33
+ export interface AssetLookupResult {
34
+ 'current-round': string;
35
+ asset: AssetResult;
36
+ }
37
+ /** https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */
38
+ export interface TransactionLookupResult {
39
+ 'current-round': number;
40
+ transaction: TransactionResult;
41
+ }
42
+ /** https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */
43
+ export interface ApplicationLookupResult {
44
+ 'current-round': string;
45
+ application: ApplicationResult;
46
+ }
47
+ /** Indexer result for a transaction, @see https://developer.algorand.org/docs/rest-apis/indexer/#transaction */
48
+ export interface TransactionResult {
49
+ id: string;
50
+ fee: number;
51
+ sender: string;
52
+ 'first-valid': number;
53
+ 'last-valid': number;
54
+ 'confirmed-round'?: number;
55
+ group?: string;
56
+ note?: string;
57
+ logs?: string[];
58
+ 'round-time'?: number;
59
+ 'intra-round-offset'?: number;
60
+ signature?: TransactionSignature;
61
+ 'application-transaction'?: ApplicationTransactionResult;
62
+ 'created-application-index'?: number;
63
+ 'asset-config-transaction': AssetConfigTransactionResult;
64
+ 'created-asset-index'?: number;
65
+ 'asset-freeze-transaction'?: AssetFreezeTransactionResult;
66
+ 'asset-transfer-transaction'?: AssetTransferTransactionResult;
67
+ 'keyreg-transaction'?: any;
68
+ 'payment-transaction'?: PaymentTransactionResult;
69
+ 'auth-addr'?: string;
70
+ 'closing-amount'?: number;
71
+ 'genesis-hash'?: string;
72
+ 'genesis-id'?: string;
73
+ 'inner-txns'?: TransactionResult[];
74
+ 'rekey-to'?: string;
75
+ lease?: string;
76
+ 'local-state-delta'?: Record<string, EvalDelta>[];
77
+ 'global-state-delta'?: Record<string, EvalDelta>[];
78
+ 'receiver-rewards'?: number;
79
+ 'sender-rewards'?: number;
80
+ 'close-rewards'?: number;
81
+ 'tx-type': TransactionType;
82
+ }
83
+ export interface AccountResult {
84
+ address: string;
85
+ amount: number;
86
+ 'amount-without-pending-rewards': number;
87
+ 'apps-local-state'?: AppLocalState[];
88
+ 'apps-total-extra-pages'?: number;
89
+ 'apps-total-schema'?: StateSchema;
90
+ 'auth-addr'?: string;
91
+ 'closed-at-round'?: number;
92
+ 'created-at-round'?: number;
93
+ deleted?: boolean;
94
+ participation: any;
95
+ 'pending-rewards': number;
96
+ 'reward-base': number;
97
+ rewards: number;
98
+ round: number;
99
+ 'sig-type': SignatureType;
100
+ status: AccountStatus;
101
+ }
102
+ export interface PaymentTransactionResult {
103
+ amount: number;
104
+ 'close-amount'?: number;
105
+ 'close-remainder-to'?: string;
106
+ receiver: string;
107
+ }
108
+ export interface ApplicationTransactionResult extends Exclude<{
109
+ creator: string;
110
+ 'global-state': TealKeyValue[];
111
+ }, ApplicationParams> {
112
+ 'application-id': number;
113
+ 'on-completion': ApplicationOnComplete;
114
+ 'application-args'?: string[];
115
+ accounts?: string[];
116
+ 'foreign-apps'?: number[];
117
+ 'foreign-assets'?: number[];
118
+ }
119
+ export interface AssetConfigTransactionResult {
120
+ 'asset-id': number;
121
+ params: AssetParams;
122
+ }
123
+ export interface AssetFreezeTransactionResult {
124
+ address: string;
125
+ 'asset-id': number;
126
+ 'new-freeze-status': boolean;
127
+ }
128
+ export interface AssetTransferTransactionResult {
129
+ amount: number;
130
+ 'asset-id': number;
131
+ 'close-amount'?: number;
132
+ 'close-to'?: string;
133
+ receiver?: string;
134
+ sender?: string;
135
+ }
136
+ export interface AssetResult {
137
+ index: number;
138
+ deleted?: boolean;
139
+ 'created-at-round': number;
140
+ 'deleted-at-round': number;
141
+ params: AssetParams;
142
+ }
143
+ /**
144
+ * The result of looking up an application
145
+ */
146
+ export interface ApplicationResult {
147
+ id: number;
148
+ params: ApplicationParams;
149
+ 'created-at-round'?: number;
150
+ deleted?: boolean;
151
+ 'deleted-at-round'?: number;
152
+ }
153
+ export interface TransactionSignature {
154
+ logicsig: LogicTransactionSignature;
155
+ multisig: MultisigTransactionSignature;
156
+ sig: string;
157
+ }
158
+ export interface LogicTransactionSignature {
159
+ args: string[];
160
+ logic: string;
161
+ 'multisig-signature': MultisigTransactionSignature;
162
+ signature: string;
163
+ }
164
+ export interface MultisigTransactionSignature {
165
+ subsignature: MultisigTransactionSubSignature;
166
+ threshold: number;
167
+ version: number;
168
+ }
169
+ export interface MultisigTransactionSubSignature {
170
+ 'public-key': string;
171
+ signature: string;
172
+ }
173
+ export interface EvalDelta {
174
+ action: number;
175
+ bytes: string;
176
+ uint: number;
177
+ }
178
+ export interface ApplicationParams {
179
+ creator: string;
180
+ 'approval-program': string;
181
+ 'clear-state-program': string;
182
+ 'extra-program-pages'?: number;
183
+ 'global-state': TealKeyValue[];
184
+ 'global-state-schema'?: StateSchema;
185
+ 'local-state-schema'?: StateSchema;
186
+ }
187
+ export interface StateSchema {
188
+ 'num-byte-slice': number;
189
+ 'num-uint': number;
190
+ }
191
+ export declare enum ApplicationOnComplete {
192
+ noop = "noop",
193
+ optin = "optin",
194
+ closeout = "closeout",
195
+ clear = "clear",
196
+ update = "update",
197
+ delete = "delete"
198
+ }
199
+ export interface AssetParams {
200
+ /**
201
+ * The address that created this asset. This is the address where the parameters
202
+ * for this asset can be found, and also the address where unwanted asset units can
203
+ * be sent in the worst case.
204
+ */
205
+ creator: string;
206
+ /**
207
+ * (dc) The number of digits to use after the decimal point when displaying this
208
+ * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in
209
+ * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value
210
+ * must be between 0 and 19 (inclusive).
211
+ */
212
+ decimals: number | bigint;
213
+ /**
214
+ * (t) The total number of units of this asset.
215
+ */
216
+ total: number | bigint;
217
+ /**
218
+ * (c) Address of account used to clawback holdings of this asset. If empty,
219
+ * clawback is not permitted.
220
+ */
221
+ clawback?: string;
222
+ /**
223
+ * (df) Whether holdings of this asset are frozen by default.
224
+ */
225
+ 'default-frozen'?: boolean;
226
+ /**
227
+ * (f) Address of account used to freeze holdings of this asset. If empty, freezing
228
+ * is not permitted.
229
+ */
230
+ freeze?: string;
231
+ /**
232
+ * (m) Address of account used to manage the keys of this asset and to destroy it.
233
+ */
234
+ manager?: string;
235
+ /**
236
+ * (am) A commitment to some unspecified asset metadata. The format of this
237
+ * metadata is up to the application.
238
+ */
239
+ 'metadata-hash'?: Uint8Array;
240
+ /**
241
+ * (an) Name of this asset, as supplied by the creator. Included only when the
242
+ * asset name is composed of printable utf-8 characters.
243
+ */
244
+ name?: string;
245
+ /**
246
+ * Base64 encoded name of this asset, as supplied by the creator.
247
+ */
248
+ 'name-b64'?: Uint8Array;
249
+ /**
250
+ * (r) Address of account holding reserve (non-minted) units of this asset.
251
+ */
252
+ reserve?: string;
253
+ /**
254
+ * (un) Name of a unit of this asset, as supplied by the creator. Included only
255
+ * when the name of a unit of this asset is composed of printable utf-8 characters.
256
+ */
257
+ 'unit-name'?: string;
258
+ /**
259
+ * Base64 encoded name of a unit of this asset, as supplied by the creator.
260
+ */
261
+ 'unit-name-b64'?: Uint8Array;
262
+ /**
263
+ * (au) URL where more information about the asset can be retrieved. Included only
264
+ * when the URL is composed of printable utf-8 characters.
265
+ */
266
+ url?: string;
267
+ /**
268
+ * Base64 encoded URL where more information about the asset can be retrieved.
269
+ */
270
+ 'url-b64'?: Uint8Array;
271
+ }
272
+ export declare enum SignatureType {
273
+ sig = "sig",
274
+ msig = "msig",
275
+ lsig = "lsig"
276
+ }
277
+ export declare enum AccountStatus {
278
+ Offline = "Offline",
279
+ Online = "Online",
280
+ NotParticipating = "NotParticipating"
281
+ }
282
+ export interface AppLocalState {
283
+ 'closed-out-at-round': number;
284
+ deleted: boolean;
285
+ id: number;
286
+ 'key-value': TealKeyValue[];
287
+ 'opted-in-at-round': number;
288
+ schema: StateSchema;
289
+ }
290
+ export interface AssetHolding {
291
+ /**
292
+ * (a) number of units held.
293
+ */
294
+ amount: number;
295
+ /**
296
+ * Asset ID of the holding.
297
+ */
298
+ 'asset-id': number;
299
+ /**
300
+ * Address that created this asset. This is the address where the parameters for
301
+ * this asset can be found, and also the address where unwanted asset units can be
302
+ * sent in the worst case.
303
+ */
304
+ creator: string;
305
+ /**
306
+ * (f) whether or not the holding is frozen.
307
+ */
308
+ 'is-frozen': boolean;
309
+ deleted?: boolean;
310
+ 'opted-in-at-round': number;
311
+ 'opted-out-at-round': number;
312
+ }
313
+ //# sourceMappingURL=indexer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../src/types/indexer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAA;AAE9E,gFAAgF;AAChF,MAAM,WAAW,wBAAwB;IACvC,eAAe,EA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A;IACZ;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAA;CACvB;AAED,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,gBAAgB,qBAAqB;CACtC;AAED,MAAM,WAAW,aAAa;IAC5B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,YAAY,EAAE,CAAA;IAC3B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,MAAM,EAAE,WAAW,CAAA;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,oBAAoB,EAAE,MAAM,CAAA;CAC7B"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountStatus = exports.SignatureType = exports.ApplicationOnComplete = void 0;
4
+ var ApplicationOnComplete;
5
+ (function (ApplicationOnComplete) {
6
+ ApplicationOnComplete["noop"] = "noop";
7
+ ApplicationOnComplete["optin"] = "optin";
8
+ ApplicationOnComplete["closeout"] = "closeout";
9
+ ApplicationOnComplete["clear"] = "clear";
10
+ ApplicationOnComplete["update"] = "update";
11
+ ApplicationOnComplete["delete"] = "delete";
12
+ })(ApplicationOnComplete = exports.ApplicationOnComplete || (exports.ApplicationOnComplete = {}));
13
+ var SignatureType;
14
+ (function (SignatureType) {
15
+ SignatureType["sig"] = "sig";
16
+ SignatureType["msig"] = "msig";
17
+ SignatureType["lsig"] = "lsig";
18
+ })(SignatureType = exports.SignatureType || (exports.SignatureType = {}));
19
+ var AccountStatus;
20
+ (function (AccountStatus) {
21
+ AccountStatus["Offline"] = "Offline";
22
+ AccountStatus["Online"] = "Online";
23
+ AccountStatus["NotParticipating"] = "NotParticipating";
24
+ })(AccountStatus = exports.AccountStatus || (exports.AccountStatus = {}));
25
+ //# sourceMappingURL=indexer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer.js","sourceRoot":"","sources":["../../src/types/indexer.ts"],"names":[],"mappings":";;;AAoNA,IAAY,qBAOX;AAPD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,wCAAe,CAAA;IACf,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;AACnB,CAAC,EAPW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAOhC;AA4ED,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB;AAED,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;IACjB,sDAAqC,CAAA;AACvC,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB"}
@@ -0,0 +1,13 @@
1
+ /** General purpose logger type, compatible with Winston and others. */
2
+ export type Logger = {
3
+ error(message: string, ...optionalParams: unknown[]): void;
4
+ warn(message: string, ...optionalParams: unknown[]): void;
5
+ info(message: string, ...optionalParams: unknown[]): void;
6
+ verbose(message: string, ...optionalParams: unknown[]): void;
7
+ debug(message: string, ...optionalParams: unknown[]): void;
8
+ };
9
+ /** A logger implementation that writes to console */
10
+ export declare const consoleLogger: Logger;
11
+ /** A logger implementation that does nothing */
12
+ export declare const nullLogger: Logger;
13
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/types/logging.ts"],"names":[],"mappings":"AAGA,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,gDAAgD;AAChD,eAAO,MAAM,UAAU,EAAE,MAWxB,CAAA"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ /* eslint-disable no-console */
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.nullLogger = exports.consoleLogger = void 0;
6
+ /** A logger implementation that writes to console */
7
+ exports.consoleLogger = {
8
+ error: console.error,
9
+ warn: console.warn,
10
+ info: console.info,
11
+ verbose: console.trace,
12
+ debug: console.debug,
13
+ };
14
+ /** A logger implementation that does nothing */
15
+ exports.nullLogger = {
16
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
17
+ error: function (message, ...optionalParams) { },
18
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
19
+ warn: function (message, ...optionalParams) { },
20
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
21
+ info: function (message, ...optionalParams) { },
22
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
23
+ verbose: function (message, ...optionalParams) { },
24
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
25
+ debug: function (message, ...optionalParams) { },
26
+ };
27
+ //# sourceMappingURL=logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/types/logging.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,+BAA+B;;;AAW/B,qDAAqD;AACxC,QAAA,aAAa,GAAW;IACnC,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,OAAO,EAAE,OAAO,CAAC,KAAK;IACtB,KAAK,EAAE,OAAO,CAAC,KAAK;CACrB,CAAA;AAED,gDAAgD;AACnC,QAAA,UAAU,GAAW;IAChC,gEAAgE;IAChE,KAAK,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,IAAS,CAAC;IACxE,gEAAgE;IAChE,IAAI,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,IAAS,CAAC;IACvE,gEAAgE;IAChE,IAAI,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,IAAS,CAAC;IACvE,gEAAgE;IAChE,OAAO,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,IAAS,CAAC;IAC1E,gEAAgE;IAChE,KAAK,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,IAAS,CAAC;CACzE,CAAA"}
@@ -0,0 +1,33 @@
1
+ import type algosdk from 'algosdk';
2
+ /**
3
+ * Details about a smart contract logic error
4
+ */
5
+ export interface LogicErrorDetails {
6
+ /** The ID of the transaction with the logic error */
7
+ txId: string;
8
+ /** The program counter where the error was */
9
+ pc: number;
10
+ /** The error message */
11
+ msg: string;
12
+ }
13
+ /** Wraps key functionality around processing logic errors */
14
+ export declare class LogicError extends Error {
15
+ /** Takes an error message and parses out the details of any logic errors in there.
16
+ * @param errorMessage The error message to parse
17
+ * @returns The logic error details if any, or undefined
18
+ */
19
+ static parseLogicError(errorMessage: string): LogicErrorDetails | undefined;
20
+ led: LogicErrorDetails;
21
+ program: string[];
22
+ lines: number;
23
+ teal_line: number;
24
+ stack?: string;
25
+ /**
26
+ * Create a new logic error object.
27
+ * @param errorDetails The details of the logic error
28
+ * @param program The TEAL source code, split by line
29
+ * @param map The source map of the TEAL source code
30
+ */
31
+ constructor(errorDetails: LogicErrorDetails, program: string[], map: algosdk.SourceMap);
32
+ }
33
+ //# sourceMappingURL=logic-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logic-error.d.ts","sourceRoot":"","sources":["../../src/types/logic-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAMlC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAA;IACZ,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,6DAA6D;AAC7D,qBAAa,UAAW,SAAQ,KAAK;IACnC;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAWpE,GAAG,EAAE,iBAAiB,CAAA;IACtB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,SAAI;IACT,SAAS,SAAI;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IAEvB;;;;;OAKG;gBACS,YAAY,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,SAAS;CAqBvF"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogicError = void 0;
4
+ const LOGIC_ERROR = /TransactionPool.Remember: transaction ([A-Z0-9]+): logic eval error: (.*). Details: pc=([0-9]+), opcodes=.*/;
5
+ /** Wraps key functionality around processing logic errors */
6
+ class LogicError extends Error {
7
+ /** Takes an error message and parses out the details of any logic errors in there.
8
+ * @param errorMessage The error message to parse
9
+ * @returns The logic error details if any, or undefined
10
+ */
11
+ static parseLogicError(errorMessage) {
12
+ const res = LOGIC_ERROR.exec(errorMessage);
13
+ if (res === null || res.length <= 3)
14
+ return undefined;
15
+ return {
16
+ txId: res[1],
17
+ msg: res[2],
18
+ pc: parseInt(res[3] ? res[3] : '0'),
19
+ };
20
+ }
21
+ /**
22
+ * Create a new logic error object.
23
+ * @param errorDetails The details of the logic error
24
+ * @param program The TEAL source code, split by line
25
+ * @param map The source map of the TEAL source code
26
+ */
27
+ constructor(errorDetails, program, map) {
28
+ super();
29
+ this.lines = 5;
30
+ this.teal_line = 0;
31
+ this.led = errorDetails;
32
+ this.program = program;
33
+ const line = map.getLineForPc(errorDetails.pc);
34
+ this.teal_line = line === undefined ? 0 : line;
35
+ this.message = `${this.led.msg}. at:${line}`;
36
+ if (this.teal_line > 0) {
37
+ const start = this.teal_line > this.lines ? this.teal_line - this.lines : 0;
38
+ const stop = program.length > this.teal_line + this.lines ? this.teal_line + this.lines : program.length;
39
+ const stack_lines = program.slice(start, stop);
40
+ stack_lines[stack_lines.length / 2] += ' <--- Error';
41
+ this.stack = stack_lines.join('\n');
42
+ }
43
+ }
44
+ }
45
+ exports.LogicError = LogicError;
46
+ //# sourceMappingURL=logic-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logic-error.js","sourceRoot":"","sources":["../../src/types/logic-error.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,6GAA6G,CAAA;AAgBjI,6DAA6D;AAC7D,MAAa,UAAW,SAAQ,KAAK;IACnC;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,YAAoB;QACzC,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAC1C,IAAI,GAAG,KAAK,IAAI,IAAI,GAA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AC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YAE9C,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,aAAa,CAAA;YAEpD,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACpC;IACH,CAAC;CACF;AAjDD,gCAiDC"}
@@ -0,0 +1,11 @@
1
+ import { TokenHeader } from 'algosdk/dist/types/client/urlTokenBaseHTTPClient';
2
+ /** Config for an Algorand SDK client */
3
+ export interface AlgoClientConfig {
4
+ /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */
5
+ server: string;
6
+ /** The port to use e.g. 4001, 443, etc. */
7
+ port?: string | number;
8
+ /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */
9
+ token?: string | TokenHeader;
10
+ }
11
+ //# sourceMappingURL=network-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-client.d.ts","sourceRoot":"","sources":["../../src/types/network-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AAE9E,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B,8FAA8F;IAC9F,MAAM,EAAE,MAAM,CAAA;IACd,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,yIAAyI;IACzI,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;CAC7B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=network-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-client.js","sourceRoot":"","sources":["../../src/types/network-client.ts"],"names":[],"mappings":""}
@@ -0,0 +1,89 @@
1
+ import { Account, Algodv2, Indexer, Kmd, Transaction } from 'algosdk';
2
+ import { TransactionLogger } from '../testing';
3
+ import { TestLogger } from '../testing/test-logger';
4
+ import { AlgoAmount } from '../types/amount';
5
+ import { SendTransactionFrom } from '../types/transaction';
6
+ import { TransactionLookupResult } from './indexer';
7
+ /**
8
+ * Test automation context.
9
+ */
10
+ export interface AlgorandTestAutomationContext {
11
+ /** Algod client instance that will log transactions in @see transactionLogger */
12
+ algod: Algodv2;
13
+ /** Indexer client instance */
14
+ indexer: Indexer;
15
+ /** KMD client instance */
16
+ kmd: Kmd;
17
+ /** Transaction logger that will log transaction IDs for all transactions issued by @see algod */
18
+ transactionLogger: TransactionLogger;
19
+ /** Default, funded test account that is ephemerally created */
20
+ testAccount: Account;
21
+ /** Generate and fund an additional ephemerally created account */
22
+ generateAccount: (params: GetTestAccountParams) => Promise<Account>;
23
+ /** Wait for the indexer to catch up with all transactions logged by @see transactionLogger */
24
+ waitForIndexer: () => Promise<void>;
25
+ /** Wait for the indexer to catch up with the given transaction ID */
26
+ waitForIndexerTransaction: (transactionId: string) => Promise<TransactionLookupResult>;
27
+ }
28
+ /**
29
+ * Parameters for the @see getTestAccount function.
30
+ */
31
+ export interface GetTestAccountParams {
32
+ /** Initial funds to ensure the account has */
33
+ initialFunds: AlgoAmount;
34
+ /** Whether to suppress the log (which includes a mnemonic) or not (default: do not suppress the log) */
35
+ suppressLog?: boolean;
36
+ }
37
+ /** Configuration for creating an Algorand testing fixture. */
38
+ export interface AlgorandFixtureConfig {
39
+ /** An optional algod client, if not specified then it will create one against default LocalNet. */
40
+ algod?: Algodv2;
41
+ /** An optional indexer client, if not specified then it will create one against default LocalNet. */
42
+ indexer?: Indexer;
43
+ /** An optional kmd client, if not specified then it will create one against default LocalNet. */
44
+ kmd?: Kmd;
45
+ /** The amount of funds to allocate to the default testing account, if not specified then it will get 10 ALGOs. */
46
+ testAccountFunding?: AlgoAmount;
47
+ }
48
+ /** An Algorand automated testing fixture */
49
+ export interface AlgorandFixture {
50
+ /**
51
+ * Retrieve the current context.
52
+ * Useful with destructuring.
53
+ * @example ```typescript
54
+ * test('My test', () => {
55
+ * const {algod, indexer, testAccount, ...} = algorand.context
56
+ * })
57
+ * ```
58
+ */
59
+ get context(): AlgorandTestAutomationContext;
60
+ /**
61
+ * Testing framework agnostic handler method to run before each test to prepare the @see context for that test.
62
+ */
63
+ beforeEach: () => Promise<void>;
64
+ }
65
+ /** Configuration for preparing a captured log snapshot.
66
+ * This helps ensure that the provided configuration items won't appear
67
+ * with random values in the log snapshot, but rather will get substituted with predictable ids.
68
+ */
69
+ export interface LogSnapshotConfig {
70
+ /** Any transaction IDs or transactions to replace the ID for predictably */
71
+ transactions?: (string | Transaction)[];
72
+ /** Any accounts/addresses to replace the address for predictably */
73
+ accounts?: (string | SendTransactionFrom)[];
74
+ /** Any app IDs to replace predictably */
75
+ apps?: (string | number)[];
76
+ }
77
+ export interface AlgoKitLogCaptureFixture {
78
+ /** The test logger instance for the current test */
79
+ get testLogger(): TestLogger;
80
+ /**
81
+ * Testing framework agnostic handler method to run before each test to prepare the @see testLogger for that test.
82
+ */
83
+ beforeEach: () => void;
84
+ /**
85
+ * Testing framework agnostic handler method to run after each test to reset the logger.
86
+ */
87
+ afterEach: () => void;
88
+ }
89
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/types/testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AAEnD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,iFAAiF;IACjF,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E,CAAA;IAC3C,yCAAyC;IACzC,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,oDAAoD;IACpD,IAAI,UAAU,IAAI,UAAU,CAAA;IAC5B;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../src/types/testing.ts"],"names":[],"mappings":""}