@algorandfoundation/algokit-utils 7.0.0-beta.2 → 7.0.0-beta.20

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 (352) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -25
  3. package/account/account.d.ts +1 -2
  4. package/account/account.js +6 -4
  5. package/account/account.js.map +1 -1
  6. package/account/account.mjs +6 -4
  7. package/account/account.mjs.map +1 -1
  8. package/account/get-account-config-from-environment.d.ts +0 -1
  9. package/account/get-account-config-from-environment.js.map +1 -1
  10. package/account/get-account-config-from-environment.mjs.map +1 -1
  11. package/account/get-account.d.ts +0 -1
  12. package/account/get-account.js.map +1 -1
  13. package/account/get-account.mjs.map +1 -1
  14. package/account/get-dispenser-account.d.ts +0 -1
  15. package/account/get-dispenser-account.js.map +1 -1
  16. package/account/get-dispenser-account.mjs.map +1 -1
  17. package/account/index.d.ts +0 -1
  18. package/account/mnemonic-account.d.ts +0 -1
  19. package/account/mnemonic-account.js.map +1 -1
  20. package/account/mnemonic-account.mjs.map +1 -1
  21. package/amount.d.ts +14 -5
  22. package/amount.js +6 -0
  23. package/amount.js.map +1 -1
  24. package/amount.mjs +6 -0
  25. package/amount.mjs.map +1 -1
  26. package/app-client.d.ts +15 -1
  27. package/app-client.js +15 -0
  28. package/app-client.js.map +1 -1
  29. package/app-client.mjs +15 -0
  30. package/app-client.mjs.map +1 -1
  31. package/app-deploy.d.ts +0 -1
  32. package/app-deploy.js +4 -6
  33. package/app-deploy.js.map +1 -1
  34. package/app-deploy.mjs +7 -9
  35. package/app-deploy.mjs.map +1 -1
  36. package/app.d.ts +10 -11
  37. package/app.js +15 -11
  38. package/app.js.map +1 -1
  39. package/app.mjs +15 -11
  40. package/app.mjs.map +1 -1
  41. package/asset.d.ts +3 -4
  42. package/asset.js +3 -6
  43. package/asset.js.map +1 -1
  44. package/asset.mjs +3 -6
  45. package/asset.mjs.map +1 -1
  46. package/config.d.ts +0 -1
  47. package/config.js.map +1 -1
  48. package/config.mjs.map +1 -1
  49. package/debugging/debugging.d.ts +3 -5
  50. package/debugging/debugging.js +4 -128
  51. package/debugging/debugging.js.map +1 -1
  52. package/debugging/debugging.mjs +4 -109
  53. package/debugging/debugging.mjs.map +1 -1
  54. package/debugging/index.d.ts +0 -2
  55. package/dispenser-client.d.ts +0 -1
  56. package/dispenser-client.js.map +1 -1
  57. package/dispenser-client.mjs.map +1 -1
  58. package/index.d.ts +6 -5
  59. package/index.js +48 -38
  60. package/index.js.map +1 -1
  61. package/index.mjs +6 -5
  62. package/index.mjs.map +1 -1
  63. package/indexer-lookup.d.ts +0 -1
  64. package/indexer-lookup.js.map +1 -1
  65. package/indexer-lookup.mjs.map +1 -1
  66. package/localnet/get-kmd-wallet-account.d.ts +0 -1
  67. package/localnet/get-kmd-wallet-account.js.map +1 -1
  68. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  69. package/localnet/get-localnet-dispenser-account.d.ts +0 -1
  70. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  71. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  72. package/localnet/get-or-create-kmd-wallet-account.d.ts +0 -1
  73. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  74. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  75. package/localnet/index.d.ts +0 -1
  76. package/localnet/is-localnet.d.ts +0 -1
  77. package/localnet/is-localnet.js.map +1 -1
  78. package/localnet/is-localnet.mjs.map +1 -1
  79. package/network-client.d.ts +0 -1
  80. package/network-client.js.map +1 -1
  81. package/network-client.mjs.map +1 -1
  82. package/package.json +2 -2
  83. package/testing/_asset.d.ts +0 -1
  84. package/testing/account.d.ts +0 -1
  85. package/testing/account.js.map +1 -1
  86. package/testing/account.mjs.map +1 -1
  87. package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
  88. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  89. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  90. package/testing/fixtures/algorand-fixture.d.ts +0 -1
  91. package/testing/fixtures/algorand-fixture.js +1 -1
  92. package/testing/fixtures/algorand-fixture.js.map +1 -1
  93. package/testing/fixtures/algorand-fixture.mjs +1 -1
  94. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  95. package/testing/fixtures/index.d.ts +0 -1
  96. package/testing/index.d.ts +0 -1
  97. package/testing/indexer.d.ts +0 -1
  98. package/testing/indexer.js.map +1 -1
  99. package/testing/indexer.mjs.map +1 -1
  100. package/testing/test-logger.d.ts +0 -1
  101. package/testing/test-logger.js +1 -3
  102. package/testing/test-logger.js.map +1 -1
  103. package/testing/test-logger.mjs +1 -3
  104. package/testing/test-logger.mjs.map +1 -1
  105. package/testing/transaction-logger.d.ts +0 -1
  106. package/testing/transaction-logger.js.map +1 -1
  107. package/testing/transaction-logger.mjs.map +1 -1
  108. package/transaction/index.d.ts +0 -1
  109. package/transaction/legacy-bridge.d.ts +5 -6
  110. package/transaction/legacy-bridge.js +1 -1
  111. package/transaction/legacy-bridge.js.map +1 -1
  112. package/transaction/legacy-bridge.mjs +4 -4
  113. package/transaction/legacy-bridge.mjs.map +1 -1
  114. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +0 -1
  115. package/transaction/perform-atomic-transaction-composer-simulate.js +1 -0
  116. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  117. package/transaction/perform-atomic-transaction-composer-simulate.mjs +1 -0
  118. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  119. package/transaction/transaction.d.ts +41 -6
  120. package/transaction/transaction.js +113 -61
  121. package/transaction/transaction.js.map +1 -1
  122. package/transaction/transaction.mjs +113 -62
  123. package/transaction/transaction.mjs.map +1 -1
  124. package/transfer/index.d.ts +0 -1
  125. package/transfer/transfer-algos.d.ts +1 -2
  126. package/transfer/transfer-algos.js +1 -1
  127. package/transfer/transfer-algos.js.map +1 -1
  128. package/transfer/transfer-algos.mjs +1 -1
  129. package/transfer/transfer-algos.mjs.map +1 -1
  130. package/transfer/transfer.d.ts +1 -2
  131. package/transfer/transfer.js +3 -3
  132. package/transfer/transfer.js.map +1 -1
  133. package/transfer/transfer.mjs +3 -3
  134. package/transfer/transfer.mjs.map +1 -1
  135. package/types/account-manager.d.ts +15 -7
  136. package/types/account-manager.js +27 -11
  137. package/types/account-manager.js.map +1 -1
  138. package/types/account-manager.mjs +29 -13
  139. package/types/account-manager.mjs.map +1 -1
  140. package/types/account.d.ts +9 -1
  141. package/types/account.js.map +1 -1
  142. package/types/account.mjs.map +1 -1
  143. package/types/algo-http-client-with-retry.d.ts +0 -1
  144. package/types/algo-http-client-with-retry.js.map +1 -1
  145. package/types/algo-http-client-with-retry.mjs.map +1 -1
  146. package/types/algorand-client-interface.d.ts +28 -0
  147. package/types/algorand-client-interface.js +3 -0
  148. package/types/algorand-client-interface.js.map +1 -0
  149. package/types/algorand-client-interface.mjs +2 -0
  150. package/types/algorand-client-interface.mjs.map +1 -0
  151. package/types/algorand-client-transaction-creator.d.ts +33 -34
  152. package/types/algorand-client-transaction-creator.js +31 -31
  153. package/types/algorand-client-transaction-creator.js.map +1 -1
  154. package/types/algorand-client-transaction-creator.mjs +31 -31
  155. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  156. package/types/algorand-client-transaction-sender.d.ts +31 -32
  157. package/types/algorand-client-transaction-sender.js +25 -9
  158. package/types/algorand-client-transaction-sender.js.map +1 -1
  159. package/types/algorand-client-transaction-sender.mjs +25 -9
  160. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  161. package/types/algorand-client.d.ts +13 -13
  162. package/types/algorand-client.js +10 -10
  163. package/types/algorand-client.js.map +1 -1
  164. package/types/algorand-client.mjs +12 -12
  165. package/types/algorand-client.mjs.map +1 -1
  166. package/types/amount.d.ts +10 -11
  167. package/types/amount.js +7 -7
  168. package/types/amount.js.map +1 -1
  169. package/types/amount.mjs +7 -7
  170. package/types/amount.mjs.map +1 -1
  171. package/types/app-arc56.d.ts +358 -0
  172. package/types/app-arc56.js +184 -0
  173. package/types/app-arc56.js.map +1 -0
  174. package/types/app-arc56.mjs +175 -0
  175. package/types/app-arc56.mjs.map +1 -0
  176. package/types/app-client.d.ts +1488 -8
  177. package/types/app-client.js +1000 -19
  178. package/types/app-client.js.map +1 -1
  179. package/types/app-client.mjs +1000 -20
  180. package/types/app-client.mjs.map +1 -1
  181. package/types/app-deployer.d.ts +19 -14
  182. package/types/app-deployer.js +25 -25
  183. package/types/app-deployer.js.map +1 -1
  184. package/types/app-deployer.mjs +27 -27
  185. package/types/app-deployer.mjs.map +1 -1
  186. package/types/app-factory.d.ts +846 -0
  187. package/types/app-factory.js +411 -0
  188. package/types/app-factory.js.map +1 -0
  189. package/types/app-factory.mjs +409 -0
  190. package/types/app-factory.mjs.map +1 -0
  191. package/types/app-manager.d.ts +12 -3
  192. package/types/app-manager.js +13 -15
  193. package/types/app-manager.js.map +1 -1
  194. package/types/app-manager.mjs +13 -15
  195. package/types/app-manager.mjs.map +1 -1
  196. package/types/app-spec.d.ts +2 -1
  197. package/types/app-spec.js +121 -0
  198. package/types/app-spec.js.map +1 -1
  199. package/types/app-spec.mjs +120 -0
  200. package/types/app-spec.mjs.map +1 -1
  201. package/types/app.d.ts +14 -9
  202. package/types/app.js.map +1 -1
  203. package/types/app.mjs.map +1 -1
  204. package/types/asset-manager.d.ts +7 -7
  205. package/types/asset-manager.js +5 -6
  206. package/types/asset-manager.js.map +1 -1
  207. package/types/asset-manager.mjs +5 -6
  208. package/types/asset-manager.mjs.map +1 -1
  209. package/types/asset.d.ts +0 -1
  210. package/types/async-event-emitter.d.ts +14 -0
  211. package/types/async-event-emitter.js +50 -0
  212. package/types/async-event-emitter.js.map +1 -0
  213. package/types/async-event-emitter.mjs +48 -0
  214. package/types/async-event-emitter.mjs.map +1 -0
  215. package/types/client-manager.d.ts +131 -51
  216. package/types/client-manager.js +143 -23
  217. package/types/client-manager.js.map +1 -1
  218. package/types/client-manager.mjs +144 -24
  219. package/types/client-manager.mjs.map +1 -1
  220. package/types/composer.d.ts +110 -37
  221. package/types/composer.js +139 -26
  222. package/types/composer.js.map +1 -1
  223. package/types/composer.mjs +140 -27
  224. package/types/composer.mjs.map +1 -1
  225. package/types/config.d.ts +3 -6
  226. package/types/config.js +5 -44
  227. package/types/config.js.map +1 -1
  228. package/types/config.mjs +5 -27
  229. package/types/config.mjs.map +1 -1
  230. package/types/debugging.d.ts +29 -101
  231. package/types/debugging.js +16 -109
  232. package/types/debugging.js.map +1 -1
  233. package/types/debugging.mjs +12 -107
  234. package/types/debugging.mjs.map +1 -1
  235. package/types/dispenser-client.d.ts +1 -2
  236. package/types/dispenser-client.js +6 -5
  237. package/types/dispenser-client.js.map +1 -1
  238. package/types/dispenser-client.mjs +6 -5
  239. package/types/dispenser-client.mjs.map +1 -1
  240. package/types/expand.d.ts +0 -1
  241. package/types/indexer.d.ts +0 -1
  242. package/types/indexer.js.map +1 -1
  243. package/types/indexer.mjs.map +1 -1
  244. package/types/kmd-account-manager.d.ts +0 -1
  245. package/types/kmd-account-manager.js +2 -2
  246. package/types/kmd-account-manager.js.map +1 -1
  247. package/types/kmd-account-manager.mjs +4 -4
  248. package/types/kmd-account-manager.mjs.map +1 -1
  249. package/types/lifecycle-events.d.ts +10 -0
  250. package/types/lifecycle-events.js +8 -0
  251. package/types/lifecycle-events.js.map +1 -0
  252. package/types/lifecycle-events.mjs +8 -0
  253. package/types/lifecycle-events.mjs.map +1 -0
  254. package/types/logging.d.ts +0 -1
  255. package/types/logging.js.map +1 -1
  256. package/types/logging.mjs.map +1 -1
  257. package/types/logic-error.d.ts +2 -4
  258. package/types/logic-error.js +3 -3
  259. package/types/logic-error.js.map +1 -1
  260. package/types/logic-error.mjs +3 -3
  261. package/types/logic-error.mjs.map +1 -1
  262. package/types/network-client.d.ts +13 -1
  263. package/types/network-client.js.map +1 -1
  264. package/types/network-client.mjs.map +1 -1
  265. package/types/testing.d.ts +3 -4
  266. package/types/transaction.d.ts +14 -4
  267. package/types/transfer.d.ts +0 -1
  268. package/types/urlTokenBaseHTTPClient.d.ts +0 -1
  269. package/types/urlTokenBaseHTTPClient.js +1 -1
  270. package/types/urlTokenBaseHTTPClient.js.map +1 -1
  271. package/types/urlTokenBaseHTTPClient.mjs +1 -1
  272. package/types/urlTokenBaseHTTPClient.mjs.map +1 -1
  273. package/util.d.ts +2 -2
  274. package/util.js +11 -10
  275. package/util.js.map +1 -1
  276. package/util.mjs +11 -10
  277. package/util.mjs.map +1 -1
  278. package/account/account.d.ts.map +0 -1
  279. package/account/get-account-config-from-environment.d.ts.map +0 -1
  280. package/account/get-account.d.ts.map +0 -1
  281. package/account/get-dispenser-account.d.ts.map +0 -1
  282. package/account/index.d.ts.map +0 -1
  283. package/account/mnemonic-account.d.ts.map +0 -1
  284. package/amount.d.ts.map +0 -1
  285. package/app-client.d.ts.map +0 -1
  286. package/app-deploy.d.ts.map +0 -1
  287. package/app.d.ts.map +0 -1
  288. package/asset.d.ts.map +0 -1
  289. package/config.d.ts.map +0 -1
  290. package/debugging/debugging.d.ts.map +0 -1
  291. package/debugging/index.d.ts.map +0 -1
  292. package/debugging/simulate-and-persist-response.d.ts +0 -20
  293. package/debugging/simulate-and-persist-response.d.ts.map +0 -1
  294. package/debugging/simulate-and-persist-response.js +0 -108
  295. package/debugging/simulate-and-persist-response.js.map +0 -1
  296. package/debugging/simulate-and-persist-response.mjs +0 -89
  297. package/debugging/simulate-and-persist-response.mjs.map +0 -1
  298. package/dispenser-client.d.ts.map +0 -1
  299. package/index.d.ts.map +0 -1
  300. package/indexer-lookup.d.ts.map +0 -1
  301. package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
  302. package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
  303. package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
  304. package/localnet/index.d.ts.map +0 -1
  305. package/localnet/is-localnet.d.ts.map +0 -1
  306. package/network-client.d.ts.map +0 -1
  307. package/testing/_asset.d.ts.map +0 -1
  308. package/testing/account.d.ts.map +0 -1
  309. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
  310. package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
  311. package/testing/fixtures/index.d.ts.map +0 -1
  312. package/testing/index.d.ts.map +0 -1
  313. package/testing/indexer.d.ts.map +0 -1
  314. package/testing/test-logger.d.ts.map +0 -1
  315. package/testing/transaction-logger.d.ts.map +0 -1
  316. package/transaction/index.d.ts.map +0 -1
  317. package/transaction/legacy-bridge.d.ts.map +0 -1
  318. package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
  319. package/transaction/transaction.d.ts.map +0 -1
  320. package/transfer/index.d.ts.map +0 -1
  321. package/transfer/transfer-algos.d.ts.map +0 -1
  322. package/transfer/transfer.d.ts.map +0 -1
  323. package/types/account-manager.d.ts.map +0 -1
  324. package/types/account.d.ts.map +0 -1
  325. package/types/algo-http-client-with-retry.d.ts.map +0 -1
  326. package/types/algorand-client-transaction-creator.d.ts.map +0 -1
  327. package/types/algorand-client-transaction-sender.d.ts.map +0 -1
  328. package/types/algorand-client.d.ts.map +0 -1
  329. package/types/amount.d.ts.map +0 -1
  330. package/types/app-client.d.ts.map +0 -1
  331. package/types/app-deployer.d.ts.map +0 -1
  332. package/types/app-manager.d.ts.map +0 -1
  333. package/types/app-spec.d.ts.map +0 -1
  334. package/types/app.d.ts.map +0 -1
  335. package/types/asset-manager.d.ts.map +0 -1
  336. package/types/asset.d.ts.map +0 -1
  337. package/types/client-manager.d.ts.map +0 -1
  338. package/types/composer.d.ts.map +0 -1
  339. package/types/config.d.ts.map +0 -1
  340. package/types/debugging.d.ts.map +0 -1
  341. package/types/dispenser-client.d.ts.map +0 -1
  342. package/types/expand.d.ts.map +0 -1
  343. package/types/indexer.d.ts.map +0 -1
  344. package/types/kmd-account-manager.d.ts.map +0 -1
  345. package/types/logging.d.ts.map +0 -1
  346. package/types/logic-error.d.ts.map +0 -1
  347. package/types/network-client.d.ts.map +0 -1
  348. package/types/testing.d.ts.map +0 -1
  349. package/types/transaction.d.ts.map +0 -1
  350. package/types/transfer.d.ts.map +0 -1
  351. package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
  352. package/util.d.ts.map +0 -1
