@algorandfoundation/algokit-utils 10.0.0-alpha.31 → 10.0.0-alpha.32

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 (318) hide show
  1. package/account-manager.d.ts +448 -0
  2. package/account-manager.js +623 -0
  3. package/account-manager.js.map +1 -0
  4. package/account-manager.mjs +620 -0
  5. package/account-manager.mjs.map +1 -0
  6. package/account.d.ts +156 -0
  7. package/account.js +10 -0
  8. package/account.js.map +1 -0
  9. package/account.mjs +9 -0
  10. package/account.mjs.map +1 -0
  11. package/algorand-client-transaction-creator.d.ts +1103 -0
  12. package/algorand-client-transaction-creator.js +735 -0
  13. package/algorand-client-transaction-creator.js.map +1 -0
  14. package/algorand-client-transaction-creator.mjs +734 -0
  15. package/algorand-client-transaction-creator.mjs.map +1 -0
  16. package/algorand-client-transaction-sender.d.ts +1317 -0
  17. package/algorand-client-transaction-sender.js +933 -0
  18. package/algorand-client-transaction-sender.js.map +1 -0
  19. package/algorand-client-transaction-sender.mjs +932 -0
  20. package/algorand-client-transaction-sender.mjs.map +1 -0
  21. package/algorand-client.d.ts +246 -0
  22. package/algorand-client.js +325 -0
  23. package/algorand-client.js.map +1 -0
  24. package/algorand-client.mjs +325 -0
  25. package/algorand-client.mjs.map +1 -0
  26. package/amount.d.ts +46 -3
  27. package/amount.js +92 -13
  28. package/amount.js.map +1 -1
  29. package/amount.mjs +80 -3
  30. package/amount.mjs.map +1 -1
  31. package/app-client.d.ts +2130 -0
  32. package/app-client.js +909 -0
  33. package/app-client.js.map +1 -0
  34. package/app-client.mjs +908 -0
  35. package/app-client.mjs.map +1 -0
  36. package/app-deployer.d.ts +166 -0
  37. package/app-deployer.js +353 -0
  38. package/app-deployer.js.map +1 -0
  39. package/app-deployer.mjs +353 -0
  40. package/app-deployer.mjs.map +1 -0
  41. package/app-factory.d.ts +965 -0
  42. package/app-factory.js +448 -0
  43. package/app-factory.js.map +1 -0
  44. package/app-factory.mjs +448 -0
  45. package/app-factory.mjs.map +1 -0
  46. package/app-manager.d.ts +323 -0
  47. package/app-manager.js +468 -0
  48. package/app-manager.js.map +1 -0
  49. package/app-manager.mjs +468 -0
  50. package/app-manager.mjs.map +1 -0
  51. package/app-spec.d.ts +203 -0
  52. package/app-spec.js +137 -0
  53. package/app-spec.js.map +1 -0
  54. package/app-spec.mjs +137 -0
  55. package/app-spec.mjs.map +1 -0
  56. package/app.d.ts +257 -0
  57. package/app.js +49 -0
  58. package/app.js.map +1 -0
  59. package/app.mjs +42 -0
  60. package/app.mjs.map +1 -0
  61. package/asset-manager.d.ts +212 -0
  62. package/asset-manager.js +166 -0
  63. package/asset-manager.js.map +1 -0
  64. package/asset-manager.mjs +166 -0
  65. package/asset-manager.mjs.map +1 -0
  66. package/async-event-emitter.d.ts +16 -0
  67. package/async-event-emitter.js +38 -0
  68. package/async-event-emitter.js.map +1 -0
  69. package/async-event-emitter.mjs +37 -0
  70. package/async-event-emitter.mjs.map +1 -0
  71. package/client-manager.d.ts +475 -0
  72. package/client-manager.js +616 -0
  73. package/client-manager.js.map +1 -0
  74. package/client-manager.mjs +616 -0
  75. package/client-manager.mjs.map +1 -0
  76. package/composer.d.ts +947 -0
  77. package/composer.js +1584 -0
  78. package/composer.js.map +1 -0
  79. package/composer.mjs +1583 -0
  80. package/composer.mjs.map +1 -0
  81. package/config.d.ts +1 -1
  82. package/config.js +2 -2
  83. package/config.js.map +1 -1
  84. package/config.mjs +1 -1
  85. package/config.mjs.map +1 -1
  86. package/debugging.d.ts +47 -0
  87. package/debugging.js +20 -0
  88. package/debugging.js.map +1 -0
  89. package/debugging.mjs +15 -0
  90. package/debugging.mjs.map +1 -0
  91. package/dispenser-client.d.ts +90 -0
  92. package/dispenser-client.js +127 -0
  93. package/dispenser-client.js.map +1 -0
  94. package/dispenser-client.mjs +127 -0
  95. package/dispenser-client.mjs.map +1 -0
  96. package/expand.d.ts +2 -0
  97. package/expand.js +0 -0
  98. package/expand.mjs +0 -0
  99. package/index.d.ts +6 -5
  100. package/index.js +4 -3
  101. package/index.mjs +5 -5
  102. package/indexer-client/indexer-lookup.d.ts +1 -1
  103. package/indexer-client/indexer-lookup.js.map +1 -1
  104. package/indexer-client/indexer-lookup.mjs.map +1 -1
  105. package/indexer.d.ts +40 -0
  106. package/indexer.js +38 -0
  107. package/indexer.js.map +1 -0
  108. package/indexer.mjs +35 -0
  109. package/indexer.mjs.map +1 -0
  110. package/instance-of.d.ts +8 -0
  111. package/kmd-account-manager.d.ts +74 -0
  112. package/kmd-account-manager.js +167 -0
  113. package/kmd-account-manager.js.map +1 -0
  114. package/kmd-account-manager.mjs +165 -0
  115. package/kmd-account-manager.mjs.map +1 -0
  116. package/lifecycle-events.d.ts +14 -0
  117. package/lifecycle-events.js +11 -0
  118. package/lifecycle-events.js.map +1 -0
  119. package/lifecycle-events.mjs +10 -0
  120. package/lifecycle-events.mjs.map +1 -0
  121. package/logging.d.ts +13 -0
  122. package/logging.js +47 -0
  123. package/logging.js.map +1 -0
  124. package/logging.mjs +42 -0
  125. package/logging.mjs.map +1 -0
  126. package/logic-error.d.ts +39 -0
  127. package/logic-error.js +54 -0
  128. package/logic-error.js.map +1 -0
  129. package/logic-error.mjs +53 -0
  130. package/logic-error.mjs.map +1 -0
  131. package/network-client.d.ts +43 -0
  132. package/network-client.js +14 -0
  133. package/network-client.js.map +1 -0
  134. package/network-client.mjs +13 -0
  135. package/network-client.mjs.map +1 -0
  136. package/package.json +11 -1
  137. package/testing/account.d.ts +2 -2
  138. package/testing/account.js +1 -1
  139. package/testing/account.js.map +1 -1
  140. package/testing/account.mjs +1 -1
  141. package/testing/account.mjs.map +1 -1
  142. package/testing/fixtures/algokit-log-capture-fixture.d.ts +1 -1
  143. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  144. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  145. package/testing/fixtures/algorand-fixture.d.ts +2 -2
  146. package/testing/fixtures/algorand-fixture.js +2 -2
  147. package/testing/fixtures/algorand-fixture.js.map +1 -1
  148. package/testing/fixtures/algorand-fixture.mjs +2 -2
  149. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  150. package/testing/index.d.ts +2 -1
  151. package/testing/test-logger.d.ts +1 -1
  152. package/testing/test-logger.js.map +1 -1
  153. package/testing/test-logger.mjs.map +1 -1
  154. package/testing/types.d.ts +156 -0
  155. package/transaction/index.d.ts +4 -0
  156. package/transaction/index.js +9 -0
  157. package/transaction/index.mjs +4 -0
  158. package/transaction/perform-transaction-composer-simulate.d.ts +1 -1
  159. package/transaction/perform-transaction-composer-simulate.js.map +1 -1
  160. package/transaction/perform-transaction-composer-simulate.mjs.map +1 -1
  161. package/transaction/transaction.d.ts +2 -2
  162. package/transaction/transaction.js.map +1 -1
  163. package/transaction/transaction.mjs.map +1 -1
  164. package/transaction/types.d.ts +133 -0
  165. package/transactions/app-call.d.ts +1 -1
  166. package/transactions/app-call.js +1 -1
  167. package/transactions/app-call.js.map +1 -1
  168. package/transactions/app-call.mjs +1 -1
  169. package/transactions/app-call.mjs.map +1 -1
  170. package/transactions/common.d.ts +1 -1
  171. package/transactions/common.js.map +1 -1
  172. package/transactions/common.mjs.map +1 -1
  173. package/transactions/method-call.d.ts +1 -1
  174. package/transactions/method-call.js +1 -1
  175. package/transactions/method-call.js.map +1 -1
  176. package/transactions/method-call.mjs +1 -1
  177. package/transactions/method-call.mjs.map +1 -1
  178. package/transactions/payment.d.ts +1 -1
  179. package/transactions/payment.js.map +1 -1
  180. package/transactions/payment.mjs.map +1 -1
  181. package/types/account-manager.d.ts +11 -442
  182. package/types/account-manager.js +5 -616
  183. package/types/account-manager.js.map +1 -1
  184. package/types/account-manager.mjs +5 -614
  185. package/types/account-manager.mjs.map +1 -1
  186. package/types/account.d.ts +8 -150
  187. package/types/account.js +3 -4
  188. package/types/account.js.map +1 -1
  189. package/types/account.mjs +4 -4
  190. package/types/account.mjs.map +1 -1
  191. package/types/algorand-client-transaction-creator.d.ts +5 -1098
  192. package/types/algorand-client-transaction-creator.js +3 -729
  193. package/types/algorand-client-transaction-creator.js.map +1 -1
  194. package/types/algorand-client-transaction-creator.mjs +4 -729
  195. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  196. package/types/algorand-client-transaction-sender.d.ts +5 -1312
  197. package/types/algorand-client-transaction-sender.js +3 -927
  198. package/types/algorand-client-transaction-sender.js.map +1 -1
  199. package/types/algorand-client-transaction-sender.mjs +3 -926
  200. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  201. package/types/algorand-client.d.ts +5 -241
  202. package/types/algorand-client.js +3 -319
  203. package/types/algorand-client.js.map +1 -1
  204. package/types/algorand-client.mjs +3 -319
  205. package/types/algorand-client.mjs.map +1 -1
  206. package/types/amount.d.ts +6 -45
  207. package/types/amount.js +3 -79
  208. package/types/amount.js.map +1 -1
  209. package/types/amount.mjs +4 -79
  210. package/types/amount.mjs.map +1 -1
  211. package/types/app-client.d.ts +75 -2125
  212. package/types/app-client.js +3 -903
  213. package/types/app-client.js.map +1 -1
  214. package/types/app-client.mjs +3 -902
  215. package/types/app-client.mjs.map +1 -1
  216. package/types/app-deployer.d.ts +21 -161
  217. package/types/app-deployer.js +3 -347
  218. package/types/app-deployer.js.map +1 -1
  219. package/types/app-deployer.mjs +3 -347
  220. package/types/app-deployer.mjs.map +1 -1
  221. package/types/app-factory.d.ts +21 -960
  222. package/types/app-factory.js +3 -442
  223. package/types/app-factory.js.map +1 -1
  224. package/types/app-factory.mjs +3 -442
  225. package/types/app-factory.mjs.map +1 -1
  226. package/types/app-manager.d.ts +15 -318
  227. package/types/app-manager.js +3 -462
  228. package/types/app-manager.js.map +1 -1
  229. package/types/app-manager.mjs +3 -462
  230. package/types/app-manager.mjs.map +1 -1
  231. package/types/app-spec.d.ts +39 -198
  232. package/types/app-spec.js +3 -131
  233. package/types/app-spec.js.map +1 -1
  234. package/types/app-spec.mjs +3 -131
  235. package/types/app-spec.mjs.map +1 -1
  236. package/types/app.d.ts +62 -247
  237. package/types/app.js +15 -37
  238. package/types/app.js.map +1 -1
  239. package/types/app.mjs +16 -37
  240. package/types/app.mjs.map +1 -1
  241. package/types/asset-manager.d.ts +9 -207
  242. package/types/asset-manager.js +3 -160
  243. package/types/asset-manager.js.map +1 -1
  244. package/types/asset-manager.mjs +3 -160
  245. package/types/asset-manager.mjs.map +1 -1
  246. package/types/async-event-emitter.d.ts +7 -11
  247. package/types/async-event-emitter.js +3 -32
  248. package/types/async-event-emitter.js.map +1 -1
  249. package/types/async-event-emitter.mjs +4 -32
  250. package/types/async-event-emitter.mjs.map +1 -1
  251. package/types/client-manager.d.ts +27 -470
  252. package/types/client-manager.js +3 -610
  253. package/types/client-manager.js.map +1 -1
  254. package/types/client-manager.mjs +3 -610
  255. package/types/client-manager.mjs.map +1 -1
  256. package/types/composer.d.ts +79 -943
  257. package/types/composer.js +3 -1578
  258. package/types/composer.js.map +1 -1
  259. package/types/composer.mjs +3 -1577
  260. package/types/composer.mjs.map +1 -1
  261. package/types/config.d.ts +7 -52
  262. package/types/config.js +3 -74
  263. package/types/config.js.map +1 -1
  264. package/types/config.mjs +3 -74
  265. package/types/config.mjs.map +1 -1
  266. package/types/debugging.d.ts +12 -37
  267. package/types/debugging.js +11 -10
  268. package/types/debugging.js.map +1 -1
  269. package/types/debugging.mjs +12 -10
  270. package/types/debugging.mjs.map +1 -1
  271. package/types/dispenser-client.d.ts +11 -85
  272. package/types/dispenser-client.js +3 -121
  273. package/types/dispenser-client.js.map +1 -1
  274. package/types/dispenser-client.mjs +3 -121
  275. package/types/dispenser-client.mjs.map +1 -1
  276. package/types/expand.d.ts +8 -2
  277. package/types/indexer.d.ts +16 -36
  278. package/types/indexer.js +7 -30
  279. package/types/indexer.js.map +1 -1
  280. package/types/indexer.mjs +8 -30
  281. package/types/indexer.mjs.map +1 -1
  282. package/types/instance-of.d.ts +4 -4
  283. package/types/kmd-account-manager.d.ts +5 -69
  284. package/types/kmd-account-manager.js +3 -161
  285. package/types/kmd-account-manager.js.map +1 -1
  286. package/types/kmd-account-manager.mjs +3 -159
  287. package/types/kmd-account-manager.mjs.map +1 -1
  288. package/types/lifecycle-events.d.ts +7 -9
  289. package/types/lifecycle-events.js +3 -5
  290. package/types/lifecycle-events.js.map +1 -1
  291. package/types/lifecycle-events.mjs +4 -5
  292. package/types/lifecycle-events.mjs.map +1 -1
  293. package/types/logging.d.ts +14 -9
  294. package/types/logging.js +11 -37
  295. package/types/logging.js.map +1 -1
  296. package/types/logging.mjs +12 -37
  297. package/types/logging.mjs.map +1 -1
  298. package/types/logic-error.d.ts +8 -35
  299. package/types/logic-error.js +3 -48
  300. package/types/logic-error.js.map +1 -1
  301. package/types/logic-error.mjs +4 -48
  302. package/types/logic-error.mjs.map +1 -1
  303. package/types/network-client.d.ts +10 -39
  304. package/types/network-client.js +3 -8
  305. package/types/network-client.js.map +1 -1
  306. package/types/network-client.mjs +4 -8
  307. package/types/network-client.mjs.map +1 -1
  308. package/types/testing.d.ts +13 -151
  309. package/types/transaction.d.ts +33 -128
  310. package/updatable-config.d.ts +57 -0
  311. package/updatable-config.js +80 -0
  312. package/updatable-config.js.map +1 -0
  313. package/updatable-config.mjs +80 -0
  314. package/updatable-config.mjs.map +1 -0
  315. package/util.js +1 -1
  316. package/util.js.map +1 -1
  317. package/util.mjs +1 -1
  318. package/util.mjs.map +1 -1
