@algorandfoundation/algokit-utils 9.2.0 → 9.2.1-beta.1

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 (340) hide show
  1. package/_virtual/_rolldown/runtime.js +33 -0
  2. package/_virtual/_rolldown/runtime.mjs +13 -0
  3. package/account/account.d.ts +25 -30
  4. package/account/account.js +151 -146
  5. package/account/account.js.map +1 -1
  6. package/account/account.mjs +149 -144
  7. package/account/account.mjs.map +1 -1
  8. package/account/get-account-config-from-environment.d.ts +7 -2
  9. package/account/get-account-config-from-environment.js +19 -21
  10. package/account/get-account-config-from-environment.js.map +1 -1
  11. package/account/get-account-config-from-environment.mjs +19 -19
  12. package/account/get-account-config-from-environment.mjs.map +1 -1
  13. package/account/get-account.d.ts +14 -12
  14. package/account/get-account.js +56 -59
  15. package/account/get-account.js.map +1 -1
  16. package/account/get-account.mjs +56 -57
  17. package/account/get-account.mjs.map +1 -1
  18. package/account/get-dispenser-account.d.ts +9 -5
  19. package/account/get-dispenser-account.js +20 -18
  20. package/account/get-dispenser-account.js.map +1 -1
  21. package/account/get-dispenser-account.mjs +20 -16
  22. package/account/get-dispenser-account.mjs.map +1 -1
  23. package/account/mnemonic-account.d.ts +7 -3
  24. package/account/mnemonic-account.js +17 -17
  25. package/account/mnemonic-account.js.map +1 -1
  26. package/account/mnemonic-account.mjs +15 -15
  27. package/account/mnemonic-account.mjs.map +1 -1
  28. package/amount.d.ts +40 -35
  29. package/amount.js +33 -34
  30. package/amount.js.map +1 -1
  31. package/amount.mjs +33 -32
  32. package/amount.mjs.map +1 -1
  33. package/app-client.d.ts +10 -6
  34. package/app-client.js +91 -86
  35. package/app-client.js.map +1 -1
  36. package/app-client.mjs +91 -84
  37. package/app-client.mjs.map +1 -1
  38. package/app-deploy.d.ts +26 -24
  39. package/app-deploy.js +235 -253
  40. package/app-deploy.js.map +1 -1
  41. package/app-deploy.mjs +233 -251
  42. package/app-deploy.mjs.map +1 -1
  43. package/app.d.ts +45 -46
  44. package/app.js +253 -271
  45. package/app.js.map +1 -1
  46. package/app.mjs +249 -267
  47. package/app.mjs.map +1 -1
  48. package/asset.d.ts +16 -12
  49. package/asset.js +116 -122
  50. package/asset.js.map +1 -1
  51. package/asset.mjs +116 -120
  52. package/asset.mjs.map +1 -1
  53. package/config.d.ts +7 -2
  54. package/config.js +5 -7
  55. package/config.js.map +1 -1
  56. package/config.mjs +5 -4
  57. package/config.mjs.map +1 -1
  58. package/debugging/debugging.d.ts +5 -1
  59. package/debugging/debugging.js +11 -11
  60. package/debugging/debugging.js.map +1 -1
  61. package/debugging/debugging.mjs +11 -9
  62. package/debugging/debugging.mjs.map +1 -1
  63. package/dispenser-client.d.ts +7 -2
  64. package/dispenser-client.js +23 -24
  65. package/dispenser-client.js.map +1 -1
  66. package/dispenser-client.mjs +23 -22
  67. package/dispenser-client.mjs.map +1 -1
  68. package/index.d.ts +27 -18
  69. package/index.js +140 -143
  70. package/index.mjs +27 -29
  71. package/indexer-lookup.d.ts +18 -11
  72. package/indexer-lookup.js +112 -120
  73. package/indexer-lookup.js.map +1 -1
  74. package/indexer-lookup.mjs +105 -118
  75. package/indexer-lookup.mjs.map +1 -1
  76. package/localnet/get-kmd-wallet-account.d.ts +9 -7
  77. package/localnet/get-kmd-wallet-account.js +28 -26
  78. package/localnet/get-kmd-wallet-account.js.map +1 -1
  79. package/localnet/get-kmd-wallet-account.mjs +28 -24
  80. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  81. package/localnet/get-localnet-dispenser-account.d.ts +7 -5
  82. package/localnet/get-localnet-dispenser-account.js +17 -15
  83. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  84. package/localnet/get-localnet-dispenser-account.mjs +17 -13
  85. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  86. package/localnet/get-or-create-kmd-wallet-account.d.ts +10 -8
  87. package/localnet/get-or-create-kmd-wallet-account.js +28 -26
  88. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  89. package/localnet/get-or-create-kmd-wallet-account.mjs +28 -24
  90. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  91. package/localnet/is-localnet.d.ts +7 -3
  92. package/localnet/is-localnet.js +9 -10
  93. package/localnet/is-localnet.js.map +1 -1
  94. package/localnet/is-localnet.mjs +9 -8
  95. package/localnet/is-localnet.mjs.map +1 -1
  96. package/network-client.d.ts +17 -15
  97. package/network-client.js +115 -116
  98. package/network-client.js.map +1 -1
  99. package/network-client.mjs +115 -114
  100. package/network-client.mjs.map +1 -1
  101. package/package.json +12 -3
  102. package/testing/account.d.ts +11 -9
  103. package/testing/account.js +31 -33
  104. package/testing/account.js.map +1 -1
  105. package/testing/account.mjs +29 -31
  106. package/testing/account.mjs.map +1 -1
  107. package/testing/fixtures/algokit-log-capture-fixture.d.ts +7 -2
  108. package/testing/fixtures/algokit-log-capture-fixture.js +36 -41
  109. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  110. package/testing/fixtures/algokit-log-capture-fixture.mjs +36 -39
  111. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  112. package/testing/fixtures/algorand-fixture.d.ts +9 -4
  113. package/testing/fixtures/algorand-fixture.js +67 -62
  114. package/testing/fixtures/algorand-fixture.js.map +1 -1
  115. package/testing/fixtures/algorand-fixture.mjs +66 -59
  116. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  117. package/testing/index.d.ts +7 -5
  118. package/testing/index.js +13 -18
  119. package/testing/index.mjs +7 -7
  120. package/testing/indexer.d.ts +5 -1
  121. package/testing/indexer.js +28 -37
  122. package/testing/indexer.js.map +1 -1
  123. package/testing/indexer.mjs +28 -35
  124. package/testing/indexer.mjs.map +1 -1
  125. package/testing/test-logger.d.ts +41 -36
  126. package/testing/test-logger.js +71 -76
  127. package/testing/test-logger.js.map +1 -1
  128. package/testing/test-logger.mjs +71 -74
  129. package/testing/test-logger.mjs.map +1 -1
  130. package/testing/transaction-logger.d.ts +30 -27
  131. package/testing/transaction-logger.js +77 -93
  132. package/testing/transaction-logger.js.map +1 -1
  133. package/testing/transaction-logger.mjs +74 -90
  134. package/testing/transaction-logger.mjs.map +1 -1
  135. package/transaction/legacy-bridge.js +100 -111
  136. package/transaction/legacy-bridge.js.map +1 -1
  137. package/transaction/legacy-bridge.mjs +97 -108
  138. package/transaction/legacy-bridge.mjs.map +1 -1
  139. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +7 -5
  140. package/transaction/perform-atomic-transaction-composer-simulate.js +31 -36
  141. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  142. package/transaction/perform-atomic-transaction-composer-simulate.mjs +28 -33
  143. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  144. package/transaction/transaction.d.ts +34 -35
  145. package/transaction/transaction.js +716 -914
  146. package/transaction/transaction.js.map +1 -1
  147. package/transaction/transaction.mjs +713 -911
  148. package/transaction/transaction.mjs.map +1 -1
  149. package/transfer/transfer-algos.d.ts +9 -5
  150. package/transfer/transfer-algos.js +26 -27
  151. package/transfer/transfer-algos.js.map +1 -1
  152. package/transfer/transfer-algos.mjs +26 -25
  153. package/transfer/transfer-algos.mjs.map +1 -1
  154. package/transfer/transfer.d.ts +11 -8
  155. package/transfer/transfer.js +94 -100
  156. package/transfer/transfer.js.map +1 -1
  157. package/transfer/transfer.mjs +94 -98
  158. package/transfer/transfer.mjs.map +1 -1
  159. package/types/account-manager.d.ts +432 -429
  160. package/types/account-manager.js +591 -602
  161. package/types/account-manager.js.map +1 -1
  162. package/types/account-manager.mjs +587 -599
  163. package/types/account-manager.mjs.map +1 -1
  164. package/types/account.d.ts +192 -202
  165. package/types/account.js +91 -88
  166. package/types/account.js.map +1 -1
  167. package/types/account.mjs +88 -86
  168. package/types/account.mjs.map +1 -1
  169. package/types/algo-http-client-with-retry.d.ts +15 -10
  170. package/types/algo-http-client-with-retry.js +70 -92
  171. package/types/algo-http-client-with-retry.js.map +1 -1
  172. package/types/algo-http-client-with-retry.mjs +69 -90
  173. package/types/algo-http-client-with-retry.mjs.map +1 -1
  174. package/types/algorand-client-transaction-creator.d.ts +778 -771
  175. package/types/algorand-client-transaction-creator.js +733 -732
  176. package/types/algorand-client-transaction-creator.js.map +1 -1
  177. package/types/algorand-client-transaction-creator.mjs +732 -730
  178. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  179. package/types/algorand-client-transaction-sender.d.ts +1090 -1360
  180. package/types/algorand-client-transaction-sender.js +930 -961
  181. package/types/algorand-client-transaction-sender.js.map +1 -1
  182. package/types/algorand-client-transaction-sender.mjs +927 -959
  183. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  184. package/types/algorand-client.d.ts +239 -236
  185. package/types/algorand-client.js +322 -320
  186. package/types/algorand-client.js.map +1 -1
  187. package/types/algorand-client.mjs +321 -318
  188. package/types/algorand-client.mjs.map +1 -1
  189. package/types/amount.d.ts +47 -43
  190. package/types/amount.js +66 -70
  191. package/types/amount.js.map +1 -1
  192. package/types/amount.mjs +63 -68
  193. package/types/amount.mjs.map +1 -1
  194. package/types/app-arc56.d.ts +235 -272
  195. package/types/app-arc56.js +124 -170
  196. package/types/app-arc56.js.map +1 -1
  197. package/types/app-arc56.mjs +121 -168
  198. package/types/app-arc56.mjs.map +1 -1
  199. package/types/app-client.d.ts +1128 -2009
  200. package/types/app-client.js +1633 -1791
  201. package/types/app-client.js.map +1 -1
  202. package/types/app-client.mjs +1624 -1783
  203. package/types/app-client.mjs.map +1 -1
  204. package/types/app-deployer.d.ts +139 -141
  205. package/types/app-deployer.js +344 -384
  206. package/types/app-deployer.js.map +1 -1
  207. package/types/app-deployer.mjs +341 -382
  208. package/types/app-deployer.mjs.map +1 -1
  209. package/types/app-factory.d.ts +762 -932
  210. package/types/app-factory.js +496 -488
  211. package/types/app-factory.js.map +1 -1
  212. package/types/app-factory.mjs +491 -484
  213. package/types/app-factory.mjs.map +1 -1
  214. package/types/app-manager.d.ts +304 -310
  215. package/types/app-manager.js +422 -475
  216. package/types/app-manager.js.map +1 -1
  217. package/types/app-manager.mjs +419 -473
  218. package/types/app-manager.mjs.map +1 -1
  219. package/types/app-spec.d.ts +118 -117
  220. package/types/app-spec.js +125 -135
  221. package/types/app-spec.js.map +1 -1
  222. package/types/app-spec.mjs +121 -132
  223. package/types/app-spec.mjs.map +1 -1
  224. package/types/app.d.ts +229 -241
  225. package/types/app.js +36 -28
  226. package/types/app.js.map +1 -1
  227. package/types/app.mjs +33 -26
  228. package/types/app.mjs.map +1 -1
  229. package/types/asset-manager.d.ts +204 -199
  230. package/types/asset-manager.js +165 -174
  231. package/types/asset-manager.js.map +1 -1
  232. package/types/asset-manager.mjs +164 -172
  233. package/types/asset-manager.mjs.map +1 -1
  234. package/types/asset.d.ts +95 -91
  235. package/types/asset.js +0 -3
  236. package/types/asset.mjs +0 -2
  237. package/types/async-event-emitter.d.ts +18 -13
  238. package/types/async-event-emitter.js +37 -49
  239. package/types/async-event-emitter.js.map +1 -1
  240. package/types/async-event-emitter.mjs +36 -47
  241. package/types/async-event-emitter.mjs.map +1 -1
  242. package/types/client-manager.d.ts +453 -451
  243. package/types/client-manager.js +602 -598
  244. package/types/client-manager.js.map +1 -1
  245. package/types/client-manager.mjs +597 -594
  246. package/types/client-manager.mjs.map +1 -1
  247. package/types/composer.d.ts +1211 -1258
  248. package/types/composer.js +1436 -1498
  249. package/types/composer.js.map +1 -1
  250. package/types/composer.mjs +1430 -1493
  251. package/types/composer.mjs.map +1 -1
  252. package/types/config.d.ts +53 -48
  253. package/types/config.js +78 -77
  254. package/types/config.js.map +1 -1
  255. package/types/config.mjs +77 -75
  256. package/types/config.mjs.map +1 -1
  257. package/types/debugging.d.ts +25 -23
  258. package/types/debugging.js +9 -11
  259. package/types/debugging.js.map +1 -1
  260. package/types/debugging.mjs +8 -9
  261. package/types/debugging.mjs.map +1 -1
  262. package/types/dispenser-client.d.ts +57 -52
  263. package/types/dispenser-client.js +120 -141
  264. package/types/dispenser-client.js.map +1 -1
  265. package/types/dispenser-client.mjs +119 -139
  266. package/types/dispenser-client.mjs.map +1 -1
  267. package/types/expand.d.ts +5 -3
  268. package/types/expand.js +0 -3
  269. package/types/expand.mjs +0 -2
  270. package/types/indexer.d.ts +104 -100
  271. package/types/indexer.js +36 -31
  272. package/types/indexer.js.map +1 -1
  273. package/types/indexer.mjs +32 -30
  274. package/types/indexer.mjs.map +1 -1
  275. package/types/instance-of.d.ts +5 -3
  276. package/types/instance-of.js +0 -3
  277. package/types/instance-of.mjs +0 -2
  278. package/types/kmd-account-manager.d.ts +75 -70
  279. package/types/kmd-account-manager.js +150 -184
  280. package/types/kmd-account-manager.js.map +1 -1
  281. package/types/kmd-account-manager.mjs +147 -182
  282. package/types/kmd-account-manager.mjs.map +1 -1
  283. package/types/lifecycle-events.d.ts +13 -8
  284. package/types/lifecycle-events.js +10 -7
  285. package/types/lifecycle-events.js.map +1 -1
  286. package/types/lifecycle-events.mjs +9 -7
  287. package/types/lifecycle-events.mjs.map +1 -1
  288. package/types/logging.d.ts +15 -11
  289. package/types/logging.js +30 -31
  290. package/types/logging.js.map +1 -1
  291. package/types/logging.mjs +29 -29
  292. package/types/logging.mjs.map +1 -1
  293. package/types/logic-error.d.ts +33 -29
  294. package/types/logic-error.js +50 -49
  295. package/types/logic-error.js.map +1 -1
  296. package/types/logic-error.mjs +49 -47
  297. package/types/logic-error.mjs.map +1 -1
  298. package/types/network-client.d.ts +32 -27
  299. package/types/network-client.js +10 -9
  300. package/types/network-client.js.map +1 -1
  301. package/types/network-client.mjs +9 -7
  302. package/types/network-client.mjs.map +1 -1
  303. package/types/testing.d.ts +131 -132
  304. package/types/testing.js +0 -3
  305. package/types/testing.mjs +0 -2
  306. package/types/transaction.d.ts +110 -110
  307. package/types/transaction.js +0 -3
  308. package/types/transaction.mjs +0 -2
  309. package/types/transfer.d.ts +70 -66
  310. package/types/transfer.js +0 -3
  311. package/types/transfer.mjs +0 -2
  312. package/util.js +73 -118
  313. package/util.js.map +1 -1
  314. package/util.mjs +73 -116
  315. package/util.mjs.map +1 -1
  316. package/account/index.d.ts +0 -5
  317. package/debugging/index.d.ts +0 -1
  318. package/index.js.map +0 -1
  319. package/index.mjs.map +0 -1
  320. package/localnet/index.d.ts +0 -4
  321. package/testing/_asset.d.ts +0 -3
  322. package/testing/fixtures/index.d.ts +0 -2
  323. package/testing/index.js.map +0 -1
  324. package/testing/index.mjs.map +0 -1
  325. package/transaction/index.d.ts +0 -2
  326. package/transaction/legacy-bridge.d.ts +0 -35
  327. package/transfer/index.d.ts +0 -2
  328. package/types/asset.js.map +0 -1
  329. package/types/asset.mjs.map +0 -1
  330. package/types/expand.js.map +0 -1
  331. package/types/expand.mjs.map +0 -1
  332. package/types/instance-of.js.map +0 -1
  333. package/types/instance-of.mjs.map +0 -1
  334. package/types/testing.js.map +0 -1
  335. package/types/testing.mjs.map +0 -1
  336. package/types/transaction.js.map +0 -1
  337. package/types/transaction.mjs.map +0 -1
  338. package/types/transfer.js.map +0 -1
  339. package/types/transfer.mjs.map +0 -1
  340. package/util.d.ts +0 -48