@@ -1,8 +1,10 @@
1
1
  import algosdk from 'algosdk';
2
- import { AppLookup } from './app';
3
- import { AppDetails, AppDetailsBase, AppSpecAppDetailsBase, ApplicationClient, ResolveAppByCreatorAndNameBase, ResolveAppByIdBase } from './app-client';
2
+ import { AlgorandClientInterface } from './algorand-client-interface';
3
+ import { AppClient, AppClientParams, ResolveAppClientByCreatorAndName } from './app-client';
4
+ import { AppFactory, AppFactoryParams } from './app-factory';
4
5
  import { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './dispenser-client';
5
- import { AlgoClientConfig, AlgoConfig } from './network-client';
6
+ import { Expand } from './expand';
7
+ import { AlgoClientConfig, AlgoConfig, NetworkDetails } from './network-client';
6
8
  import Kmd = algosdk.Kmd;
7
9
  import Indexer = algosdk.Indexer;
8
10
  import Algodv2 = algosdk.Algodv2;
@@ -16,24 +18,28 @@ export interface AlgoSdkClients {
16
18
  /** Optional KMD client, see https://developer.algorand.org/docs/rest-apis/kmd/ */
17
19
  kmd?: algosdk.Kmd;
18
20
  }
19
- /** Details of the current network. */
20
- export interface NetworkDetails {
21
- /** Whether or not the network is TestNet. */
22
- isTestNet: boolean;
23
- /** Whether or not the network is MainNet. */
24
- isMainNet: boolean;
25
- /** Whether or not the network is LocalNet. */
26
- isLocalNet: boolean;
27
- /** The genesis ID of the current network. */
28
- genesisId: string;
29
- /** The base64 genesis hash of the current network. */
30
- genesisHash: string;
31
- }
21
+ /** Params to get an app factory from `ClientManager`. */
22
+ export type ClientAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand'>>;
23
+ /** Params to get an app client by creator address and name from `ClientManager`. */
24
+ export type ClientResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand'>>;
25
+ /** Params to get an app client by ID from `ClientManager`. */
26
+ export type ClientAppClientParams = Expand<Omit<AppClientParams, 'algorand'>>;
27
+ /** Params to get an app client by network from `ClientManager`. */
28
+ export type ClientAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appId'>>;
29
+ /** Params to get a typed app client by creator address and name from `ClientManager`. */
30
+ export type ClientTypedAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>;
31
+ /** Params to get a typed app client by ID from `ClientManager`. */
32
+ export type ClientTypedAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>;
33
+ /** Params to get a typed app client by network from `ClientManager`. */
34
+ export type ClientTypedAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec' | 'appId'>>;
35
+ /** Params to get a typed app factory from `ClientManager`. */
36
+ export type ClientTypedAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand' | 'appSpec'>>;
32
37
  /** Exposes access to various API clients. */
33
38
  export declare class ClientManager {
34
39
  private _algod;
35
40
  private _indexer?;
36
41
  private _kmd?;
42
+ private _algorand?;
37
43
  /**
38
44
  * algosdk clients or config for interacting with the official Algorand APIs.
39
45
  * @param clientsOrConfig The clients or config to use
@@ -54,7 +60,7 @@ export declare class ClientManager {
54
60
  * const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })
55
61
  * ```
56
62
  */
57
- constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients);
63
+ constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClientInterface);
58
64
  /** Returns an algosdk Algod API client. */