@@ -1,37 +1,8 @@
1
+ const require_async_event_emitter = require('../async-event-emitter.js');
1
2
 
2
3
  //#region src/types/async-event-emitter.ts
3
- var AsyncEventEmitter = class {
4
- listenerWrapperMap = /* @__PURE__ */ new WeakMap();
5
- listenerMap = {};
6
- async emitAsync(eventName, event) {
7
- for (const listener of this.listenerMap[eventName] ?? []) await listener(event, eventName);
8
- }
9
- on(eventName, listener) {
10
- if (!this.listenerMap[eventName]) this.listenerMap[eventName] = [];
11
- this.listenerMap[eventName].push(listener);
12
- return this;
13
- }
14
- once(eventName, listener) {
15
- const wrappedListener = async (event, eventName$1) => {
16
- try {
17
- return await listener(event, eventName$1);
18
- } finally {
19
- this.removeListener(eventName$1, wrappedListener);
20
- }
21
- };
22
- this.listenerWrapperMap.set(listener, wrappedListener);
23
- return this.on(eventName, wrappedListener);
24
- }
25
- removeListener(eventName, listener) {
26
- const wrappedListener = this.listenerWrapperMap.get(listener);
27
- if (wrappedListener) {
28
- this.listenerWrapperMap.delete(listener);
29
- if (this.listenerMap[eventName]?.indexOf(wrappedListener) !== -1) this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(wrappedListener), 1);
30
- } else if (this.listenerMap[eventName]?.indexOf(listener) !== -1) this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(listener), 1);
31
- return this;
32
- }
33
- off = this.removeListener;
34
- };
4
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */
5
+ const AsyncEventEmitter = require_async_event_emitter.AsyncEventEmitter;
35
6
 