@@ -1,142 +1,122 @@
1
- import { asJson } from '../util.mjs';
2
-
3
- const DISPENSER_BASE_URL = 'https://api.dispenser.algorandfoundation.tools';
1
+ import { asJson } from "../util.mjs";
2
+ //#region src/types/dispenser-client.ts
3
+ const DISPENSER_BASE_URL = "https://api.dispenser.algorandfoundation.tools";
4
4
  const DEFAULT_DISPENSER_REQUEST_TIMEOUT = 15;
5
- const DISPENSER_ACCESS_TOKEN_KEY = 'ALGOKIT_DISPENSER_ACCESS_TOKEN';
6
- var DispenserAssetName;
7
- (function (DispenserAssetName) {
8
- DispenserAssetName[DispenserAssetName["Algo"] = 0] = "Algo";
9
- })(DispenserAssetName || (DispenserAssetName = {}));
10
- const dispenserAssets = {
11
- [DispenserAssetName.Algo]: {
12
- assetId: 0,
13
- decimals: 6,
14
- description: 'Algo',
15
- },
16
- };
5
+ const DISPENSER_ACCESS_TOKEN_KEY = "ALGOKIT_DISPENSER_ACCESS_TOKEN";
6
+ const dispenserAssets = { [0]: {
7
+ assetId: 0,
8
+ decimals: 6,
9
+ description: "Algo"
10
+ } };
17
11
  /**
18
- * `TestNetDispenserApiClient` is a class that provides methods to interact with the [Algorand TestNet Dispenser API](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md).
19
- * It allows you to fund an address with Algo, refund a transaction, and get the funding limit for the Algo asset.
20
- *
21
- * The class requires an authentication token and a request timeout to be initialized. The authentication token can be provided
22
- * either directly as a parameter or through an `ALGOKIT_DISPENSER_ACCESS_TOKEN` environment variable. If neither is provided, an error is thrown.
23
- *
24
- * The request timeout can be provided as a parameter. If not provided, a default value is used.
25
- *
26
- * @property {string} authToken - The authentication token used for API requests.
27
- * @property {number} requestTimeout - The timeout for API requests, in seconds.
28
- *
29
- * @method fund - Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.
30
- * @method refund - Sends a refund request to the dispenser API for the specified refundTxnId.
31
- * @method limit - Sends a request to the dispenser API to get the funding limit for the Algo asset.
32
- *
33
- * @example
34
- * ```typescript
35
- * const client = new TestNetDispenserApiClient({ authToken: 'your_auth_token', requestTimeout: 30 });
36
- * const fundResponse = await client.fund('your_address', 100);
37
- * const limitResponse = await client.getLimit();
38
- * await client.refund('your_transaction_id');
39
- * ```
40
- *
41
- * @throws {Error} If neither the environment variable 'ALGOKIT_DISPENSER_ACCESS_TOKEN' nor the authToken parameter were provided.
42
- */
43
- class TestNetDispenserApiClient {
44
- constructor(params) {
45
- const authTokenFromEnv = process?.env?.[DISPENSER_ACCESS_TOKEN_KEY];
46
- if (params?.authToken) {
47
- this._authToken = params.authToken;
48
- }
49
- else if (authTokenFromEnv) {
50
- this._authToken = authTokenFromEnv;
51
- }
52
- else {
53
- throw new Error(`Can't init AlgoKit TestNet Dispenser API client because neither environment variable ${DISPENSER_ACCESS_TOKEN_KEY} or the authToken were provided.`);
54
- }
55
- this._requestTimeout = params?.requestTimeout || DEFAULT_DISPENSER_REQUEST_TIMEOUT;
56
- }
57
- get authToken() {
58
- return this._authToken;
59
- }
60
- get requestTimeout() {
61
- return this._requestTimeout;
62
- }
63
- /**
64
- * Processes a dispenser API request.
65
- *
66
- * @param authToken - The authentication token.
67
- * @param urlSuffix - The URL suffix for the API request.
68
- * @param body - The request body.
69
- * @param method - The HTTP method.
70
- *
71
- * @returns The API response.
72
- */
73
- async processDispenserRequest(authToken, urlSuffix, body = null, method = 'POST') {
74
- const headers = { Authorization: `Bearer ${authToken}` };
75
- const requestArgs = {
76
- method: method,
77
- headers: headers,
78
- signal: AbortSignal.timeout(this.requestTimeout * 1000),
79
- };
80
- if (body) {
81
- requestArgs.body = asJson(body);
82
- }
83
- const response = await fetch(`${DISPENSER_BASE_URL}/${urlSuffix}`, requestArgs);
84
- if (!response.ok) {
85
- let error_message = `Error processing dispenser API request: ${response.status}`;
86
- let error_response = null;
87
- try {
88
- error_response = await response.json();
89
- }
90
- catch {
91
- // suppress exception
92
- }
93
- if (error_response && error_response.code) {
94
- error_message = error_response.code;
95
- }
96
- else if (response.status === 400) {
97
- const errorResponse = (await response.json());
98
- error_message = errorResponse.message;
99
- }
100
- throw new Error(error_message);
101
- }
102
- return response;
103
- }
104
- /**
105
- * Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.
106
- *
107
- * @param address - The address to fund.
108
- * @param amount - The amount of µAlgo to fund.
109
- *
110
- * @returns DispenserFundResponse: An object containing the transaction ID and funded amount.
111
- */
112
- async fund(address, amount) {
113
- const response = await this.processDispenserRequest(this.authToken, `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}`, {
114
- receiver: typeof address === 'string' ? address : address.toString(),
115
- amount: Number(amount),
116
- assetID: dispenserAssets[DispenserAssetName.Algo].assetId,
117
- }, 'POST');
118
- const content = (await response.json());
119
- return { txId: content.txID, amount: content.amount };
120
- }
121
- /**
122
- * Sends a refund request to the dispenser API for the specified refundTxnId.
123
- *
124
- * @param refundTxnId - The transaction ID to refund.
125
- */
126
- async refund(refundTxnId) {
127
- await this.processDispenserRequest(this.authToken, 'refund', { refundTransactionID: refundTxnId }, 'POST');
128
- }
129
- /**
130
- * Sends a request to the dispenser API to get the funding limit for the Algo asset.
131
- *
132
- * @returns DispenserLimitResponse: An object containing the funding limit amount.
133
- */
134
- async getLimit() {
135
- const response = await this.processDispenserRequest(this.authToken, `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}/limit`, null, 'GET');
136
- const content = (await response.json());
137
- return { amount: content.amount };
138
- }
139
- }
140
-
12
+ * `TestNetDispenserApiClient` is a class that provides methods to interact with the [Algorand TestNet Dispenser API](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md).
13
+ * It allows you to fund an address with Algo, refund a transaction, and get the funding limit for the Algo asset.
14
+ *
15
+ * The class requires an authentication token and a request timeout to be initialized. The authentication token can be provided
16
+ * either directly as a parameter or through an `ALGOKIT_DISPENSER_ACCESS_TOKEN` environment variable. If neither is provided, an error is thrown.
17
+ *
18
+ * The request timeout can be provided as a parameter. If not provided, a default value is used.
19
+ *
20
+ * @property {string} authToken - The authentication token used for API requests.
21
+ * @property {number} requestTimeout - The timeout for API requests, in seconds.
22
+ *
23
+ * @method fund - Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.
24
+ * @method refund - Sends a refund request to the dispenser API for the specified refundTxnId.
25
+ * @method limit - Sends a request to the dispenser API to get the funding limit for the Algo asset.
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * const client = new TestNetDispenserApiClient({ authToken: 'your_auth_token', requestTimeout: 30 });
30
+ * const fundResponse = await client.fund('your_address', 100);
31
+ * const limitResponse = await client.getLimit();
32
+ * await client.refund('your_transaction_id');
33
+ * ```
34
+ *
35
+ * @throws {Error} If neither the environment variable 'ALGOKIT_DISPENSER_ACCESS_TOKEN' nor the authToken parameter were provided.
36
+ */
37
+ var TestNetDispenserApiClient = class {
38
+ _authToken;
39
+ _requestTimeout;
40
+ constructor(params) {
41
+ const authTokenFromEnv = process?.env?.[DISPENSER_ACCESS_TOKEN_KEY];
42
+ if (params?.authToken) this._authToken = params.authToken;
43
+ else if (authTokenFromEnv) this._authToken = authTokenFromEnv;
44
+ else throw new Error(`Can't init AlgoKit TestNet Dispenser API client because neither environment variable ${DISPENSER_ACCESS_TOKEN_KEY} or the authToken were provided.`);
45
+ this._requestTimeout = params?.requestTimeout || DEFAULT_DISPENSER_REQUEST_TIMEOUT;
46
+ }
47
+ get authToken() {
48
+ return this._authToken;
49
+ }
50
+ get requestTimeout() {
51
+ return this._requestTimeout;
52
+ }
53
+ /**
54
+ * Processes a dispenser API request.
55
+ *
56
+ * @param authToken - The authentication token.
57
+ * @param urlSuffix - The URL suffix for the API request.
58
+ * @param body - The request body.
59
+ * @param method - The HTTP method.
60
+ *
61
+ * @returns The API response.
62
+ */
63
+ async processDispenserRequest(authToken, urlSuffix, body = null, method = "POST") {
64
+ const requestArgs = {
65
+ method,
66
+ headers: { Authorization: `Bearer ${authToken}` },
67
+ signal: AbortSignal.timeout(this.requestTimeout * 1e3)
68
+ };
69
+ if (body) requestArgs.body = asJson(body);
70
+ const response = await fetch(`${DISPENSER_BASE_URL}/${urlSuffix}`, requestArgs);
71
+ if (!response.ok) {
72
+ let error_message = `Error processing dispenser API request: ${response.status}`;
73
+ let error_response = null;
74
+ try {
75
+ error_response = await response.json();
76
+ } catch {}
77
+ if (error_response && error_response.code) error_message = error_response.code;
78
+ else if (response.status === 400) error_message = (await response.json()).message;
79
+ throw new Error(error_message);
80
+ }
81
+ return response;
82
+ }
83
+ /**
84
+ * Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.
85
+ *
86
+ * @param address - The address to fund.
87
+ * @param amount - The amount of µAlgo to fund.
88
+ *
89
+ * @returns DispenserFundResponse: An object containing the transaction ID and funded amount.
90
+ */
91
+ async fund(address, amount) {
92
+ const content = await (await this.processDispenserRequest(this.authToken, `fund/${dispenserAssets[0].assetId}`, {
93
+ receiver: typeof address === "string" ? address : address.toString(),
94
+ amount: Number(amount),
95
+ assetID: dispenserAssets[0].assetId
96
+ }, "POST")).json();
97
+ return {
98
+ txId: content.txID,
99
+ amount: content.amount
100
+ };
101
+ }
102
+ /**
103
+ * Sends a refund request to the dispenser API for the specified refundTxnId.
104
+ *
105
+ * @param refundTxnId - The transaction ID to refund.
106
+ */
107
+ async refund(refundTxnId) {
108
+ await this.processDispenserRequest(this.authToken, "refund", { refundTransactionID: refundTxnId }, "POST");
109
+ }
110
+ /**
111
+ * Sends a request to the dispenser API to get the funding limit for the Algo asset.
112
+ *
113
+ * @returns DispenserLimitResponse: An object containing the funding limit amount.
114
+ */
115
+ async getLimit() {
116
+ return { amount: (await (await this.processDispenserRequest(this.authToken, `fund/${dispenserAssets[0].assetId}/limit`, null, "GET")).json()).amount };
117
+ }
118
+ };
119
+ //#endregion
141
120
  export { TestNetDispenserApiClient };