59
65
  get algod(): algosdk.Algodv2;
60
66
  /** Returns an algosdk Indexer API client or throws an error if it's not been provided. */
@@ -129,28 +135,82 @@ export declare class ClientManager {
129
135
  */
130
136
  getTestNetDispenserFromEnvironment(params?: Omit<TestNetDispenserApiClientParams, 'authToken'>): TestNetDispenserApiClient;
131
137
  /**
132
- * Returns a new `ApplicationClient` client, resolving the app by creator address and name.
133
- * @param details The details to resolve the app by creator address and name
134
- * @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction.
135
- * @returns The `ApplicationClient`
138
+ * Returns a new `AppFactory` client
139
+ * @example Basic example
140
+ * ```typescript
141
+ * const factory = algorand.client.getAppFactory({
142
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}',
143
+ * })
144
+ * ```
145
+ * @example Advanced example
146
+ * ```typescript
147
+ * const factory = algorand.client.getAppFactory({
148
+ * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,
149
+ * defaultSender: "SENDERADDRESS",
150
+ * appName: "OverriddenAppName",
151
+ * version: "2.0.0",
152
+ * updatable: true,
153
+ * deletable: false,
154
+ * deployTimeParams: { ONE: 1, TWO: 'value' }
155
+ * })
156
+ * ```
136
157
  */
137
- getAppClientByCreatorAndName(details: AppClientByCreatorAndNameDetails, cachedAppLookup?: AppLookup): ApplicationClient;
158
+ getAppFactory(params: ClientAppFactoryParams): AppFactory;
138
159
  /**
139
- * Returns a new `ApplicationClient` client, resolving the app by app ID.
140
- * @param details The details to resolve the app by ID
141
- * @returns The `ApplicationClient`
160
+ * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
161
+ * This method resolves the app ID by looking up the creator address and name
162
+ * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
163
+ * @param params The parameters to create the app client
164
+ * @example Basic
165
+ * ```typescript
166
+ * const appClient = algorand.client.getAppClientByCreatorAndName({
167
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
168
+ * // appId resolved by looking for app ID of named app by this creator
169
+ * creatorAddress: 'CREATORADDRESS',
170
+ * })
171
+ * ```
172
+ * @returns The `AppClient`
142
173
  */
143
- getAppClientById(details: AppClientByIdDetails): ApplicationClient;
174
+ getAppClientByCreatorAndName(params: ClientResolveAppClientByCreatorAndNameParams): Promise<AppClient>;
175
+ /**
176
+ * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
177
+ * @param params The parameters to create the app client
178
+ * @example Basic
179
+ * ```typescript
180
+ * const appClient = algorand.client.getAppClientById({
181
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
182
+ * appId: 12345n,
183
+ * })
184
+ * ```
185
+ * @returns The `AppClient`
186
+ */
187
+ getAppClientById(params: ClientAppClientParams): AppClient;
188
+ /**
189
+ * Returns a new `AppClient` client for managing calls and state for an ARC-56 app.
190
+ * This method resolves the app ID for the current network based on
191
+ * pre-determined network-specific app IDs specified in the ARC-56 app spec.
192
+ *
193
+ * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
194
+ * @param params The parameters to create the app client
195
+ * @example Basic
196
+ * ```typescript
197
+ * const appClient = algorand.client.getAppClientByNetwork({
198
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
199
+ * // appId resolved by using ARC-56 spec to find app ID for current network
200
+ * })
201
+ * ```
202
+ * @returns The `AppClient`
203
+ */
204
+ getAppClientByNetwork(params: ClientAppClientByNetworkParams): Promise<AppClient>;
144
205
  /**
145
206
  * Returns a new typed client, resolving the app by creator address and name.
146
207
  * @param typedClient The typed client type to use
147
- * @param details The details to resolve the app by creator address and name
148
- * @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction.
149
- * @example Use name in ARC-32 app spec
208
+ * @param params The params to resolve the app by creator address and name
209
+ * @example Use name in ARC-32 / ARC-56 app spec
150
210
  * ```typescript
151
211
  * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
152
212
  * creatorAddress: "CREATORADDRESS",
153
- * sender: alice,
213
+ * defaultSender: alice,
154
214
  * })
155
215
  * ```
156
216
  * @example Specify name
@@ -158,26 +218,55 @@ export declare class ClientManager {
158
218
  * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
159
219
  * creatorAddress: "CREATORADDRESS",
160
220
  * name: "contract-name",
161
- * sender: alice,
221
+ * defaultSender: alice,
162
222
  * })
163
223
  * ```
164
224
  * @returns The typed client instance
165
225
  */
166
- getTypedAppClientByCreatorAndName<TClient>(typedClient: TypedAppClient<TClient>, details: TypedAppClientByCreatorAndNameDetails, cachedAppLookup?: AppLookup): TClient;
226
+ getTypedAppClientByCreatorAndName<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params: ClientTypedAppClientByCreatorAndNameParams): Promise<InstanceType<TClient>>;
167
227
  /**
168
228
  * Returns a new typed client, resolving the app by app ID.
169
229
  * @param typedClient The typed client type to use
170
- * @param details The details to resolve the app by ID
230
+ * @param params The params to resolve the app by ID
171
231
  * @example
172
232
  * ```typescript
173
233
  * const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
174
- * id: 12345,
234
+ * appId: 12345n,
235
+ * defaultSender: alice,
236
+ * })
237
+ * ```
238
+ * @returns The typed client instance
239
+ */
240
+ getTypedAppClientById<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params: ClientTypedAppClientParams): InstanceType<TClient>;
241
+ /**
242
+ * Returns a new typed client, resolves the app ID for the current network based on
243
+ * pre-determined network-specific app IDs specified in the ARC-56 app spec.
244
+ *
245
+ * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
246
+ * @param typedClient The typed client type to use
247
+ * @param params The params to resolve the app by network
248
+ * @example
249
+ * ```typescript
250
+ * const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {
251
+ * defaultSender: alice,
252
+ * })
253
+ * ```
254
+ * @returns The typed client instance
255
+ */
256
+ getTypedAppClientByNetwork<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params?: ClientTypedAppClientByNetworkParams): Promise<InstanceType<TClient>>;
257
+ /**
258
+ * Returns a new typed app factory.
259
+ * @param typedFactory The typed factory type to use
260
+ * @param params The params to resolve the factory by
261
+ * @example
262
+ * ```typescript
263
+ * const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {
175
264
  * sender: alice,
176
265
  * })
177
266
  * ```
178
267
  * @returns The typed client instance
179
268
  */