36
7
  //#endregion
37
8
  exports.AsyncEventEmitter = AsyncEventEmitter;
@@ -1 +1 @@
1
- {"version":3,"file":"async-event-emitter.js","names":["wrappedListener: AsyncEventListener","eventName"],"sources":["../../src/types/async-event-emitter.ts"],"sourcesContent":["import { EventDataMap, EventType } from './lifecycle-events'\n\nexport type AsyncEventListener<T = unknown> = (event: T, eventName: string | symbol) => Promise<void> | void\n\nexport class AsyncEventEmitter {\n private listenerWrapperMap = new WeakMap<AsyncEventListener, AsyncEventListener>()\n private listenerMap: Record<string | symbol, AsyncEventListener[]> = {}\n\n async emitAsync<K extends string | symbol>(eventName: K, event: K extends EventType ? EventDataMap[K] : unknown): Promise<void> {\n for (const listener of this.listenerMap[eventName] ?? []) {\n await listener(event, eventName)\n }\n }\n\n on<K extends string | symbol>(\n eventName: K,\n listener: AsyncEventListener<K extends EventType ? EventDataMap[K] : unknown>,\n ): AsyncEventEmitter {\n if (!this.listenerMap[eventName]) this.listenerMap[eventName] = []\n this.listenerMap[eventName].push(listener as AsyncEventListener)\n return this\n }\n\n once<K extends string | symbol>(\n eventName: K,\n listener: AsyncEventListener<K extends EventType ? EventDataMap[K] : unknown>,\n ): AsyncEventEmitter {\n const wrappedListener: AsyncEventListener = async (event, eventName) => {\n try {\n return await (listener as AsyncEventListener)(event, eventName)\n } finally {\n this.removeListener(eventName, wrappedListener)\n }\n }\n this.listenerWrapperMap.set(listener as AsyncEventListener, wrappedListener)\n return this.on(eventName, wrappedListener as AsyncEventListener<K extends EventType ? EventDataMap[K] : unknown>)\n }\n\n removeListener(eventName: string | symbol, listener: AsyncEventListener): AsyncEventEmitter {\n const wrappedListener = this.listenerWrapperMap.get(listener)\n if (wrappedListener) {\n this.listenerWrapperMap.delete(listener)\n if (this.listenerMap[eventName]?.indexOf(wrappedListener) !== -1) {\n this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(wrappedListener), 1)\n }\n } else {\n if (this.listenerMap[eventName]?.indexOf(listener) !== -1) {\n this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(listener), 1)\n }\n }\n\n return this\n }\n\n off = this.removeListener\n}\n"],"mappings":";;AAIA,IAAa,oBAAb,MAA+B;CAC7B,AAAQ,qCAAqB,IAAI,SAAiD;CAClF,AAAQ,cAA6D,EAAE;CAEvE,MAAM,UAAqC,WAAc,OAAuE;AAC9H,OAAK,MAAM,YAAY,KAAK,YAAY,cAAc,EAAE,CACtD,OAAM,SAAS,OAAO,UAAU;;CAIpC,GACE,WACA,UACmB;AACnB,MAAI,CAAC,KAAK,YAAY,WAAY,MAAK,YAAY,aAAa,EAAE;AAClE,OAAK,YAAY,WAAW,KAAK,SAA+B;AAChE,SAAO;;CAGT,KACE,WACA,UACmB;EACnB,MAAMA,kBAAsC,OAAO,OAAO,gBAAc;AACtE,OAAI;AACF,WAAO,MAAO,SAAgC,OAAOC,YAAU;aACvD;AACR,SAAK,eAAeA,aAAW,gBAAgB;;;AAGnD,OAAK,mBAAmB,IAAI,UAAgC,gBAAgB;AAC5E,SAAO,KAAK,GAAG,WAAW,gBAAuF;;CAGnH,eAAe,WAA4B,UAAiD;EAC1F,MAAM,kBAAkB,KAAK,mBAAmB,IAAI,SAAS;AAC7D,MAAI,iBAAiB;AACnB,QAAK,mBAAmB,OAAO,SAAS;AACxC,OAAI,KAAK,YAAY,YAAY,QAAQ,gBAAgB,KAAK,GAC5D,MAAK,YAAY,WAAW,OAAO,KAAK,YAAY,WAAW,QAAQ,gBAAgB,EAAE,EAAE;aAGzF,KAAK,YAAY,YAAY,QAAQ,SAAS,KAAK,GACrD,MAAK,YAAY,WAAW,OAAO,KAAK,YAAY,WAAW,QAAQ,SAAS,EAAE,EAAE;AAIxF,SAAO;;CAGT,MAAM,KAAK"}
1
+ {"version":3,"file":"async-event-emitter.js","names":["_AsyncEventEmitter"],"sources":["../../src/types/async-event-emitter.ts"],"sourcesContent":["// Re-exports with deprecation notices for backwards compatibility\n// New imports should use '@algorandfoundation/algokit-utils/async-event-emitter'\n\nimport {\n type AsyncEventListener as _AsyncEventListener,\n AsyncEventEmitter as _AsyncEventEmitter,\n} from '../async-event-emitter'\n\n/** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */\nexport type AsyncEventListener<T = unknown> = _AsyncEventListener<T>\n\n/** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */\nexport const AsyncEventEmitter = _AsyncEventEmitter\n/** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */\nexport type AsyncEventEmitter = _AsyncEventEmitter\n"],"mappings":";;;;AAYA,MAAa,oBAAoBA"}
@@ -1,36 +1,8 @@
1
+ import { AsyncEventEmitter as AsyncEventEmitter$1 } from "../async-event-emitter.mjs";
2
+
1
3
  //#region src/types/async-event-emitter.ts