142
- //# sourceMappingURL=dispenser-client.mjs.map
121
+
122
+ //# sourceMappingURL=dispenser-client.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dispenser-client.mjs","sources":["../../src/types/dispenser-client.ts"],"sourcesContent":["import { Address } from 'algosdk'\nimport { asJson } from '../util'\n\nconst DISPENSER_BASE_URL = 'https://api.dispenser.algorandfoundation.tools'\nconst DEFAULT_DISPENSER_REQUEST_TIMEOUT = 15\nconst DISPENSER_ACCESS_TOKEN_KEY = 'ALGOKIT_DISPENSER_ACCESS_TOKEN'\n\ninterface ErrorResponse {\n code?: string\n}\n\nenum DispenserAssetName {\n Algo = 0,\n}\n\nconst dispenserAssets = {\n [DispenserAssetName.Algo]: {\n assetId: 0,\n decimals: 6,\n description: 'Algo',\n },\n}\n\n/** The TestNet Dispenser API response when funding. */\nexport interface DispenserFundResponse {\n /** The ID of the transaction that was issued to fund the account. */\n txId: string\n /** The number of µAlgo that was funded. */\n amount: number\n}\n\n/** The TestNet Dispenser API response when getting the current limit. */\nexport interface DispenserLimitResponse {\n /** The limit, in µAlgo, that you can currently fund. */\n amount: number\n}\n\n/** The parameters to construct a TestNet Dispenser API client. */\nexport interface TestNetDispenserApiClientParams {\n /** The API auth token */\n authToken: string\n /** The request timeout in seconds */\n requestTimeout?: number\n}\n\n/**\n * `TestNetDispenserApiClient` is a class that provides methods to interact with the [Algorand TestNet Dispenser API](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md).\n * It allows you to fund an address with Algo, refund a transaction, and get the funding limit for the Algo asset.\n *\n * The class requires an authentication token and a request timeout to be initialized. The authentication token can be provided\n * either directly as a parameter or through an `ALGOKIT_DISPENSER_ACCESS_TOKEN` environment variable. If neither is provided, an error is thrown.\n *\n * The request timeout can be provided as a parameter. If not provided, a default value is used.\n *\n * @property {string} authToken - The authentication token used for API requests.\n * @property {number} requestTimeout - The timeout for API requests, in seconds.\n *\n * @method fund - Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.\n * @method refund - Sends a refund request to the dispenser API for the specified refundTxnId.\n * @method limit - Sends a request to the dispenser API to get the funding limit for the Algo asset.\n *\n * @example\n * ```typescript\n * const client = new TestNetDispenserApiClient({ authToken: 'your_auth_token', requestTimeout: 30 });\n * const fundResponse = await client.fund('your_address', 100);\n * const limitResponse = await client.getLimit();\n * await client.refund('your_transaction_id');\n * ```\n *\n * @throws {Error} If neither the environment variable 'ALGOKIT_DISPENSER_ACCESS_TOKEN' nor the authToken parameter were provided.\n */\nexport class TestNetDispenserApiClient {\n private _authToken: string\n private _requestTimeout: number\n\n constructor(params?: TestNetDispenserApiClientParams) {\n const authTokenFromEnv = process?.env?.[DISPENSER_ACCESS_TOKEN_KEY]\n\n if (params?.authToken) {\n this._authToken = params.authToken\n } else if (authTokenFromEnv) {\n this._authToken = authTokenFromEnv\n } else {\n throw new Error(\n `Can't init AlgoKit TestNet Dispenser API client because neither environment variable ${DISPENSER_ACCESS_TOKEN_KEY} or the authToken were provided.`,\n )\n }\n\n this._requestTimeout = params?.requestTimeout || DEFAULT_DISPENSER_REQUEST_TIMEOUT\n }\n\n get authToken(): string {\n return this._authToken\n }\n\n get requestTimeout(): number {\n return this._requestTimeout\n }\n\n /**\n * Processes a dispenser API request.\n *\n * @param authToken - The authentication token.\n * @param urlSuffix - The URL suffix for the API request.\n * @param body - The request body.\n * @param method - The HTTP method.\n *\n * @returns The API response.\n */\n private async processDispenserRequest(\n authToken: string,\n urlSuffix: string,\n body: Record<string, string | number> | null = null,\n method = 'POST',\n ): Promise<Response> {\n const headers = { Authorization: `Bearer ${authToken}` }\n\n const requestArgs: RequestInit = {\n method: method,\n headers: headers,\n signal: AbortSignal.timeout(this.requestTimeout * 1000),\n }\n\n if (body) {\n requestArgs.body = asJson(body)\n }\n\n const response = await fetch(`${DISPENSER_BASE_URL}/${urlSuffix}`, requestArgs)\n if (!response.ok) {\n let error_message = `Error processing dispenser API request: ${response.status}`\n let error_response = null\n try {\n error_response = await response.json()\n } catch {\n // suppress exception\n }\n\n if (error_response && (error_response as ErrorResponse).code) {\n error_message = (error_response as ErrorResponse).code!\n } else if (response.status === 400) {\n const errorResponse = (await response.json()) as { message: string }\n error_message = errorResponse.message\n }\n\n throw new Error(error_message)\n }\n return response\n }\n\n /**\n * Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.\n *\n * @param address - The address to fund.\n * @param amount - The amount of µAlgo to fund.\n *\n * @returns DispenserFundResponse: An object containing the transaction ID and funded amount.\n */\n async fund(address: string | Address, amount: number | bigint): Promise<DispenserFundResponse> {\n const response = await this.processDispenserRequest(\n this.authToken,\n `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}`,\n {\n receiver: typeof address === 'string' ? address : address.toString(),\n amount: Number(amount),\n assetID: dispenserAssets[DispenserAssetName.Algo].assetId,\n },\n 'POST',\n )\n\n const content = (await response.json()) as { txID: string; amount: number }\n return { txId: content.txID, amount: content.amount }\n }\n\n /**\n * Sends a refund request to the dispenser API for the specified refundTxnId.\n *\n * @param refundTxnId - The transaction ID to refund.\n */\n async refund(refundTxnId: string): Promise<void> {\n await this.processDispenserRequest(this.authToken, 'refund', { refundTransactionID: refundTxnId }, 'POST')\n }\n\n /**\n * Sends a request to the dispenser API to get the funding limit for the Algo asset.\n *\n * @returns DispenserLimitResponse: An object containing the funding limit amount.\n */\n async getLimit(): Promise<DispenserLimitResponse> {\n const response = await this.processDispenserRequest(\n this.authToken,\n `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}/limit`,\n null,\n 'GET',\n )\n const content = (await response.json()) as { amount: number }\n\n return { amount: content.amount }\n }\n}\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"dispenser-client.mjs","names":[],"sources":["../../src/types/dispenser-client.ts"],"sourcesContent":["import { Address } from 'algosdk'\nimport { asJson } from '../util'\n\nconst DISPENSER_BASE_URL = 'https://api.dispenser.algorandfoundation.tools'\nconst DEFAULT_DISPENSER_REQUEST_TIMEOUT = 15\nconst DISPENSER_ACCESS_TOKEN_KEY = 'ALGOKIT_DISPENSER_ACCESS_TOKEN'\n\ninterface ErrorResponse {\n code?: string\n}\n\nenum DispenserAssetName {\n Algo = 0,\n}\n\nconst dispenserAssets = {\n [DispenserAssetName.Algo]: {\n assetId: 0,\n decimals: 6,\n description: 'Algo',\n },\n}\n\n/** The TestNet Dispenser API response when funding. */\nexport interface DispenserFundResponse {\n /** The ID of the transaction that was issued to fund the account. */\n txId: string\n /** The number of µAlgo that was funded. */\n amount: number\n}\n\n/** The TestNet Dispenser API response when getting the current limit. */\nexport interface DispenserLimitResponse {\n /** The limit, in µAlgo, that you can currently fund. */\n amount: number\n}\n\n/** The parameters to construct a TestNet Dispenser API client. */\nexport interface TestNetDispenserApiClientParams {\n /** The API auth token */\n authToken: string\n /** The request timeout in seconds */\n requestTimeout?: number\n}\n\n/**\n * `TestNetDispenserApiClient` is a class that provides methods to interact with the [Algorand TestNet Dispenser API](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md).\n * It allows you to fund an address with Algo, refund a transaction, and get the funding limit for the Algo asset.\n *\n * The class requires an authentication token and a request timeout to be initialized. The authentication token can be provided\n * either directly as a parameter or through an `ALGOKIT_DISPENSER_ACCESS_TOKEN` environment variable. If neither is provided, an error is thrown.\n *\n * The request timeout can be provided as a parameter. If not provided, a default value is used.\n *\n * @property {string} authToken - The authentication token used for API requests.\n * @property {number} requestTimeout - The timeout for API requests, in seconds.\n *\n * @method fund - Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.\n * @method refund - Sends a refund request to the dispenser API for the specified refundTxnId.\n * @method limit - Sends a request to the dispenser API to get the funding limit for the Algo asset.\n *\n * @example\n * ```typescript\n * const client = new TestNetDispenserApiClient({ authToken: 'your_auth_token', requestTimeout: 30 });\n * const fundResponse = await client.fund('your_address', 100);\n * const limitResponse = await client.getLimit();\n * await client.refund('your_transaction_id');\n * ```\n *\n * @throws {Error} If neither the environment variable 'ALGOKIT_DISPENSER_ACCESS_TOKEN' nor the authToken parameter were provided.\n */\nexport class TestNetDispenserApiClient {\n private _authToken: string\n private _requestTimeout: number\n\n constructor(params?: TestNetDispenserApiClientParams) {\n const authTokenFromEnv = process?.env?.[DISPENSER_ACCESS_TOKEN_KEY]\n\n if (params?.authToken) {\n this._authToken = params.authToken\n } else if (authTokenFromEnv) {\n this._authToken = authTokenFromEnv\n } else {\n throw new Error(\n `Can't init AlgoKit TestNet Dispenser API client because neither environment variable ${DISPENSER_ACCESS_TOKEN_KEY} or the authToken were provided.`,\n )\n }\n\n this._requestTimeout = params?.requestTimeout || DEFAULT_DISPENSER_REQUEST_TIMEOUT\n }\n\n get authToken(): string {\n return this._authToken\n }\n\n get requestTimeout(): number {\n return this._requestTimeout\n }\n\n /**\n * Processes a dispenser API request.\n *\n * @param authToken - The authentication token.\n * @param urlSuffix - The URL suffix for the API request.\n * @param body - The request body.\n * @param method - The HTTP method.\n *\n * @returns The API response.\n */\n private async processDispenserRequest(\n authToken: string,\n urlSuffix: string,\n body: Record<string, string | number> | null = null,\n method = 'POST',\n ): Promise<Response> {\n const headers = { Authorization: `Bearer ${authToken}` }\n\n const requestArgs: RequestInit = {\n method: method,\n headers: headers,\n signal: AbortSignal.timeout(this.requestTimeout * 1000),\n }\n\n if (body) {\n requestArgs.body = asJson(body)\n }\n\n const response = await fetch(`${DISPENSER_BASE_URL}/${urlSuffix}`, requestArgs)\n if (!response.ok) {\n let error_message = `Error processing dispenser API request: ${response.status}`\n let error_response = null\n try {\n error_response = await response.json()\n } catch {\n // suppress exception\n }\n\n if (error_response && (error_response as ErrorResponse).code) {\n error_message = (error_response as ErrorResponse).code!\n } else if (response.status === 400) {\n const errorResponse = (await response.json()) as { message: string }\n error_message = errorResponse.message\n }\n\n throw new Error(error_message)\n }\n return response\n }\n\n /**\n * Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.\n *\n * @param address - The address to fund.\n * @param amount - The amount of µAlgo to fund.\n *\n * @returns DispenserFundResponse: An object containing the transaction ID and funded amount.\n */\n async fund(address: string | Address, amount: number | bigint): Promise<DispenserFundResponse> {\n const response = await this.processDispenserRequest(\n this.authToken,\n `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}`,\n {\n receiver: typeof address === 'string' ? address : address.toString(),\n amount: Number(amount),\n assetID: dispenserAssets[DispenserAssetName.Algo].assetId,\n },\n 'POST',\n )\n\n const content = (await response.json()) as { txID: string; amount: number }\n return { txId: content.txID, amount: content.amount }\n }\n\n /**\n * Sends a refund request to the dispenser API for the specified refundTxnId.\n *\n * @param refundTxnId - The transaction ID to refund.\n */\n async refund(refundTxnId: string): Promise<void> {\n await this.processDispenserRequest(this.authToken, 'refund', { refundTransactionID: refundTxnId }, 'POST')\n }\n\n /**\n * Sends a request to the dispenser API to get the funding limit for the Algo asset.\n *\n * @returns DispenserLimitResponse: An object containing the funding limit amount.\n */\n async getLimit(): Promise<DispenserLimitResponse> {\n const response = await this.processDispenserRequest(\n this.authToken,\n `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}/limit`,\n null,\n 'GET',\n )\n const content = (await response.json()) as { amount: number }\n\n return { amount: content.amount }\n }\n}\n"],"mappings":";;AAGA,MAAM,qBAAqB;AAC3B,MAAM,oCAAoC;AAC1C,MAAM,6BAA6B;AAUnC,MAAM,kBAAkB,GAAA,IACK;CACzB,SAAS;CACT,UAAU;CACV,aAAa;AACf,EACF;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAa,4BAAb,MAAuC;CACrC;CACA;CAEA,YAAY,QAA0C;EACpD,MAAM,mBAAmB,SAAS,MAAM;EAExC,IAAI,QAAQ,WACV,KAAK,aAAa,OAAO;OACpB,IAAI,kBACT,KAAK,aAAa;OAElB,MAAM,IAAI,MACR,wFAAwF,2BAA2B,iCACrH;EAGF,KAAK,kBAAkB,QAAQ,kBAAkB;CACnD;CAEA,IAAI,YAAoB;EACtB,OAAO,KAAK;CACd;CAEA,IAAI,iBAAyB;EAC3B,OAAO,KAAK;CACd;;;;;;;;;;;CAYA,MAAc,wBACZ,WACA,WACA,OAA+C,MAC/C,SAAS,QACU;EAGnB,MAAM,cAA2B;GACvB;GACR,SAAS,EAJO,eAAe,UAAU,YAI1B;GACf,QAAQ,YAAY,QAAQ,KAAK,iBAAiB,GAAI;EACxD;EAEA,IAAI,MACF,YAAY,OAAO,OAAO,IAAI;EAGhC,MAAM,WAAW,MAAM,MAAM,GAAG,mBAAmB,GAAG,aAAa,WAAW;EAC9E,IAAI,CAAC,SAAS,IAAI;GAChB,IAAI,gBAAgB,2CAA2C,SAAS;GACxE,IAAI,iBAAiB;GACrB,IAAI;IACF,iBAAiB,MAAM,SAAS,KAAK;GACvC,QAAQ,CAER;GAEA,IAAI,kBAAmB,eAAiC,MACtD,gBAAiB,eAAiC;QAC7C,IAAI,SAAS,WAAW,KAE7B,iBAAgB,MADa,SAAS,KAAK,EAAA,CACb;GAGhC,MAAM,IAAI,MAAM,aAAa;EAC/B;EACA,OAAO;CACT;;;;;;;;;CAUA,MAAM,KAAK,SAA2B,QAAyD;EAY7F,MAAM,UAAW,OAAM,MAXA,KAAK,wBAC1B,KAAK,WACL,QAAQ,gBAAA,EAAwC,CAAC,WACjD;GACE,UAAU,OAAO,YAAY,WAAW,UAAU,QAAQ,SAAS;GACnE,QAAQ,OAAO,MAAM;GACrB,SAAS,gBAAA,EAAwC,CAAC;EACpD,GACA,MACF,EAAA,CAEgC,KAAK;EACrC,OAAO;GAAE,MAAM,QAAQ;GAAM,QAAQ,QAAQ;EAAO;CACtD;;;;;;CAOA,MAAM,OAAO,aAAoC;EAC/C,MAAM,KAAK,wBAAwB,KAAK,WAAW,UAAU,EAAE,qBAAqB,YAAY,GAAG,MAAM;CAC3G;;;;;;CAOA,MAAM,WAA4C;EAShD,OAAO,EAAE,SAAQ,OAFM,MANA,KAAK,wBAC1B,KAAK,WACL,QAAQ,gBAAA,EAAwC,CAAC,QAAQ,SACzD,MACA,KACF,EAAA,CACgC,KAAK,EAAA,CAEZ,OAAO;CAClC;AACF"}
package/types/expand.d.ts CHANGED
@@ -1,7 +1,9 @@
1
+ //#region src/types/expand.d.ts
1
2
  /**
2
3
  * Expands types for IntelliSense so they are more human readable
3
4
  * See https://stackoverflow.com/a/69288824
4
5
  */