180
- getTypedAppClientById<TClient>(typedClient: TypedAppClient<TClient>, details: TypedAppClientByIdDetails): TClient;
269
+ getTypedAppFactory<TClient>(typedFactory: TypedAppFactory<TClient>, params?: ClientTypedAppFactoryParams): TClient;
181
270
  /**
182
271
  * Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)
183
272
  *
@@ -316,22 +405,13 @@ export declare class ClientManager {
316
405
  * Interface to identify a typed client that can be used to interact with an application.
317
406
  */
318
407
  export interface TypedAppClient<TClient> {
319
- new (details: AppDetails, algod: algosdk.Algodv2): TClient;
408
+ new (params: Omit<AppClientParams, 'appSpec'>): TClient;
409
+ fromNetwork(params: Omit<AppClientParams, 'appId' | 'appSpec'>): Promise<TClient>;
410
+ fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<TClient>;
320
411
  }
321
412
  /**
322
- * Details to resolve an app client by creator address and name.
323
- */
324
- export type AppClientByCreatorAndNameDetails = AppSpecAppDetailsBase & AppDetailsBase & Omit<ResolveAppByCreatorAndNameBase, 'findExistingUsing'>;
325
- /**
326
- * Details to resolve a typed app creator address and name.
413
+ * Interface to identify a typed factory that can be used to create and deploy an application.
327
414
  */
328
- export type TypedAppClientByCreatorAndNameDetails = AppDetailsBase & Omit<ResolveAppByCreatorAndNameBase, 'findExistingUsing'>;
329
- /**
330
- * Details to resolve an app client by app ID.
331
- */
332
- export type AppClientByIdDetails = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByIdBase;
333
- /**
334
- * Details to resolve a typed app by app ID.
335
- */
336
- export type TypedAppClientByIdDetails = AppDetailsBase & ResolveAppByIdBase;
337
- //# sourceMappingURL=client-manager.d.ts.map
415
+ export interface TypedAppFactory<TClient> {
416
+ new (params: Omit<AppFactoryParams, 'appSpec'>): TClient;
417
+ }
@@ -3,6 +3,7 @@
3
3
  var algosdk = require('algosdk');
4
4
  var types_algoHttpClientWithRetry = require('./algo-http-client-with-retry.js');
5
5
  var types_appClient = require('./app-client.js');
6
+ var types_appFactory = require('./app-factory.js');
6
7
  var types_dispenserClient = require('./dispenser-client.js');
7
8
  var types_networkClient = require('./network-client.js');
8
9
 
@@ -31,7 +32,7 @@ class ClientManager {
31
32
  * const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })
32
33
  * ```
33
34
  */
34
- constructor(clientsOrConfig) {
35
+ constructor(clientsOrConfig, algorandClient) {
35
36
  const _clients = 'algod' in clientsOrConfig
36
37
  ? clientsOrConfig
37
38
  : {
@@ -42,6 +43,7 @@ class ClientManager {
42
43
  this._algod = _clients.algod;
43
44
  this._indexer = _clients.indexer;
44
45
  this._kmd = _clients.kmd;
46
+ this._algorand = algorandClient;
45
47
  }
46
48
  /** Returns an algosdk Algod API client. */
47
49
  get algod() {
@@ -152,32 +154,105 @@ class ClientManager {
152
154
  return new types_dispenserClient.TestNetDispenserApiClient(params ? { ...params, authToken: '' } : undefined);
153
155
  }
154
156
  /**
155
- * Returns a new `ApplicationClient` client, resolving the app by creator address and name.
156
- * @param details The details to resolve the app by creator address and name
157
- * @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction.
158
- * @returns The `ApplicationClient`
157
+ * Returns a new `AppFactory` client
158
+ * @example Basic example
159
+ * ```typescript
160
+ * const factory = algorand.client.getAppFactory({
161
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}',
162
+ * })
163
+ * ```
164
+ * @example Advanced example
165
+ * ```typescript
166
+ * const factory = algorand.client.getAppFactory({
167
+ * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,
168
+ * defaultSender: "SENDERADDRESS",
169
+ * appName: "OverriddenAppName",
170
+ * version: "2.0.0",
171
+ * updatable: true,
172
+ * deletable: false,
173
+ * deployTimeParams: { ONE: 1, TWO: 'value' }
174
+ * })
175
+ * ```
159
176
  */
160
- getAppClientByCreatorAndName(details, cachedAppLookup) {
161
- return new types_appClient.ApplicationClient({ ...details, resolveBy: 'creatorAndName', findExistingUsing: cachedAppLookup ?? this.indexer }, this._algod);
177
+ getAppFactory(params) {
178
+ if (!this._algorand) {
179
+ throw new Error('Attempt to get app factory from a ClientManager without an Algorand client');
180
+ }
181
+ return new types_appFactory.AppFactory({ ...params, algorand: this._algorand });
162
182
  }
163
183
  /**
164
- * Returns a new `ApplicationClient` client, resolving the app by app ID.
165
- * @param details The details to resolve the app by ID
166
- * @returns The `ApplicationClient`
184
+ * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
185
+ * This method resolves the app ID by looking up the creator address and name
186
+ * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
187
+ * @param params The parameters to create the app client
188
+ * @example Basic
189
+ * ```typescript
190
+ * const appClient = algorand.client.getAppClientByCreatorAndName({
191
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
192
+ * // appId resolved by looking for app ID of named app by this creator
193
+ * creatorAddress: 'CREATORADDRESS',
194
+ * })
195
+ * ```
196
+ * @returns The `AppClient`
197
+ */
198
+ getAppClientByCreatorAndName(params) {
199
+ if (!this._algorand) {
200
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
201
+ }
202
+ return types_appClient.AppClient.fromCreatorAndName({
203
+ ...params,
204
+ algorand: this._algorand,
205
+ });
206
+ }
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 = algorand.client.getAppClientById({
213
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
214
+ * appId: 12345n,
215
+ * })
216
+ * ```
217
+ * @returns The `AppClient`
218
+ */
219
+ getAppClientById(params) {
220
+ if (!this._algorand) {
221
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
222
+ }
223
+ return new types_appClient.AppClient({ ...params, algorand: this._algorand });
224
+ }
225
+ /**
226
+ * Returns a new `AppClient` client for managing calls and state for an ARC-56 app.
227
+ * This method resolves the app ID for the current network based on
228
+ * pre-determined network-specific app IDs specified in the ARC-56 app spec.
229
+ *
230
+ * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
231
+ * @param params The parameters to create the app client
232
+ * @example Basic
233
+ * ```typescript
234
+ * const appClient = algorand.client.getAppClientByNetwork({
235
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
236
+ * // appId resolved by using ARC-56 spec to find app ID for current network
237
+ * })
238
+ * ```
239
+ * @returns The `AppClient`
167
240
  */