2
- var AsyncEventEmitter = class {
3
- listenerWrapperMap = /* @__PURE__ */ new WeakMap();
4
- listenerMap = {};
5
- async emitAsync(eventName, event) {
6
- for (const listener of this.listenerMap[eventName] ?? []) await listener(event, eventName);
7
- }
8
- on(eventName, listener) {
9
- if (!this.listenerMap[eventName]) this.listenerMap[eventName] = [];
10
- this.listenerMap[eventName].push(listener);
11
- return this;
12
- }
13
- once(eventName, listener) {
14
- const wrappedListener = async (event, eventName$1) => {
15
- try {
16
- return await listener(event, eventName$1);
17
- } finally {
18
- this.removeListener(eventName$1, wrappedListener);
19
- }
20
- };
21
- this.listenerWrapperMap.set(listener, wrappedListener);
22
- return this.on(eventName, wrappedListener);
23
- }
24
- removeListener(eventName, listener) {
25
- const wrappedListener = this.listenerWrapperMap.get(listener);
26
- if (wrappedListener) {
27
- this.listenerWrapperMap.delete(listener);
28
- if (this.listenerMap[eventName]?.indexOf(wrappedListener) !== -1) this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(wrappedListener), 1);
29
- } else if (this.listenerMap[eventName]?.indexOf(listener) !== -1) this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(listener), 1);
30
- return this;
31
- }
32
- off = this.removeListener;
33
- };
4
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */
5
+ const AsyncEventEmitter = AsyncEventEmitter$1;
34
6
 
35
7
  //#endregion
36
8
  export { AsyncEventEmitter };