5
- export type Expand<T> = T extends (...args: infer A) => infer R ? (...args: Expand<A>) => Expand<R> : T extends infer O ? {
6
- [K in keyof O]: O[K];
7
- } : never;
6
+ type Expand<T> = T extends ((...args: infer A) => infer R) ? (...args: Expand<A>) => Expand<R> : T extends infer O ? { [K in keyof O]: O[K] } : never;
7
+ //#endregion
8
+ export { Expand };
9
+ //# sourceMappingURL=expand.d.ts.map
package/types/expand.js CHANGED
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- //# sourceMappingURL=expand.js.map
package/types/expand.mjs CHANGED
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=expand.mjs.map
@@ -1,47 +1,48 @@
1
- import algosdk from 'algosdk';
2
- import indexerModels = algosdk.indexerModels;
3
- /** @deprecated Use `algosdk.indexerModels.TransactionsResponse`. Indexer result for a transaction search, https://dev.algorand.co/reference/rest-apis/indexer#get-v2transactions */
4
- export type TransactionSearchResults = indexerModels.TransactionsResponse;
5
- /** @deprecated Use `algosdk.indexerModels.AccountResponse`. Indexer result for an account lookup, https://dev.algorand.co/reference/rest-apis/indexer#get-v2accountsaccount-id */
6
- export type AccountLookupResult = indexerModels.AccountResponse;
7
- /** @deprecated Use `algosdk.indexerModels.AssetHoldingsResponse`. Indexer result for an account's asset holdings, https://dev.algorand.co/reference/rest-apis/indexer#get-v2accountsaccount-idassets */
8
- export type AssetsLookupResult = indexerModels.AssetHoldingsResponse;
9
- /** @deprecated Use `algosdk.indexerModels.AssetsResponse`. Indexer result for an account's created assets, https://dev.algorand.co/reference/rest-apis/indexer#get-v2accountsaccount-idcreated-assets */
10
- export type AssetsCreatedLookupResult = indexerModels.AssetsResponse;
11
- /** @deprecated Use `algosdk.indexerModels.ApplicationsResponse`. Indexer result for an account's created applications, https://dev.algorand.co/reference/rest-apis/indexer#get-v2accountsaccount-idcreated-applications */
12
- export type ApplicationCreatedLookupResult = indexerModels.ApplicationsResponse;
13
- /** @deprecated Use `algosdk.indexerModels.AssetResponse`. Indexer result for an asset lookup, https://dev.algorand.co/reference/rest-apis/indexer#get-v2assetsasset-id */
14
- export type AssetLookupResult = indexerModels.AssetResponse;
15
- /** Options when looking up an asset's account holdings, https://dev.algorand.co/reference/rest-apis/indexer#get-v2assetsasset-idbalances */
16
- export interface LookupAssetHoldingsOptions {
17
- /** Results should have a decimal units amount less than this value. */
18
- currencyLessThan?: number | bigint;
19
- /** Results should have a decimal units amount greater than this value. */
20
- currencyGreaterThan?: number | bigint;
21
- /** Include all items including closed accounts and opted-out asset holdings. */
22
- includeAll?: boolean;
1
+ import algosdk from "algosdk";
2
+
3
+ //#region src/types/indexer.d.ts
4
+ /** @deprecated Use `algosdk.indexerModels.TransactionsResponse`. Indexer result for a transaction search, https://dev.algorand.co/reference/rest-api/indexer#get-v2transactions */
5
+ type TransactionSearchResults = indexerModels.TransactionsResponse;
6
+ /** @deprecated Use `algosdk.indexerModels.AccountResponse`. Indexer result for an account lookup, https://dev.algorand.co/reference/rest-api/indexer#get-v2accountsaccount-id */
7
+ type AccountLookupResult = indexerModels.AccountResponse;
8
+ /** @deprecated Use `algosdk.indexerModels.AssetHoldingsResponse`. Indexer result for an account's asset holdings, https://dev.algorand.co/reference/rest-api/indexer#get-v2accountsaccount-idassets */
9
+ type AssetsLookupResult = indexerModels.AssetHoldingsResponse;
10
+ /** @deprecated Use `algosdk.indexerModels.AssetsResponse`. Indexer result for an account's created assets, https://dev.algorand.co/reference/rest-api/indexer#get-v2accountsaccount-idcreated-assets */
11
+ type AssetsCreatedLookupResult = indexerModels.AssetsResponse;
12
+ /** @deprecated Use `algosdk.indexerModels.ApplicationsResponse`. Indexer result for an account's created applications, https://dev.algorand.co/reference/rest-api/indexer#get-v2accountsaccount-idcreated-applications */
13
+ type ApplicationCreatedLookupResult = indexerModels.ApplicationsResponse;
14
+ /** @deprecated Use `algosdk.indexerModels.AssetResponse`. Indexer result for an asset lookup, https://dev.algorand.co/reference/rest-api/indexer#get-v2assetsasset-id */
15
+ type AssetLookupResult = indexerModels.AssetResponse;
16
+ /** Options when looking up an asset's account holdings, https://dev.algorand.co/reference/rest-api/indexer#get-v2assetsasset-idbalances */
17
+ interface LookupAssetHoldingsOptions {
18
+ /** Results should have a decimal units amount less than this value. */
19
+ currencyLessThan?: number | bigint;
20
+ /** Results should have a decimal units amount greater than this value. */
21
+ currencyGreaterThan?: number | bigint;
22
+ /** Include all items including closed accounts and opted-out asset holdings. */
23
+ includeAll?: boolean;
23
24
  }
24
- /** @deprecated Use `algosdk.indexerModels.AssetBalancesResponse`. Indexer result for an asset's account holdings, https://dev.algorand.co/reference/rest-apis/indexer#get-v2assetsasset-idbalances */
25
- export type AssetBalancesLookupResult = indexerModels.AssetBalancesResponse;
26
- /** @deprecated Use `algosdk.indexerModels.TransactionResponse`. Indexer result for a transaction lookup, https://dev.algorand.co/reference/rest-apis/indexer#get-v2transactionstxid */
27
- export type TransactionLookupResult = indexerModels.TransactionResponse;
28
- /** @deprecated Use `algosdk.indexerModels.ApplicationResponse`. Indexer result for an application lookup, https://dev.algorand.co/reference/rest-apis/indexer#get-v2applicationsapplication-id */
29
- export type ApplicationLookupResult = indexerModels.ApplicationResponse;
30
- /** @deprecated Use `algosdk.indexerModels.Transaction`. Indexer result for a transaction, https://dev.algorand.co/reference/rest-apis/indexer#transaction */
31
- export type TransactionResult = indexerModels.Transaction;
32
- /** @deprecated Use `algosdk.indexerModels.Account`. Indexer Account information at a given round https://dev.algorand.co/reference/rest-apis/indexer#account */
33
- export type AccountResult = indexerModels.Account;
34
- /** @deprecated Use `algosdk.indexerModels.TransactionPayment`. Indexer Fields for a payment transaction https://dev.algorand.co/reference/rest-apis/indexer#transactionpayment */
35
- export type PaymentTransactionResult = indexerModels.TransactionPayment;
36
- /** @deprecated Use `algosdk.indexerModels.TransactionStateProof`. Indexer Fields for a state proof transaction https://dev.algorand.co/reference/rest-apis/indexer#transactionstateproof.
25
+ /** @deprecated Use `algosdk.indexerModels.AssetBalancesResponse`. Indexer result for an asset's account holdings, https://dev.algorand.co/reference/rest-api/indexer#get-v2assetsasset-idbalances */
26
+ type AssetBalancesLookupResult = indexerModels.AssetBalancesResponse;
27
+ /** @deprecated Use `algosdk.indexerModels.TransactionResponse`. Indexer result for a transaction lookup, https://dev.algorand.co/reference/rest-api/indexer#get-v2transactionstxid */
28
+ type TransactionLookupResult = indexerModels.TransactionResponse;
29
+ /** @deprecated Use `algosdk.indexerModels.ApplicationResponse`. Indexer result for an application lookup, https://dev.algorand.co/reference/rest-api/indexer#get-v2applicationsapplication-id */
30
+ type ApplicationLookupResult = indexerModels.ApplicationResponse;
31
+ /** @deprecated Use `algosdk.indexerModels.Transaction`. Indexer result for a transaction, https://dev.algorand.co/reference/rest-api/indexer#transaction */
32
+ type TransactionResult = indexerModels.Transaction;
33
+ /** @deprecated Use `algosdk.indexerModels.Account`. Indexer Account information at a given round https://dev.algorand.co/reference/rest-api/indexer#account */
34
+ type AccountResult = indexerModels.Account;
35
+ /** @deprecated Use `algosdk.indexerModels.TransactionPayment`. Indexer Fields for a payment transaction https://dev.algorand.co/reference/rest-api/indexer#transactionpayment */
36
+ type PaymentTransactionResult = indexerModels.TransactionPayment;
37
+ /** @deprecated Use `algosdk.indexerModels.TransactionStateProof`. Indexer Fields for a state proof transaction https://dev.algorand.co/reference/rest-api/indexer#transactionstateproof.
37
38
  *
38
39
  * See also https://dev.algorand.co/concepts/protocol/state-proofs/,
39
40
  * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,
40
41
  * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,
41
42
  * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and
42
- * https://dev.algorand.co/reference/rest-apis/algod/#stateproof.
43
+ * https://dev.algorand.co/reference/rest-api/algod/operations/getstateproof/.
43
44
  */
44
- export type StateProofTransactionResult = indexerModels.TransactionStateProof;
45
+ type StateProofTransactionResult = indexerModels.TransactionStateProof;
45
46
  /** @deprecated Use `algosdk.indexerModels.MerkleArrayProof`. Indexer Merkle array Proof.
46
47
  *
47
48
  * Proof is used to convince a verifier about membership of leaves: h0,h1...hn
@@ -78,91 +79,94 @@ export type StateProofTransactionResult = indexerModels.TransactionStateProof;
78
79
  * . len(hints) = 2^4/2
79
80
  * ```
80
81
  */
81
- export type MerkleArrayProof = indexerModels.MerkleArrayProof;
82
- /** @deprecated Use `algosdk.indexerModels.TransactionApplication`. Indexer Fields for an application transaction https://dev.algorand.co/reference/rest-apis/indexer#transactionapplication */
83
- export type ApplicationTransactionResult = indexerModels.TransactionApplication;
82
+ type MerkleArrayProof = indexerModels.MerkleArrayProof;
83
+ /** @deprecated Use `algosdk.indexerModels.TransactionApplication`. Indexer Fields for an application transaction https://dev.algorand.co/reference/rest-api/indexer#transactionapplication */
84
+ type ApplicationTransactionResult = indexerModels.TransactionApplication;
84
85
  /** @deprecated Use `algosdk.indexerModels.TransactionAssetConfig`. Indexer Fields for asset allocation, re-configuration, and destruction.
85
- * https://dev.algorand.co/reference/rest-apis/indexer#transactionassetconfig
86
+ * https://dev.algorand.co/reference/rest-api/indexer#transactionassetconfig
86
87
  *
87
88
  * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.
88
89
  */
89
- export type AssetConfigTransactionResult = indexerModels.TransactionAssetConfig;
90
- /** @deprecated Use `algosdk.indexerModels.TransactionAssetFreeze`. Indexer Fields for an asset freeze transaction. https://dev.algorand.co/reference/rest-apis/indexer#transactionassetfreeze */
91
- export type AssetFreezeTransactionResult = indexerModels.TransactionAssetFreeze;
92
- /** @deprecated Use `algosdk.indexerModels.TransactionAssetTransfer`. Indexer Fields for an asset transfer transaction. https://dev.algorand.co/reference/rest-apis/indexer#transactionassettransfer */
93
- export type AssetTransferTransactionResult = indexerModels.TransactionAssetTransfer;
94
- /** @deprecated Use `algosdk.indexerModels.TransactionKeyreg`. Indexer Fields for a `keyreg` transaction https://dev.algorand.co/reference/rest-apis/indexer#transactionkeyreg */
95
- export type KeyRegistrationTransactionResult = indexerModels.TransactionKeyreg;
96
- /** @deprecated Use `algosdk.indexerModels.Asset`. Indexer Fields to specify both the unique identifier and the parameters for an asset. https://dev.algorand.co/reference/rest-apis/indexer#asset */
97
- export type AssetResult = indexerModels.Asset;
90
+ type AssetConfigTransactionResult = indexerModels.TransactionAssetConfig;
91
+ /** @deprecated Use `algosdk.indexerModels.TransactionAssetFreeze`. Indexer Fields for an asset freeze transaction. https://dev.algorand.co/reference/rest-api/indexer#transactionassetfreeze */
92
+ type AssetFreezeTransactionResult = indexerModels.TransactionAssetFreeze;
93
+ /** @deprecated Use `algosdk.indexerModels.TransactionAssetTransfer`. Indexer Fields for an asset transfer transaction. https://dev.algorand.co/reference/rest-api/indexer#transactionassettransfer */
94
+ type AssetTransferTransactionResult = indexerModels.TransactionAssetTransfer;
95
+ /** @deprecated Use `algosdk.indexerModels.TransactionKeyreg`. Indexer Fields for a `keyreg` transaction https://dev.algorand.co/reference/rest-api/indexer#transactionkeyreg */
96
+ type KeyRegistrationTransactionResult = indexerModels.TransactionKeyreg;
97
+ /** @deprecated Use `algosdk.indexerModels.Asset`. Indexer Fields to specify both the unique identifier and the parameters for an asset. https://dev.algorand.co/reference/rest-api/indexer#asset */
98
+ type AssetResult = indexerModels.Asset;
98
99
  /** @deprecated Use `algosdk.indexerModels.Application`. Indexer result of looking up an application
99
100
  */
100
- export type ApplicationResult = indexerModels.Application;
101
- /** @deprecated Use `algosdk.indexerModels.TransactionSignature`. Indexer Validation signature associated with some data. Only one of the signatures should be provided. https://dev.algorand.co/reference/rest-apis/indexer#transactionsignature */
102
- export type TransactionSignature = indexerModels.TransactionSignature;
101
+ type ApplicationResult = indexerModels.Application;
102
+ /** @deprecated Use `algosdk.indexerModels.TransactionSignature`. Indexer Validation signature associated with some data. Only one of the signatures should be provided. https://dev.algorand.co/reference/rest-api/indexer#transactionsignature */
103
+ type TransactionSignature = indexerModels.TransactionSignature;
103
104
  /** @deprecated Use `algosdk.indexerModels.TransactionSignatureLogicsig`. Indexer [lsig] Programatic transaction signature.
104
105
  *
105
- * https://dev.algorand.co/reference/rest-apis/indexer#transactionsignaturelogicsig
106
+ * https://dev.algorand.co/reference/rest-api/indexer#transactionsignaturelogicsig
106
107
  *
107
108
  * https://dev.algorand.co/concepts/smart-contracts/logic-sigs
108
109
  */
109
- export type LogicTransactionSignature = indexerModels.TransactionSignatureLogicsig;
110
- /** @deprecated Use `algosdk.indexerModels.TransactionSignatureMultisig`. Indexer [msig] structure holding multiple subsignatures. https://dev.algorand.co/reference/rest-apis/indexer#transactionsignaturemultisig */
111
- export type MultisigTransactionSignature = indexerModels.TransactionSignatureMultisig;
112
- /** @deprecated Use `algosdk.indexerModels.TransactionSignatureMultisigSubsignature`. Indexer Sub-signature for a multisig signature https://dev.algorand.co/reference/rest-apis/indexer#transactionsignaturemultisigsubsignature */
113
- export type MultisigTransactionSubSignature = indexerModels.TransactionSignatureMultisigSubsignature;
110
+ type LogicTransactionSignature = indexerModels.TransactionSignatureLogicsig;
111
+ /** @deprecated Use `algosdk.indexerModels.TransactionSignatureMultisig`. Indexer [msig] structure holding multiple subsignatures. https://dev.algorand.co/reference/rest-api/indexer#transactionsignaturemultisig */
112
+ type MultisigTransactionSignature = indexerModels.TransactionSignatureMultisig;
113
+ /** @deprecated Use `algosdk.indexerModels.TransactionSignatureMultisigSubsignature`. Indexer Sub-signature for a multisig signature https://dev.algorand.co/reference/rest-api/indexer#transactionsignaturemultisigsubsignature */
114
+ type MultisigTransactionSubSignature = indexerModels.TransactionSignatureMultisigSubsignature;
114
115
  /** @deprecated Use `algosdk.indexerModels.EvalDeltaKeyValue`. */
115
- export type EvalDeltaKeyValue = indexerModels.EvalDeltaKeyValue;
116
+ type EvalDeltaKeyValue = indexerModels.EvalDeltaKeyValue;
116
117
  /** @deprecated Use `algosdk.indexerModels.AccountStateDelta`. */
117
- export type AccountStateDelta = indexerModels.AccountStateDelta;
118
+ type AccountStateDelta = indexerModels.AccountStateDelta;
118
119
  /** @deprecated Use `algosdk.indexerModels.EvalDeltaKeyValue[]`. */
119
- export type StateDelta = EvalDeltaKeyValue[];
120
- /** @deprecated Use `algosdk.indexerModels.EvalDelta`. Indexer Represents a TEAL value delta. https://dev.algorand.co/reference/rest-apis/indexer#evaldelta */
121
- export type EvalDelta = indexerModels.EvalDelta;
122
- /** @deprecated Use `algosdk.indexerModels.ApplicationParams`. Indexer Stores the global information associated with an application https://dev.algorand.co/reference/rest-apis/indexer#applicationparams */
123
- export type ApplicationParams = indexerModels.ApplicationParams;
120
+ type StateDelta = EvalDeltaKeyValue[];
121
+ /** @deprecated Use `algosdk.indexerModels.EvalDelta`. Indexer Represents a TEAL value delta. https://dev.algorand.co/reference/rest-api/indexer#evaldelta */
122
+ type EvalDelta = indexerModels.EvalDelta;
123
+ /** @deprecated Use `algosdk.indexerModels.ApplicationParams`. Indexer Stores the global information associated with an application https://dev.algorand.co/reference/rest-api/indexer#applicationparams */
124
+ type ApplicationParams = indexerModels.ApplicationParams;
124
125
  /** @deprecated Use `algosdk.indexerModels.StateSchema`. Indexer Represents a [apls] local-state or [apgs] global-state schema.
125
- * https://dev.algorand.co/reference/rest-apis/indexer#stateschema
126
+ * https://dev.algorand.co/reference/rest-api/indexer#stateschema
126
127
  *
127
128
  * These schemas determine how much storage may be used in a local-state or global-state for an application.
128
129
  *
129
130
  * The more space used, the larger minimum balance must be maintained in the account holding the data.
130
131
  */
131
- export type StateSchema = indexerModels.StateSchema;
132
- /** Defines the what additional actions occur with the transaction https://dev.algorand.co/reference/rest-apis/indexer/#oncompletion */
133
- export declare enum ApplicationOnComplete {
134
- noop = "noop",
135
- optin = "optin",
136
- closeout = "closeout",
137
- clear = "clear",
138
- update = "update",
139
- delete = "delete"
132
+ type StateSchema = indexerModels.StateSchema;
133
+ /** Defines the what additional actions occur with the transaction https://dev.algorand.co/reference/rest-api/indexer/#oncompletion */
134
+ declare enum ApplicationOnComplete {
135
+ noop = "noop",
136
+ optin = "optin",
137
+ closeout = "closeout",
138
+ clear = "clear",
139
+ update = "update",
140
+ delete = "delete"
140
141
  }
141
- /** @deprecated Use `algosdk.indexerModels.AssetParams`. Indexer AssetParams specifies the parameters for an asset. https://dev.algorand.co/reference/rest-apis/indexer#assetparams */
142
- export type AssetParams = indexerModels.AssetParams;
142
+ /** @deprecated Use `algosdk.indexerModels.AssetParams`. Indexer AssetParams specifies the parameters for an asset. https://dev.algorand.co/reference/rest-api/indexer#assetparams */
143
+ type AssetParams = indexerModels.AssetParams;
143
144
  /** Type of signature used by an account */
144
- export declare enum SignatureType {
145
- /** Normal signature */
146
- sig = "sig",
147
- /** Multisig */
148
- msig = "msig",
149
- /** Logic signature */
150
- lsig = "lsig"
145
+ declare enum SignatureType {
146
+ /** Normal signature */
147
+ sig = "sig",
148
+ /** Multisig */
149
+ msig = "msig",
150
+ /** Logic signature */
151
+ lsig = "lsig"
151
152
  }
152
153
  /** Delegation status of the account */
153
- export declare enum AccountStatus {
154
- /** Indicates that the associated account is delegated */
155
- Offline = "Offline",
156
- /** Indicates that the associated account used as part of the delegation pool */
157
- Online = "Online",
158
- /** Indicates that the associated account is neither a delegator nor a delegate */
159
- NotParticipating = "NotParticipating"
154
+ declare enum AccountStatus {
155
+ /** Indicates that the associated account is delegated */
156
+ Offline = "Offline",
157
+ /** Indicates that the associated account used as part of the delegation pool */
158
+ Online = "Online",
159
+ /** Indicates that the associated account is neither a delegator nor a delegate */
160
+ NotParticipating = "NotParticipating"
160
161
  }
161
- /** @deprecated Use `algosdk.indexerModels.AccountParticipation`. Indexer AccountParticipation describes the parameters used by this account in consensus protocol. https://dev.algorand.co/reference/rest-apis/indexer#accountparticipation */
162
- export type AccountParticipation = indexerModels.AccountParticipation;
163
- /** @deprecated Use `algosdk.indexerModels.ApplicationLocalState`. Indexer Stores local state associated with an application. https://dev.algorand.co/reference/rest-apis/indexer#applicationlocalstate */
164
- export type AppLocalState = indexerModels.ApplicationLocalState;
165
- /** @deprecated Use `algosdk.indexerModels.AssetHolding`. Indexer Describes an asset held by an account. https://dev.algorand.co/reference/rest-apis/indexer#assetholding */
166
- export type AssetHolding = indexerModels.AssetHolding;
167
- /** @deprecated Use `algosdk.indexerModels.MiniAssetHolding`. Indexer Describes an asset holding for an account of a known asset. https://dev.algorand.co/reference/rest-apis/indexer#miniassetholding */
168
- export type MiniAssetHolding = indexerModels.MiniAssetHolding;
162
+ /** @deprecated Use `algosdk.indexerModels.AccountParticipation`. Indexer AccountParticipation describes the parameters used by this account in consensus protocol. https://dev.algorand.co/reference/rest-api/indexer#accountparticipation */
163
+ type AccountParticipation = indexerModels.AccountParticipation;
164
+ /** @deprecated Use `algosdk.indexerModels.ApplicationLocalState`. Indexer Stores local state associated with an application. https://dev.algorand.co/reference/rest-api/indexer#applicationlocalstate */
165
+ type AppLocalState = indexerModels.ApplicationLocalState;
166
+ /** @deprecated Use `algosdk.indexerModels.AssetHolding`. Indexer Describes an asset held by an account. https://dev.algorand.co/reference/rest-api/indexer#assetholding */
167
+ type AssetHolding = indexerModels.AssetHolding;
168
+ /** @deprecated Use `algosdk.indexerModels.MiniAssetHolding`. Indexer Describes an asset holding for an account of a known asset. https://dev.algorand.co/reference/rest-api/indexer#miniassetholding */
169
+ type MiniAssetHolding = indexerModels.MiniAssetHolding;
170
+ //#endregion
171
+ export { AccountLookupResult, AccountParticipation, AccountResult, AccountStateDelta, AccountStatus, AppLocalState, ApplicationCreatedLookupResult, ApplicationLookupResult, ApplicationOnComplete, ApplicationParams, ApplicationResult, ApplicationTransactionResult, AssetBalancesLookupResult, AssetConfigTransactionResult, AssetFreezeTransactionResult, AssetHolding, AssetLookupResult, AssetParams, AssetResult, AssetTransferTransactionResult, AssetsCreatedLookupResult, AssetsLookupResult, EvalDelta, EvalDeltaKeyValue, KeyRegistrationTransactionResult, LogicTransactionSignature, LookupAssetHoldingsOptions, MerkleArrayProof, MiniAssetHolding, MultisigTransactionSignature, MultisigTransactionSubSignature, PaymentTransactionResult, SignatureType, StateDelta, StateProofTransactionResult, StateSchema, TransactionLookupResult, TransactionResult, TransactionSearchResults, TransactionSignature };
172
+ //# sourceMappingURL=indexer.d.ts.map