168
- getAppClientById(details) {
169
- return new types_appClient.ApplicationClient({ ...details, resolveBy: 'id' }, this._algod);
241
+ async getAppClientByNetwork(params) {
242
+ if (!this._algorand) {
243
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
244
+ }
245
+ return types_appClient.AppClient.fromNetwork({ ...params, algorand: this._algorand });
170
246
  }
171
247
  /**
172
248
  * Returns a new typed client, resolving the app by creator address and name.
173
249
  * @param typedClient The typed client type to use
174
- * @param details The details to resolve the app by creator address and name
175
- * @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction.
176
- * @example Use name in ARC-32 app spec
250
+ * @param params The params to resolve the app by creator address and name
251
+ * @example Use name in ARC-32 / ARC-56 app spec
177
252
  * ```typescript
178
253
  * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
179
254
  * creatorAddress: "CREATORADDRESS",
180
- * sender: alice,
255
+ * defaultSender: alice,
181
256
  * })
182
257
  * ```
183
258
  * @example Specify name
@@ -185,29 +260,74 @@ class ClientManager {
185
260
  * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
186
261
  * creatorAddress: "CREATORADDRESS",
187
262
  * name: "contract-name",
188
- * sender: alice,
263
+ * defaultSender: alice,
189
264
  * })
190
265
  * ```
191
266
  * @returns The typed client instance
192
267
  */
193
- getTypedAppClientByCreatorAndName(typedClient, details, cachedAppLookup) {
194
- return new typedClient({ ...details, resolveBy: 'creatorAndName', findExistingUsing: cachedAppLookup ?? this.indexer }, this._algod);
268
+ async getTypedAppClientByCreatorAndName(typedClient, params) {
269
+ if (!this._algorand) {
270
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
271
+ }
272
+ return typedClient.fromCreatorAndName({ ...params, algorand: this._algorand });
195
273
  }
196
274
  /**
197
275
  * Returns a new typed client, resolving the app by app ID.
198
276
  * @param typedClient The typed client type to use
199
- * @param details The details to resolve the app by ID
277
+ * @param params The params to resolve the app by ID
200
278
  * @example
201
279
  * ```typescript
202
280
  * const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
203
- * id: 12345,
281
+ * appId: 12345n,
282
+ * defaultSender: alice,
283
+ * })
284
+ * ```
285
+ * @returns The typed client instance
286
+ */
287
+ getTypedAppClientById(typedClient, params) {
288
+ if (!this._algorand) {
289
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
290
+ }
291
+ return new typedClient({ ...params, algorand: this._algorand });
292
+ }
293
+ /**
294
+ * Returns a new typed client, resolves the app ID for the current network based on
295
+ * pre-determined network-specific app IDs specified in the ARC-56 app spec.
296
+ *
297
+ * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
298
+ * @param typedClient The typed client type to use
299
+ * @param params The params to resolve the app by network
300
+ * @example
301
+ * ```typescript
302
+ * const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {
303
+ * defaultSender: alice,
304
+ * })
305
+ * ```
306
+ * @returns The typed client instance
307
+ */
308
+ getTypedAppClientByNetwork(typedClient, params) {
309
+ if (!this._algorand) {
310
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
311
+ }
312
+ return typedClient.fromNetwork({ ...params, algorand: this._algorand });
313
+ }
314
+ /**
315
+ * Returns a new typed app factory.
316
+ * @param typedFactory The typed factory type to use
317
+ * @param params The params to resolve the factory by
318
+ * @example
319
+ * ```typescript
320
+ * const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {
204
321
  * sender: alice,
205
322
  * })
206
323
  * ```
207
324
  * @returns The typed client instance
208
325
  */
209
- getTypedAppClientById(typedClient, details) {
210
- return new typedClient({ ...details, resolveBy: 'id' }, this._algod);
326
+ getTypedAppFactory(typedFactory, params) {
327
+ if (!this._algorand) {
328
+ throw new Error('Attempt to get app factory from a ClientManager without an Algorand client');
329
+ }
330
+ return new typedFactory({ ...params, algorand: this._algorand });
211
331
  }
212
332
  /**
213
333
  * Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)
@@ -1 +1 @@
1
- {"version":3,"file":"client-manager.js","sources":["../../src/types/client-manager.ts"],"sourcesContent":[null],"names":["genesisIdIsLocalNet","TestNetDispenserApiClient","ApplicationClient","AlgoHttpClientWithRetry"],"mappings":";;;;;;;;AAcA,IAAO,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;AACxB,IAAO,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAEhC,IAAO,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;AA0BxC;MACa,aAAa,CAAA;AAKxB;;;;;;;;;;;;;;;;;;;AAmBG;AACH,IAAA,WAAA,CAAY,eAA4C,EAAA;AACtD,QAAA,MAAM,QAAQ,GACZ,OAAO,IAAI,eAAe;AACxB,cAAE,eAAe;AACjB,cAAE;gBACE,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,eAAe,CAAC,WAAW,CAAC;AAChE,gBAAA,OAAO,EAAE,eAAe,CAAC,aAAa,GAAG,aAAa,CAAC,gBAAgB,CAAC,eAAe,CAAC,aAAa,CAAC,GAAG,SAAS;AAClH,gBAAA,GAAG,EAAE,eAAe,CAAC,SAAS,GAAG,aAAa,CAAC,YAAY,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,SAAS;aACnG,CAAA;AACP,QAAA,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAA;AAC5B,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;AAChC,QAAA,IAAI,C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AAE,GAAG,KAAK,IAAI,EAAE,CAAA;QAC9F,MAAM,mBAAmB,GAAG,IAAIA,qDAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;AAClF,QAAA,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAA;;QAEhD,OAAO,CAAC,cAAc,CAAC,mBAAmB,IAAI,WAAW,CAAC,KAAK,CAAC,CAAA;AAChE,QAAA,OAAO,OAAO,CAAA;KACf;AAED;;;;;;;;;;;AAWG;IACI,OAAO,+BAA+B,CAAC,mBAAiC,EAAA;QAC7E,OAAO,aAAa,CAAC,gBAAgB,CAAC,aAAa,CAAC,+BAA+B,EAAE,EAAE,mBAAmB,CAAC,CAAA;KAC5G;AAED;;;;;;;;;;AAUG;IACI,OAAO,YAAY,CAAC,MAAwB,EAAA;QACjD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAA;QACtC,OAAO,IAAI,GAAG,CAAC,KAAe,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;KAC9C;AAED;;;;;;;;AAQG;AACI,IAAA,OAAO,2BAA2B,GAAA;;;QAGvC,OAAO,aAAa,CAAC,YAAY,CAAC,EAAE,GAAG,aAAa,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,IAAI,MAAM,EAAE,CAAC,CAAA;KAChI;AACF;;;;"}
1
+ {"version":3,"file":"client-manager.js","sources":["../../src/types/client-manager.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { SuggestedParamsWithMinFee } from 'algosdk/dist/types/types/transactions/base'\nimport { AlgoHttpClientWithRetry } from './algo-http-client-with-retry'\nimport { AlgorandClientInterface } from './algorand-client-interface'\nimport { AppClient, AppClientParams, ResolveAppClientByCreatorAndName } from './app-client'\nimport { AppFactory, AppFactoryParams } from './app-factory'\nimport { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './dispenser-client'\nimport { Expand } from './expand'\nimport { AlgoClientConfig, AlgoConfig, NetworkDetails, genesisIdIsLocalNet } from './network-client'\nimport Kmd = algosdk.Kmd\nimport Indexer = algosdk.Indexer\nimport Algodv2 = algosdk.Algodv2\nimport IntDecoding = algosdk.IntDecoding\n\n/** Clients from algosdk that interact with the official Algorand APIs */\nexport interface AlgoSdkClients {\n /** Algod client, see https://developer.algorand.org/docs/rest-apis/algod/ */\n algod: algosdk.Algodv2\n /** Optional indexer client, see https://developer.algorand.org/docs/rest-apis/indexer/ */\n indexer?: algosdk.Indexer\n /** Optional KMD client, see https://developer.algorand.org/docs/rest-apis/kmd/ */\n kmd?: algosdk.Kmd\n}\n\n/** Params to get an app factory from `ClientManager`. */\nexport type ClientAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand'>>\n\n/** Params to get an app client by creator address and name from `ClientManager`. */\nexport type ClientResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand'>>\n\n/** Params to get an app client by ID from `ClientManager`. */\nexport type ClientAppClientParams = Expand<Omit<AppClientParams, 'algorand'>>\n\n/** Params to get an app client by network from `ClientManager`. */\nexport type ClientAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appId'>>\n\n/** Params to get a typed app client by creator address and name from `ClientManager`. */\nexport type ClientTypedAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>\n\n/** Params to get a typed app client by ID from `ClientManager`. */\nexport type ClientTypedAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>\n\n/** Params to get a typed app client by network from `ClientManager`. */\nexport type ClientTypedAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec' | 'appId'>>\n\n/** Params to get a typed app factory from `ClientManager`. */\nexport type ClientTypedAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand' | 'appSpec'>>\n\n/** Exposes access to various API clients. */\nexport class ClientManager {\n private _algod: algosdk.Algodv2\n private _indexer?: algosdk.Indexer\n private _kmd?: algosdk.Kmd\n private _algorand?: AlgorandClientInterface\n\n /**\n * algosdk clients or config for interacting with the official Algorand APIs.\n * @param clientsOrConfig The clients or config to use\n * @example Algod client only\n * ```typescript\n * const clientManager = new ClientManager({ algod: algodClient })\n * ```\n * @example All clients\n * ```typescript\n * const clientManager = new ClientManager({ algod: algodClient, indexer: indexerClient, kmd: kmdClient })\n * ```\n * @example Algod config only\n * ```typescript\n * const clientManager = new ClientManager({ algodConfig })\n * ```\n * @example All client configs\n * ```typescript\n * const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })\n * ```\n */\n constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClientInterface) {\n const _clients =\n 'algod' in clientsOrConfig\n ? clientsOrConfig\n : {\n algod: ClientManager.getAlgodClient(clientsOrConfig.algodConfig),\n indexer: clientsOrConfig.indexerConfig ? ClientManager.getIndexerClient(clientsOrConfig.indexerConfig) : undefined,\n kmd: clientsOrConfig.kmdConfig ? ClientManager.getKmdClient(clientsOrConfig.kmdConfig) : undefined,\n }\n this._algod = _clients.algod\n this._indexer = _clients.indexer\n this._kmd = _clients.kmd\n this._algorand = algorandClient\n }\n\n /** Returns an algosdk Algod API client. */\n public get algod(): algosdk.Algodv2 {\n return this._algod\n }\n\n /** Returns an algosdk Indexer API client or throws an error if it's not been provided. */\n public get indexer(): algosdk.Indexer {\n if (!this._indexer) throw new Error('Attempt to use Indexer client in AlgoKit instance with no Indexer configured')\n return this._indexer\n }\n\n /** Returns an algosdk Indexer API client or `undefined` if it's not been provided. */\n public get indexerIfPresent(): algosdk.Indexer | undefined {\n return this._indexer\n }\n\n /** Returns an algosdk KMD API client or throws an error if it's not been provided. */\n public get kmd(): algosdk.Kmd {\n if (!this._kmd) throw new Error('Attempt to use Kmd client in AlgoKit instance with no Kmd configured')\n return this._kmd\n }\n\n private _getNetworkPromise: Promise<SuggestedParamsWithMinFee> | undefined\n /**\n * Get details about the current network.\n * @example Getting genesis ID\n * ```typescript\n * const network = await networkClient.network()\n * const genesisId = network.genesisId\n * ```\n * @returns The current network details\n */\n public async network(): Promise<NetworkDetails> {\n if (!this._getNetworkPromise) {\n this._getNetworkPromise = this._algod.getTransactionParams().do()\n }\n\n const params = await this._getNetworkPromise\n return {\n isTestNet: ['testnet-v1.0', 'testnet-v1', 'testnet'].includes(params.genesisID),\n isMainNet: ['mainnet-v1.0', 'mainnet-v1', 'mainnet'].includes(params.genesisID),\n isLocalNet: ClientManager.genesisIdIsLocalNet(params.genesisID),\n genesisId: params.genesisID,\n genesisHash: params.genesisHash,\n }\n }\n\n /**\n * Returns true if the given network genesisId is associated with a LocalNet network.\n * @param genesisId The network genesis ID\n * @returns Whether the given genesis ID is associated with a LocalNet network\n */\n public static genesisIdIsLocalNet(genesisId: string) {\n return genesisIdIsLocalNet(genesisId)\n }\n\n /**\n * Returns true if the current network is LocalNet.\n * @returns True if the current network is LocalNet.\n */\n public async isLocalNet() {\n return (await this.network()).isLocalNet\n }\n\n /**\n * Returns true if the current network is TestNet.\n * @returns True if the current network is TestNet.\n */\n public async isTestNet() {\n return (await this.network()).isTestNet\n }\n\n /**\n * Returns true if the current network is MainNet.\n * @returns True if the current network is MainNet.\n */\n public async isMainNet() {\n return (await this.network()).isMainNet\n }\n\n /**\n * Returns a TestNet Dispenser API client.\n *\n * Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.\n *\n * @param params An object containing parameters for the TestNetDispenserApiClient class.\n * @example\n * const client = clientManager.getTestNetDispenser(\n * {\n * authToken: 'your_auth_token',\n * requestTimeout: 15,\n * }\n * )\n *\n * @returns An instance of the TestNetDispenserApiClient class.\n */\n public getTestNetDispenser(params: TestNetDispenserApiClientParams) {\n return new TestNetDispenserApiClient(params)\n }\n\n /**\n * Returns a TestNet Dispenser API client, loading the auth token from `process.env.ALGOKIT_DISPENSER_ACCESS_TOKEN`.\n *\n * Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.\n *\n * @param params An object containing parameters for the TestNetDispenserApiClient class.\n * @example\n * const client = clientManager.getTestNetDispenserFromEnvironment(\n * {\n * requestTimeout: 15,\n * }\n * )\n *\n * @returns An instance of the TestNetDispenserApiClient class.\n */\n public getTestNetDispenserFromEnvironment(params?: Omit<TestNetDispenserApiClientParams, 'authToken'>) {\n return new TestNetDispenserApiClient(params ? { ...params, authToken: '' } : undefined)\n }\n\n /**\n * Returns a new `AppFactory` client\n * @example Basic example\n * ```typescript\n * const factory = algorand.client.getAppFactory({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\/}',\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * const factory = algorand.client.getAppFactory({\n * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,\n * defaultSender: \"SENDERADDRESS\",\n * appName: \"OverriddenAppName\",\n * version: \"2.0.0\",\n * updatable: true,\n * deletable: false,\n * deployTimeParams: { ONE: 1, TWO: 'value' }\n * })\n * ```\n */\n public getAppFactory(params: ClientAppFactoryParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app factory from a ClientManager without an Algorand client')\n }\n\n return new AppFactory({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.\n * This method resolves the app ID by looking up the creator address and name\n * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n * @param params The parameters to create the app client\n * @example Basic\n * ```typescript\n * const appClient = algorand.client.getAppClientByCreatorAndName({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\}',\n * // appId resolved by looking for app ID of named app by this creator\n * creatorAddress: 'CREATORADDRESS',\n * })\n * ```\n * @returns The `AppClient`\n */\n public getAppClientByCreatorAndName(params: ClientResolveAppClientByCreatorAndNameParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return AppClient.fromCreatorAndName({\n ...params,\n algorand: this._algorand,\n })\n }\n\n /**\n * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.\n * @param params The parameters to create the app client\n * @example Basic\n * ```typescript\n * const appClient = algorand.client.getAppClientById({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\}',\n * appId: 12345n,\n * })\n * ```\n * @returns The `AppClient`\n */\n public getAppClientById(params: ClientAppClientParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n return new AppClient({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new `AppClient` client for managing calls and state for an ARC-56 app.\n * This method resolves the app ID for the current network based on\n * pre-determined network-specific app IDs specified in the ARC-56 app spec.\n *\n * If no IDs are in the app spec or the network isn't recognised, an error is thrown.\n * @param params The parameters to create the app client\n * @example Basic\n * ```typescript\n * const appClient = algorand.client.getAppClientByNetwork({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\}',\n * // appId resolved by using ARC-56 spec to find app ID for current network\n * })\n * ```\n * @returns The `AppClient`\n */\n public async getAppClientByNetwork(params: ClientAppClientByNetworkParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n return AppClient.fromNetwork({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed client, resolving the app by creator address and name.\n * @param typedClient The typed client type to use\n * @param params The params to resolve the app by creator address and name\n * @example Use name in ARC-32 / ARC-56 app spec\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {\n * creatorAddress: \"CREATORADDRESS\",\n * defaultSender: alice,\n * })\n * ```\n * @example Specify name\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {\n * creatorAddress: \"CREATORADDRESS\",\n * name: \"contract-name\",\n * defaultSender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public async getTypedAppClientByCreatorAndName<TClient extends TypedAppClient<InstanceType<TClient>>>(\n typedClient: TClient,\n params: ClientTypedAppClientByCreatorAndNameParams,\n ) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return typedClient.fromCreatorAndName({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed client, resolving the app by app ID.\n * @param typedClient The typed client type to use\n * @param params The params to resolve the app by ID\n * @example\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientById(MyContractClient, {\n * appId: 12345n,\n * defaultSender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public getTypedAppClientById<TClient extends TypedAppClient<InstanceType<TClient>>>(\n typedClient: TClient,\n params: ClientTypedAppClientParams,\n ) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return new typedClient({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed client, resolves the app ID for the current network based on\n * pre-determined network-specific app IDs specified in the ARC-56 app spec.\n *\n * If no IDs are in the app spec or the network isn't recognised, an error is thrown.\n * @param typedClient The typed client type to use\n * @param params The params to resolve the app by network\n * @example\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {\n * defaultSender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public getTypedAppClientByNetwork<TClient extends TypedAppClient<InstanceType<TClient>>>(\n typedClient: TClient,\n params?: ClientTypedAppClientByNetworkParams,\n ) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return typedClient.fromNetwork({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed app factory.\n * @param typedFactory The typed factory type to use\n * @param params The params to resolve the factory by\n * @example\n * ```typescript\n * const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {\n * sender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public getTypedAppFactory<TClient>(typedFactory: TypedAppFactory<TClient>, params?: ClientTypedAppFactoryParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app factory from a ClientManager without an Algorand client')\n }\n\n return new typedFactory({ ...params, algorand: this._algorand })\n }\n\n /**\n * Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)\n *\n * 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`.\n *\n * 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`.\n *\n * If only `process.env.INDEXER_SERVER` is defined it will use the default (LocalNet) configuration for both algod and indexer.\n *\n * It will return a KMD configuration that uses `process.env.KMD_PORT` (or port 4002) if `process.env.ALGOD_SERVER` is defined,\n * otherwise it will use the default LocalNet config unless it detects testnet or mainnet.\n * @example\n * ```typescript\n * const config = ClientManager.getConfigFromEnvironmentOrLocalNet()\n * ```\n * @returns The config for algod, indexer and kmd\n */\n public static getConfigFromEnvironmentOrLocalNet(): AlgoConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get default client configuration from a non Node.js context; supply the config instead')\n }\n const [algodConfig, indexerConfig, kmdConfig] = process.env.ALGOD_SERVER\n ? [\n ClientManager.getAlgodConfigFromEnvironment(),\n process.env.INDEXER_SERVER ? ClientManager.getIndexerConfigFromEnvironment() : undefined,\n !process.env.ALGOD_SERVER.includes('mainnet') && !process.env.ALGOD_SERVER.includes('testnet')\n ? { ...ClientManager.getAlgodConfigFromEnvironment(), port: process?.env?.KMD_PORT ?? '4002' }\n : undefined,\n ]\n : [\n ClientManager.getDefaultLocalNetConfig('algod'),\n ClientManager.getDefaultLocalNetConfig('indexer'),\n ClientManager.getDefaultLocalNetConfig('kmd'),\n ]\n\n return {\n algodConfig,\n indexerConfig,\n kmdConfig,\n }\n }\n\n /** Retrieve the algod configuration from environment variables (expects to be called from a Node.js environment)\n *\n * Expects `process.env.ALGOD_SERVER` to be defined, and you can also specify `process.env.ALGOD_PORT` and `process.env.ALGOD_TOKEN`.\n */\n public static getAlgodConfigFromEnvironment(): AlgoClientConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get default algod configuration from a non Node.js context; supply the config instead')\n }\n\n if (!process.env.ALGOD_SERVER) {\n throw new Error('Attempt to get default algod configuration without specifying ALGOD_SERVER in the environment variables')\n }\n\n return {\n server: process.env.ALGOD_SERVER,\n port: process.env.ALGOD_PORT,\n token: process.env.ALGOD_TOKEN,\n }\n }\n\n /**\n * Retrieve the indexer configuration from environment variables (expects to be called from a Node.js environment).\n *\n * Expects `process.env.INDEXER_SERVER` to be defined, and you can also specify `process.env.INDEXER_PORT` and `process.env.INDEXER_TOKEN`.\n */\n public static getIndexerConfigFromEnvironment(): AlgoClientConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get default indexer configuration from a non Node.js context; supply the config instead')\n }\n\n if (!process.env.INDEXER_SERVER) {\n throw new Error('Attempt to get default indexer configuration without specifying INDEXER_SERVER in the environment variables')\n }\n\n return {\n server: process.env.INDEXER_SERVER,\n port: process.env.INDEXER_PORT,\n token: process.env.INDEXER_TOKEN,\n }\n }\n\n /** Returns the Algorand configuration to point to the free tier of the AlgoNode service.\n *\n * @param network Which network to connect to - TestNet or MainNet\n * @param config Which algod config to return - Algod or Indexer\n */\n public static getAlgoNodeConfig(network: 'testnet' | 'mainnet', config: 'algod' | 'indexer'): AlgoClientConfig {\n return {\n server: `https://${network}-${config === 'algod' ? 'api' : 'idx'}.algonode.cloud/`,\n port: 443,\n }\n }\n\n /** Returns the Algorand configuration to point to the default LocalNet.\n *\n * @param configOrPort Which algod config to return - algod, kmd, or indexer OR a port number\n */\n public static getDefaultLocalNetConfig(configOrPort: 'algod' | 'indexer' | 'kmd' | number): AlgoClientConfig {\n return {\n server: `http://localhost`,\n port: configOrPort === 'algod' ? 4001 : configOrPort === 'indexer' ? 8980 : configOrPort === 'kmd' ? 4002 : configOrPort,\n token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',\n }\n }\n\n /**\n * Returns an algod SDK client that automatically retries on idempotent calls.\n *\n * @param config The config of the client\n * @example AlgoNode (testnet)\n * ```typescript\n * const algod = ClientManager.getAlgodClient(ClientManager.getAlgoNodeConfig('testnet', 'algod'))\n * await algod.healthCheck().do()\n * ```\n * @example AlgoNode (mainnet)\n * ```typescript\n * const algod = ClientManager.getAlgodClient(ClientManager.getAlgoNodeConfig('mainnet', 'algod'))\n * await algod.healthCheck().do()\n * ```\n * @example Custom (e.g. default LocalNet)\n * ```typescript\n * const algod = ClientManager.getAlgodClient({server: 'http://localhost', port: '4001', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})\n * await algod.healthCheck().do()\n * ```\n */\n public static getAlgodClient(config: AlgoClientConfig): Algodv2 {\n const { token, server, port } = config\n const tokenHeader = typeof token === 'string' ? { 'X-Algo-API-Token': token } : token ?? {}\n const httpClientWithRetry = new AlgoHttpClientWithRetry(tokenHeader, server, port)\n return new algosdk.Algodv2(httpClientWithRetry, server)\n }\n\n /**\n * Returns an algod SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).\n *\n * @example\n * ```typescript\n * // Uses process.env.ALGOD_SERVER, process.env.ALGOD_PORT and process.env.ALGOD_TOKEN\n * const algod = ClientManager.getAlgodClientFromEnvironment()\n * await algod.healthCheck().do()\n * ```\n */\n public static getAlgodClientFromEnvironment(): Algodv2 {\n return ClientManager.getAlgodClient(ClientManager.getAlgodConfigFromEnvironment())\n }\n\n /**\n * Returns an indexer SDK client that automatically retries on idempotent calls\n *\n * @param config The config of the client\n * @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers\n * @example AlgoNode (testnet)\n * ```typescript\n * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('testnet', 'indexer'))\n * await indexer.makeHealthCheck().do()\n * ```\n * @example AlgoNode (mainnet)\n * ```typescript\n * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('mainnet', 'indexer'))\n * await indexer.makeHealthCheck().do()\n * ```\n * @example Custom (e.g. default LocalNet, although we recommend loading this into a .env and using the Default option instead)\n * ```typescript\n * const indexer = ClientManager.getIndexerClient({server: 'http://localhost', port: '8980', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})\n * await indexer.makeHealthCheck().do()\n * ```\n * @example Override int decoding for responses\n * ```typescript\n * const indexer = ClientManager.getIndexerClient(config, IntDecoding.BIGINT)\n * ```\n */\n public static getIndexerClient(config: AlgoClientConfig, overrideIntDecoding?: IntDecoding): Indexer {\n const { token, server, port } = config\n const tokenHeader = typeof token === 'string' ? { 'X-Indexer-API-Token': token } : token ?? {}\n const httpClientWithRetry = new AlgoHttpClientWithRetry(tokenHeader, server, port)\n const indexer = new Indexer(httpClientWithRetry)\n // Use mixed int decoding by default so bigints don't have lost precision\n indexer.setIntEncoding(overrideIntDecoding ?? IntDecoding.MIXED)\n return indexer\n }\n\n /**\n * Returns an indexer SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).\n *\n * @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers\n * @example\n *\n * ```typescript\n * // Uses process.env.INDEXER_SERVER, process.env.INDEXER_PORT and process.env.INDEXER_TOKEN\n * const indexer = ClientManager.getIndexerClientFromEnvironment()\n * await indexer.makeHealthCheck().do()\n * ```\n */\n public static getIndexerClientFromEnvironment(overrideIntDecoding?: IntDecoding): Indexer {\n return ClientManager.getIndexerClient(ClientManager.getIndexerConfigFromEnvironment(), overrideIntDecoding)\n }\n\n /**\n * Returns a KMD SDK client.\n *\n * KMD client allows you to export private keys, which is useful to (for instance) get the default account in a LocalNet network.\n *\n * @param config The config for the client\n * @example Custom (e.g. default LocalNet, although we recommend loading this into a .env and using the Default option instead)\n * ```typescript\n * const kmd = ClientManager.getKmdClient({server: 'http://localhost', port: '4002', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})\n * ```\n */\n public static getKmdClient(config: AlgoClientConfig): Kmd {\n const { token, server, port } = config\n return new Kmd(token as string, server, port)\n }\n\n /**\n * Returns a KMD SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).\n *\n * @example\n * ```typescript\n * // Uses process.env.ALGOD_SERVER, process.env.KMD_PORT (or if not specified: port 4002) and process.env.ALGOD_TOKEN\n * const kmd = ClientManager.getKmdClientFromEnvironment()\n * ```\n */\n public static getKmdClientFromEnvironment(): Kmd {\n // We can only use Kmd on the LocalNet otherwise it's not exposed so this makes some assumptions\n // (e.g. same token and server as algod and port 4002 by default)\n return ClientManager.getKmdClient({ ...ClientManager.getAlgodConfigFromEnvironment(), port: process?.env?.KMD_PORT ?? '4002' })\n }\n}\n\n/**\n * Interface to identify a typed client that can be used to interact with an application.\n */\nexport interface TypedAppClient<TClient> {\n new (params: Omit<AppClientParams, 'appSpec'>): TClient\n fromNetwork(params: Omit<AppClientParams, 'appId' | 'appSpec'>): Promise<TClient>\n fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<TClient>\n}\n\n/**\n * Interface to identify a typed factory that can be used to create and deploy an application.\n */\nexport interface TypedAppFactory<TClient> {\n new (params: Omit<AppFactoryParams, 'appSpec'>): TClient\n}\n"],"names":["genesisIdIsLocalNet","TestNetDispenserApiClient","AppFactory","AppClient","AlgoHttpClientWithRetry"],"mappings":";;;;;;;;;AASA,IAAO,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;AACxB,IAAO,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAEhC,IAAO,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;AAoCxC;MACa,aAAa,CAAA;AAMxB;;;;;;;;;;;;;;;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