@@ -1 +1 @@
1
- {"version":3,"file":"async-event-emitter.mjs","names":["wrappedListener: AsyncEventListener","eventName"],"sources":["../../src/types/async-event-emitter.ts"],"sourcesContent":["import { EventDataMap, EventType } from './lifecycle-events'\n\nexport type AsyncEventListener<T = unknown> = (event: T, eventName: string | symbol) => Promise<void> | void\n\nexport class AsyncEventEmitter {\n private listenerWrapperMap = new WeakMap<AsyncEventListener, AsyncEventListener>()\n private listenerMap: Record<string | symbol, AsyncEventListener[]> = {}\n\n async emitAsync<K extends string | symbol>(eventName: K, event: K extends EventType ? EventDataMap[K] : unknown): Promise<void> {\n for (const listener of this.listenerMap[eventName] ?? []) {\n await listener(event, eventName)\n }\n }\n\n on<K extends string | symbol>(\n eventName: K,\n listener: AsyncEventListener<K extends EventType ? EventDataMap[K] : unknown>,\n ): AsyncEventEmitter {\n if (!this.listenerMap[eventName]) this.listenerMap[eventName] = []\n this.listenerMap[eventName].push(listener as AsyncEventListener)\n return this\n }\n\n once<K extends string | symbol>(\n eventName: K,\n listener: AsyncEventListener<K extends EventType ? EventDataMap[K] : unknown>,\n ): AsyncEventEmitter {\n const wrappedListener: AsyncEventListener = async (event, eventName) => {\n try {\n return await (listener as AsyncEventListener)(event, eventName)\n } finally {\n this.removeListener(eventName, wrappedListener)\n }\n }\n this.listenerWrapperMap.set(listener as AsyncEventListener, wrappedListener)\n return this.on(eventName, wrappedListener as AsyncEventListener<K extends EventType ? EventDataMap[K] : unknown>)\n }\n\n removeListener(eventName: string | symbol, listener: AsyncEventListener): AsyncEventEmitter {\n const wrappedListener = this.listenerWrapperMap.get(listener)\n if (wrappedListener) {\n this.listenerWrapperMap.delete(listener)\n if (this.listenerMap[eventName]?.indexOf(wrappedListener) !== -1) {\n this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(wrappedListener), 1)\n }\n } else {\n if (this.listenerMap[eventName]?.indexOf(listener) !== -1) {\n this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(listener), 1)\n }\n }\n\n return this\n }\n\n off = this.removeListener\n}\n"],"mappings":";AAIA,IAAa,oBAAb,MAA+B;CAC7B,AAAQ,qCAAqB,IAAI,SAAiD;CAClF,AAAQ,cAA6D,EAAE;CAEvE,MAAM,UAAqC,WAAc,OAAuE;AAC9H,OAAK,MAAM,YAAY,KAAK,YAAY,cAAc,EAAE,CACtD,OAAM,SAAS,OAAO,UAAU;;CAIpC,GACE,WACA,UACmB;AACnB,MAAI,CAAC,KAAK,YAAY,WAAY,MAAK,YAAY,aAAa,EAAE;AAClE,OAAK,YAAY,WAAW,KAAK,SAA+B;AAChE,SAAO;;CAGT,KACE,WACA,UACmB;EACnB,MAAMA,kBAAsC,OAAO,OAAO,gBAAc;AACtE,OAAI;AACF,WAAO,MAAO,SAAgC,OAAOC,YAAU;aACvD;AACR,SAAK,eAAeA,aAAW,gBAAgB;;;AAGnD,OAAK,mBAAmB,IAAI,UAAgC,gBAAgB;AAC5E,SAAO,KAAK,GAAG,WAAW,gBAAuF;;CAGnH,eAAe,WAA4B,UAAiD;EAC1F,MAAM,kBAAkB,KAAK,mBAAmB,IAAI,SAAS;AAC7D,MAAI,iBAAiB;AACnB,QAAK,mBAAmB,OAAO,SAAS;AACxC,OAAI,KAAK,YAAY,YAAY,QAAQ,gBAAgB,KAAK,GAC5D,MAAK,YAAY,WAAW,OAAO,KAAK,YAAY,WAAW,QAAQ,gBAAgB,EAAE,EAAE;aAGzF,KAAK,YAAY,YAAY,QAAQ,SAAS,KAAK,GACrD,MAAK,YAAY,WAAW,OAAO,KAAK,YAAY,WAAW,QAAQ,SAAS,EAAE,EAAE;AAIxF,SAAO;;CAGT,MAAM,KAAK"}
1
+ {"version":3,"file":"async-event-emitter.mjs","names":["_AsyncEventEmitter"],"sources":["../../src/types/async-event-emitter.ts"],"sourcesContent":["// Re-exports with deprecation notices for backwards compatibility\n// New imports should use '@algorandfoundation/algokit-utils/async-event-emitter'\n\nimport {\n type AsyncEventListener as _AsyncEventListener,\n AsyncEventEmitter as _AsyncEventEmitter,\n} from '../async-event-emitter'\n\n/** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */\nexport type AsyncEventListener<T = unknown> = _AsyncEventListener<T>\n\n/** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */\nexport const AsyncEventEmitter = _AsyncEventEmitter\n/** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */\nexport type AsyncEventEmitter = _AsyncEventEmitter\n"],"mappings":";;;;AAYA,MAAa,oBAAoBA"}
@@ -1,475 +1,32 @@
1
- import { Expand } from "../packages/common/src/expand.js";
2
- import { AlgodClient } from "../packages/algod_client/src/client.js";
3
- import { IndexerClient } from "../packages/indexer_client/src/client.js";
4
- import { KmdClient } from "../packages/kmd_client/src/client.js";
5
- import { AppClient, AppClientParams, ResolveAppClientByCreatorAndName } from "./app-client.js";
6
- import { AppFactory, AppFactoryParams } from "./app-factory.js";
7
- import { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from "./dispenser-client.js";
8
- import { AlgoClientConfig, AlgoConfig, NetworkDetails } from "./network-client.js";
9
- import { AlgorandClient } from "./algorand-client.js";
1
+ import { AlgoSdkClients as AlgoSdkClients$1, ClientAppClientByNetworkParams as ClientAppClientByNetworkParams$1, ClientAppClientParams as ClientAppClientParams$1, ClientAppFactoryParams as ClientAppFactoryParams$1, ClientManager as ClientManager$1, ClientResolveAppClientByCreatorAndNameParams as ClientResolveAppClientByCreatorAndNameParams$1, ClientTypedAppClientByCreatorAndNameParams as ClientTypedAppClientByCreatorAndNameParams$1, ClientTypedAppClientByNetworkParams as ClientTypedAppClientByNetworkParams$1, ClientTypedAppClientParams as ClientTypedAppClientParams$1, ClientTypedAppFactoryParams as ClientTypedAppFactoryParams$1, TypedAppClient as TypedAppClient$1, TypedAppFactory as TypedAppFactory$1 } from "../client-manager.js";
10
2
 
11
3
  //#region src/types/client-manager.d.ts
12
- /** Clients from algosdk that interact with the official Algorand APIs */
13
- interface AlgoSdkClients {
14
- /** Algod client, see https://dev.algorand.co/reference/rest-apis/algod/ */
15
- algod: AlgodClient;
16
- /** Optional indexer client, see https://dev.algorand.co/reference/rest-apis/indexer */
17
- indexer?: IndexerClient;
18
- /** Optional KMD client, see https://dev.algorand.co/reference/rest-apis/kmd/ */
19
- kmd?: KmdClient;
20
- }
21
- /** Params to get an app factory from `ClientManager`. */
22
- type ClientAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand'>>;
23
- /** Params to get an app client by creator address and name from `ClientManager`. */
24
- type ClientResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand'>>;
25
- /** Params to get an app client by ID from `ClientManager`. */
26
- type ClientAppClientParams = Expand<Omit<AppClientParams, 'algorand'>>;
27
- /** Params to get an app client by network from `ClientManager`. */
28
- type ClientAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appId'>>;
29
- /** Params to get a typed app client by creator address and name from `ClientManager`. */
30
- type ClientTypedAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>;
31
- /** Params to get a typed app client by ID from `ClientManager`. */
32
- type ClientTypedAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>;
33
- /** Params to get a typed app client by network from `ClientManager`. */
34
- type ClientTypedAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec' | 'appId'>>;
35
- /** Params to get a typed app factory from `ClientManager`. */
36
- type ClientTypedAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand' | 'appSpec'>>;
37
- /** Exposes access to various API clients. */
38
- declare class ClientManager {
39
- private _algod;
40
- private _indexer?;
41
- private _kmd?;
42
- private _algorand?;
43
- /**
44
- * algosdk clients or config for interacting with the official Algorand APIs.
45
- * @param clientsOrConfig The clients or config to use
46
- * @example Algod client only
47
- * ```typescript
48
- * const clientManager = new ClientManager({ algod: algodClient })
49
- * ```
50
- * @example All clients
51
- * ```typescript
52
- * const clientManager = new ClientManager({ algod: algodClient, indexer: indexerClient, kmd: kmdClient })
53
- * ```
54
- * @example Algod config only
55
- * ```typescript
56
- * const clientManager = new ClientManager({ algodConfig })
57
- * ```
58
- * @example All client configs
59
- * ```typescript
60
- * const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })
61
- * ```
62
- */
63
- constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClient);
64
- /**
65
- * Returns an Algod API client.
66
- * @returns The Algod client
67
- */
68
- get algod(): AlgodClient;
69
- /**
70
- * Returns an Indexer API client or throws an error if it's not been provided.
71
- * @returns The Indexer client
72
- * @throws Error if no Indexer client is configured
73
- */
74
- get indexer(): IndexerClient;
75
- /**
76
- * Returns an Indexer API client or `undefined` if it's not been provided.
77
- * @returns The Indexer client or `undefined`
78
- */
79
- get indexerIfPresent(): IndexerClient | undefined;
80
- /**
81
- * Returns a KMD API client or throws an error if it's not been provided.
82
- * @returns The KMD client
83
- * @throws Error if no KMD client is configured
84
- */
85
- get kmd(): KmdClient;
86
- private _getNetworkPromise;
87
- /**
88
- * Get details about the current network.
89
- * @example Getting genesis ID
90
- * ```typescript
91
- * const network = await networkClient.network()
92
- * const genesisId = network.genesisId
93
- * ```
94
- * @returns The current network details
95
- */
96
- network(): Promise<NetworkDetails>;
97
- /**
98
- * Returns true if the given network genesisId is associated with a LocalNet network.
99
- * @param genesisId The network genesis ID
100
- * @returns Whether the given genesis ID is associated with a LocalNet network
101
- * @example
102
- * ```typescript
103
- * const isLocalNet = ClientManager.genesisIdIsLocalNet('testnet-v1.0')
104
- * ```
105
- */
106
- static genesisIdIsLocalNet(genesisId: string): boolean;
107
- /**
108
- * Returns true if the current network is LocalNet.
109
- * @returns True if the current network is LocalNet.
110
- * @example
111
- * ```typescript
112
- * const isLocalNet = await clientManager.isLocalNet()
113
- * ```
114
- */
115
- isLocalNet(): Promise<boolean>;
116
- /**
117
- * Returns true if the current network is TestNet.
118
- * @returns True if the current network is TestNet.
119
- * @example
120
- * ```typescript
121
- * const isTestNet = await clientManager.isTestNet()
122
- * ```
123
- */
124
- isTestNet(): Promise<boolean>;
125
- /**
126
- * Returns true if the current network is MainNet.
127
- * @returns True if the current network is MainNet.
128
- * @example
129
- * ```typescript
130
- * const isMainNet = await clientManager.isMainNet()
131
- * ```
132
- */
133
- isMainNet(): Promise<boolean>;
134
- /**
135
- * Returns a TestNet Dispenser API client.
136
- *
137
- * Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.
138
- *
139
- * @param params An object containing parameters for the TestNetDispenserApiClient class.
140
- * @example
141
- * const client = clientManager.getTestNetDispenser(
142
- * {
143
- * authToken: 'your_auth_token',
144
- * requestTimeout: 15,
145
- * }
146
- * )
147
- *
148
- * @returns An instance of the TestNetDispenserApiClient class.
149
- */
150
- getTestNetDispenser(params: TestNetDispenserApiClientParams): TestNetDispenserApiClient;
151
- /**
152
- * Returns a TestNet Dispenser API client, loading the auth token from `process.env.ALGOKIT_DISPENSER_ACCESS_TOKEN`.
153
- *
154
- * Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.
155
- *
156
- * @param params An object containing parameters for the TestNetDispenserApiClient class.
157
- * @example
158
- * const client = clientManager.getTestNetDispenserFromEnvironment(
159
- * {
160
- * requestTimeout: 15,
161
- * }
162
- * )
163
- *
164
- * @returns An instance of the TestNetDispenserApiClient class.
165
- */
166
- getTestNetDispenserFromEnvironment(params?: Omit<TestNetDispenserApiClientParams, 'authToken'>): TestNetDispenserApiClient;
167
- /**
168
- * Returns a new `AppFactory` client
169
- * @param params The parameters to create the app factory
170
- * @example Basic example
171
- * ```typescript
172
- * const factory = clientManager.getAppFactory({
173
- * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}',
174
- * })
175
- * ```
176
- * @example Advanced example
177
- * ```typescript
178
- * const factory = clientManager.getAppFactory({
179
- * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,
180
- * defaultSender: "SENDERADDRESS",
181
- * appName: "OverriddenAppName",
182
- * version: "2.0.0",
183
- * updatable: true,
184
- * deletable: false,
185
- * deployTimeParams: { ONE: 1, TWO: 'value' }
186
- * })
187
- * ```
188
- * @returns The `AppFactory` instance
189
- */
190
- getAppFactory(params: ClientAppFactoryParams): AppFactory;
191
- /**
192
- * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
193
- * This method resolves the app ID by looking up the creator address and name
194
- * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
195
- * @param params The parameters to create the app client
196
- * @example Basic
197
- * ```typescript
198
- * const appClient = clientManager.getAppClientByCreatorAndName({
199
- * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
200
- * // appId resolved by looking for app ID of named app by this creator
201
- * creatorAddress: 'CREATORADDRESS',
202
- * })
203
- * ```
204
- * @returns The `AppClient` instance
205
- */
206
- getAppClientByCreatorAndName(params: ClientResolveAppClientByCreatorAndNameParams): Promise<AppClient>;
207
- /**
208
- * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
209
- * @param params The parameters to create the app client
210
- * @example Basic
211
- * ```typescript
212
- * const appClient = clientManager.getAppClientById({
213
- * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
214
- * appId: 12345n,
215
- * })
216
- * ```
217
- * @returns The `AppClient` instance
218
- */
219
- getAppClientById(params: ClientAppClientParams): AppClient;
220
- /**
221
- * Returns a new `AppClient` client for managing calls and state for an ARC-56 app.
222
- * This method resolves the app ID for the current network based on
223
- * pre-determined network-specific app IDs specified in the ARC-56 app spec.
224
- *
225
- * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
226
- * @param params The parameters to create the app client
227
- * @example Basic
228
- * ```typescript
229
- * const appClient = clientManager.getAppClientByNetwork({
230
- * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
231
- * // appId resolved by using ARC-56 spec to find app ID for current network
232
- * })
233
- * ```
234
- * @returns The `AppClient` instance
235
- */
236
- getAppClientByNetwork(params: ClientAppClientByNetworkParams): Promise<AppClient>;
237
- /**
238
- * Returns a new typed client, resolving the app by creator address and name.
239
- * @param typedClient The typed client type to use
240
- * @param params The params to resolve the app by creator address and name
241
- * @example Use name in ARC-32 / ARC-56 app spec
242
- * ```typescript
243
- * const appClient = clientManager.getTypedAppClientByCreatorAndName(MyContractClient, {
244
- * creatorAddress: "CREATORADDRESS",
245
- * defaultSender: alice,
246
- * })
247
- * ```
248
- * @example Specify name
249
- * ```typescript
250
- * const appClient = clientManager.getTypedAppClientByCreatorAndName(MyContractClient, {
251
- * creatorAddress: "CREATORADDRESS",
252
- * name: "contract-name",
253
- * defaultSender: alice,
254
- * })
255
- * ```
256
- * @returns The typed client instance
257
- */
258
- getTypedAppClientByCreatorAndName<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params: ClientTypedAppClientByCreatorAndNameParams): Promise<InstanceType<TClient>>;
259
- /**
260
- * Returns a new typed client, resolving the app by app ID.
261
- * @param typedClient The typed client type to use
262
- * @param params The params to resolve the app by ID
263
- * @example
264
- * ```typescript
265
- * const appClient = clientManager.getTypedAppClientById(MyContractClient, {
266
- * appId: 12345n,
267
- * defaultSender: alice,
268
- * })
269
- * ```
270
- * @returns The typed client instance
271
- */
272
- getTypedAppClientById<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params: ClientTypedAppClientParams): InstanceType<TClient>;
273
- /**
274
- * Returns a new typed client, resolves the app ID for the current network based on
275
- * pre-determined network-specific app IDs specified in the ARC-56 app spec.
276
- *
277
- * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
278
- * @param typedClient The typed client type to use
279
- * @param params The params to resolve the app by network
280
- * @example
281
- * ```typescript
282
- * const appClient = clientManager.getTypedAppClientByNetwork(MyContractClient, {
283
- * defaultSender: alice,
284
- * })
285
- * ```
286
- * @returns The typed client instance
287
- */
288
- getTypedAppClientByNetwork<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params?: ClientTypedAppClientByNetworkParams): Promise<InstanceType<TClient>>;
289
- /**
290
- * Returns a new typed app factory.
291
- * @param typedFactory The typed factory type to use
292
- * @param params The params to resolve the factory by
293
- * @example
294
- * ```typescript
295
- * const appFactory = clientManager.getTypedAppFactory(MyContractClient, {
296
- * sender: alice,
297
- * })
298
- * ```
299
- * @returns The typed client instance
300
- */
301
- getTypedAppFactory<TClient>(typedFactory: TypedAppFactory<TClient>, params?: ClientTypedAppFactoryParams): TClient;
302
- /**
303
- * Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)
304
- *
305
- * If both `process.env.INDEXER_SERVER` and `process.env.ALGOD_SERVER` is defined it will use both along with optional `process.env.ALGOD_PORT`, `process.env.ALGOD_TOKEN`, `process.env.INDEXER_PORT` and `process.env.INDEXER_TOKEN`.
306
- *
307
- * If only `process.env.ALGOD_SERVER` is defined it will use this along with optional `process.env.ALGOD_PORT` and `process.env.ALGOD_TOKEN` and leave indexer as `undefined`.
308
- *
309
- * If only `process.env.INDEXER_SERVER` is defined it will use the default (LocalNet) configuration for both algod and indexer.
310
- *
311
- * It will return a KMD configuration that uses `process.env.KMD_PORT` (or port 4002) if `process.env.ALGOD_SERVER` is defined,
312
- * otherwise it will use the default LocalNet config unless it detects testnet or mainnet.
313
- * @example
314
- * ```typescript
315
- * const config = ClientManager.getConfigFromEnvironmentOrLocalNet()
316
- * ```
317
- * @returns The config for algod, indexer and kmd
318
- */
319
- static getConfigFromEnvironmentOrLocalNet(): AlgoConfig;
320
- /**
321
- * Retrieve the algod configuration from environment variables (expects to be called from a Node.js environment)
322
- *
323
- * Expects `process.env.ALGOD_SERVER` to be defined, and you can also specify `process.env.ALGOD_PORT` and `process.env.ALGOD_TOKEN`.
324
- * @returns The Algod client configuration
325
- * @throws Error if `process.env.ALGOD_SERVER` is not defined
326
- * @example
327
- * ```typescript
328
- * const config = ClientManager.getAlgodConfigFromEnvironment()
329
- * ```
330
- */
331
- static getAlgodConfigFromEnvironment(): AlgoClientConfig;
332
- /**
333
- * Retrieve the indexer configuration from environment variables (expects to be called from a Node.js environment).
334
- *
335
- * Expects `process.env.INDEXER_SERVER` to be defined, and you can also specify `process.env.INDEXER_PORT` and `process.env.INDEXER_TOKEN`.
336
- * @returns The Indexer client configuration
337
- * @throws Error if `process.env.INDEXER_SERVER` is not defined
338
- * @example
339
- * ```typescript
340
- * const config = ClientManager.getIndexerConfigFromEnvironment()
341
- * ```
342
- */
343
- static getIndexerConfigFromEnvironment(): AlgoClientConfig;
344
- /** Returns the Algorand configuration to point to the free tier of the AlgoNode service.
345
- *
346
- * @param network Which network to connect to - TestNet or MainNet
347
- * @param config Which algod config to return - Algod or Indexer
348
- * @returns The AlgoNode client configuration
349
- * @example
350
- * ```typescript
351
- * const config = ClientManager.getAlgoNodeConfig('testnet', 'algod')
352
- * ```
353
- */
354
- static getAlgoNodeConfig(network: 'testnet' | 'mainnet', config: 'algod' | 'indexer'): AlgoClientConfig;
355
- /** Returns the Algorand configuration to point to the default LocalNet.
356
- *
357
- * @param configOrPort Which algod config to return - algod, kmd, or indexer OR a port number
358
- * @returns The LocalNet client configuration
359
- * @example
360
- * ```typescript
361
- * const config = ClientManager.getDefaultLocalNetConfig('algod')
362
- * ```
363
- */
364
- static getDefaultLocalNetConfig(configOrPort: 'algod' | 'indexer' | 'kmd' | number): AlgoClientConfig;
365
- /**
366
- * Returns an algod SDK client that automatically retries on idempotent calls.
367
- *
368
- * @param config The config of the client
369
- * @returns The Algod client
370
- * @example AlgoNode (testnet)
371
- * ```typescript
372
- * const algod = ClientManager.getAlgodClient(ClientManager.getAlgoNodeConfig('testnet', 'algod'))
373
- * await algod.healthCheck().do()
374
- * ```
375
- * @example AlgoNode (mainnet)
376
- * ```typescript
377
- * const algod = ClientManager.getAlgodClient(ClientManager.getAlgoNodeConfig('mainnet', 'algod'))
378
- * await algod.healthCheck().do()
379
- * ```
380
- * @example Custom (e.g. default LocalNet)
381
- * ```typescript
382
- * const algod = ClientManager.getAlgodClient({server: 'http://localhost', port: '4001', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})
383
- * await algod.healthCheck().do()
384
- * ```
385
- */
386
- static getAlgodClient(config: AlgoClientConfig): AlgodClient;
387
- /**
388
- * Returns an algod SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
389
- *
390
- * @returns The Algod client
391
- * @example
392
- * ```typescript
393
- * // Uses process.env.ALGOD_SERVER, process.env.ALGOD_PORT and process.env.ALGOD_TOKEN
394
- * const algod = ClientManager.getAlgodClientFromEnvironment()
395
- * await algod.healthCheck().do()
396
- * ```
397
- */
398
- static getAlgodClientFromEnvironment(): AlgodClient;
399
- /**
400
- * Returns an indexer SDK client that automatically retries on idempotent calls
401
- *
402
- * @param config The config of the client
403
- * @returns The Indexer client
404
- * @example AlgoNode (testnet)
405
- * ```typescript
406
- * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('testnet', 'indexer'))
407
- * await indexer.makeHealthCheck().do()
408
- * ```
409
- * @example AlgoNode (mainnet)
410
- * ```typescript
411
- * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('mainnet', 'indexer'))
412
- * await indexer.makeHealthCheck().do()
413
- * ```
414
- * @example Custom (e.g. default LocalNet, although we recommend loading this into a .env and using the Default option instead)
415
- * ```typescript
416
- * const indexer = ClientManager.getIndexerClient({server: 'http://localhost', port: '8980', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})
417
- * await indexer.makeHealthCheck().do()
418
- * ```
419
- */
420
- static getIndexerClient(config: AlgoClientConfig): IndexerClient;
421
- /**
422
- * Returns an indexer SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
423
- *
424
- * @returns The Indexer client
425
- * @example
426
- *
427
- * ```typescript
428
- * // Uses process.env.INDEXER_SERVER, process.env.INDEXER_PORT and process.env.INDEXER_TOKEN
429
- * const indexer = ClientManager.getIndexerClientFromEnvironment()
430
- * await indexer.makeHealthCheck().do()
431
- * ```
432
- */
433
- static getIndexerClientFromEnvironment(): IndexerClient;
434
- /**
435
- * Returns a KMD SDK client.
436
- *
437
- * KMD client allows you to export private keys, which is useful to (for instance) get the default account in a LocalNet network.
438
- *
439
- * @param config The config for the client
440
- * @returns The KMD client
441
- * @example Custom (e.g. default LocalNet, although we recommend loading this into a .env and using the Default option instead)
442
- * ```typescript
443
- * const kmd = ClientManager.getKmdClient({server: 'http://localhost', port: '4002', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})
444
- * ```
445
- */
446
- static getKmdClient(config: AlgoClientConfig): KmdClient;
447
- /**
448
- * Returns a KMD SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
449
- *
450
- * @returns The KMD client
451
- * @example
452
- * ```typescript
453
- * // Uses process.env.ALGOD_SERVER, process.env.KMD_PORT (or if not specified: port 4002) and process.env.ALGOD_TOKEN
454
- * const kmd = ClientManager.getKmdClientFromEnvironment()
455
- * ```
456
- */
457
- static getKmdClientFromEnvironment(): KmdClient;
458
- }
459
- /**
460
- * Interface to identify a typed client that can be used to interact with an application.
461
- */
462
- interface TypedAppClient<TClient> {
463
- new (params: Omit<AppClientParams, 'appSpec'>): TClient;
464
- fromNetwork(params: Omit<AppClientParams, 'appId' | 'appSpec'>): Promise<TClient>;
465
- fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<TClient>;
466
- }
467
- /**
468
- * Interface to identify a typed factory that can be used to create and deploy an application.
469
- */
470
- interface TypedAppFactory<TClient> {
471
- new (params: Omit<AppFactoryParams, 'appSpec'>): TClient;
472
- }
4
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
5
+ type AlgoSdkClients = AlgoSdkClients$1;
6
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
7
+ type ClientAppFactoryParams = ClientAppFactoryParams$1;
8
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
9
+ type ClientResolveAppClientByCreatorAndNameParams = ClientResolveAppClientByCreatorAndNameParams$1;
10
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
11
+ type ClientAppClientParams = ClientAppClientParams$1;
12
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
13
+ type ClientAppClientByNetworkParams = ClientAppClientByNetworkParams$1;
14
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
15
+ type ClientTypedAppClientByCreatorAndNameParams = ClientTypedAppClientByCreatorAndNameParams$1;
16
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
17
+ type ClientTypedAppClientParams = ClientTypedAppClientParams$1;
18
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
19
+ type ClientTypedAppClientByNetworkParams = ClientTypedAppClientByNetworkParams$1;
20
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
21
+ type ClientTypedAppFactoryParams = ClientTypedAppFactoryParams$1;
22
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
23
+ type TypedAppClient<TClient> = TypedAppClient$1<TClient>;
24
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
25
+ type TypedAppFactory<TClient> = TypedAppFactory$1<TClient>;
26
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
27
+ declare const ClientManager: typeof ClientManager$1;
28
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/client-manager` instead */
29
+ type ClientManager = ClientManager$1;
473
30
  //#endregion
474
31
  export { AlgoSdkClients, ClientAppClientByNetworkParams, ClientAppClientParams, ClientAppFactoryParams, ClientManager, ClientResolveAppClientByCreatorAndNameParams, ClientTypedAppClientByCreatorAndNameParams, ClientTypedAppClientByNetworkParams, ClientTypedAppClientParams, ClientTypedAppFactoryParams, TypedAppClient, TypedAppFactory };
475
32
  //# sourceMappingURL=client-manager.d.ts.map