@algorandfoundation/algokit-utils 6.2.1 → 7.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (465) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -26
  3. package/account/account.d.ts +21 -11
  4. package/account/get-account-config-from-environment.d.ts +0 -1
  5. package/account/get-account.d.ts +6 -7
  6. package/account/get-dispenser-account.d.ts +2 -3
  7. package/account/index.d.ts +0 -1
  8. package/account/mnemonic-account.d.ts +1 -2
  9. package/amount.d.ts +41 -9
  10. package/app-client.d.ts +19 -5
  11. package/app-deploy.d.ts +18 -2
  12. package/app.d.ts +39 -3
  13. package/asset.d.ts +10 -1
  14. package/config.d.ts +0 -1
  15. package/debugging/debugging.d.ts +3 -5
  16. package/debugging/index.d.ts +0 -2
  17. package/dispenser-client.d.ts +1 -2
  18. package/index.d.ts +8 -6
  19. package/index.js +61 -48
  20. package/index.js.map +1 -1
  21. package/index.mjs +27 -24
  22. package/index.mjs.map +1 -1
  23. package/indexer-lookup.d.ts +10 -9
  24. package/localnet/get-kmd-wallet-account.d.ts +1 -2
  25. package/localnet/get-localnet-dispenser-account.d.ts +1 -2
  26. package/localnet/get-or-create-kmd-wallet-account.d.ts +2 -3
  27. package/localnet/index.d.ts +0 -1
  28. package/localnet/is-localnet.d.ts +1 -2
  29. package/network-client.d.ts +3 -10
  30. package/package.json +5 -5
  31. package/{account → src/account}/account.js +38 -15
  32. package/src/account/account.js.map +1 -0
  33. package/{account → src/account}/account.mjs +39 -16
  34. package/src/account/account.mjs.map +1 -0
  35. package/src/account/get-account-config-from-environment.js.map +1 -0
  36. package/src/account/get-account-config-from-environment.mjs.map +1 -0
  37. package/{account → src/account}/get-account.js +5 -5
  38. package/src/account/get-account.js.map +1 -0
  39. package/{account → src/account}/get-account.mjs +5 -5
  40. package/src/account/get-account.mjs.map +1 -0
  41. package/{account → src/account}/get-dispenser-account.js +3 -3
  42. package/src/account/get-dispenser-account.js.map +1 -0
  43. package/{account → src/account}/get-dispenser-account.mjs +3 -3
  44. package/src/account/get-dispenser-account.mjs.map +1 -0
  45. package/{account → src/account}/mnemonic-account.js +1 -1
  46. package/src/account/mnemonic-account.js.map +1 -0
  47. package/{account → src/account}/mnemonic-account.mjs +1 -1
  48. package/src/account/mnemonic-account.mjs.map +1 -0
  49. package/src/amount.js +61 -0
  50. package/src/amount.js.map +1 -0
  51. package/src/amount.mjs +54 -0
  52. package/src/amount.mjs.map +1 -0
  53. package/{app-client.js → src/app-client.js} +20 -5
  54. package/src/app-client.js.map +1 -0
  55. package/{app-client.mjs → src/app-client.mjs} +20 -5
  56. package/src/app-client.mjs.map +1 -0
  57. package/src/app-deploy.js +285 -0
  58. package/src/app-deploy.js.map +1 -0
  59. package/src/app-deploy.mjs +276 -0
  60. package/src/app-deploy.mjs.map +1 -0
  61. package/src/app.js +349 -0
  62. package/src/app.js.map +1 -0
  63. package/src/app.mjs +329 -0
  64. package/src/app.mjs.map +1 -0
  65. package/src/asset.js +142 -0
  66. package/src/asset.js.map +1 -0
  67. package/src/asset.mjs +136 -0
  68. package/src/asset.mjs.map +1 -0
  69. package/{config.js → src/config.js} +1 -1
  70. package/src/config.js.map +1 -0
  71. package/{config.mjs → src/config.mjs} +1 -1
  72. package/src/config.mjs.map +1 -0
  73. package/src/debugging/debugging.js +15 -0
  74. package/src/debugging/debugging.js.map +1 -0
  75. package/src/debugging/debugging.mjs +13 -0
  76. package/src/debugging/debugging.mjs.map +1 -0
  77. package/{dispenser-client.js → src/dispenser-client.js} +3 -3
  78. package/src/dispenser-client.js.map +1 -0
  79. package/{dispenser-client.mjs → src/dispenser-client.mjs} +3 -3
  80. package/src/dispenser-client.mjs.map +1 -0
  81. package/{indexer-lookup.js → src/indexer-lookup.js} +14 -10
  82. package/src/indexer-lookup.js.map +1 -0
  83. package/{indexer-lookup.mjs → src/indexer-lookup.mjs} +14 -10
  84. package/src/indexer-lookup.mjs.map +1 -0
  85. package/{localnet → src/localnet}/get-kmd-wallet-account.js +3 -3
  86. package/src/localnet/get-kmd-wallet-account.js.map +1 -0
  87. package/{localnet → src/localnet}/get-kmd-wallet-account.mjs +3 -3
  88. package/src/localnet/get-kmd-wallet-account.mjs.map +1 -0
  89. package/{localnet → src/localnet}/get-localnet-dispenser-account.js +3 -3
  90. package/src/localnet/get-localnet-dispenser-account.js.map +1 -0
  91. package/{localnet → src/localnet}/get-localnet-dispenser-account.mjs +3 -3
  92. package/src/localnet/get-localnet-dispenser-account.mjs.map +1 -0
  93. package/{localnet → src/localnet}/get-or-create-kmd-wallet-account.js +4 -4
  94. package/src/localnet/get-or-create-kmd-wallet-account.js.map +1 -0
  95. package/{localnet → src/localnet}/get-or-create-kmd-wallet-account.mjs +4 -4
  96. package/src/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -0
  97. package/{localnet → src/localnet}/is-localnet.js +2 -2
  98. package/src/localnet/is-localnet.js.map +1 -0
  99. package/{localnet → src/localnet}/is-localnet.mjs +2 -2
  100. package/src/localnet/is-localnet.mjs.map +1 -0
  101. package/{network-client.js → src/network-client.js} +5 -12
  102. package/src/network-client.js.map +1 -0
  103. package/{network-client.mjs → src/network-client.mjs} +5 -12
  104. package/src/network-client.mjs.map +1 -0
  105. package/{testing → src/testing}/account.js +16 -4
  106. package/src/testing/account.js.map +1 -0
  107. package/{testing → src/testing}/account.mjs +17 -5
  108. package/src/testing/account.mjs.map +1 -0
  109. package/src/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
  110. package/src/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -0
  111. package/{testing → src/testing}/fixtures/algorand-fixture.js +18 -14
  112. package/src/testing/fixtures/algorand-fixture.js.map +1 -0
  113. package/{testing → src/testing}/fixtures/algorand-fixture.mjs +18 -14
  114. package/src/testing/fixtures/algorand-fixture.mjs.map +1 -0
  115. package/src/testing/indexer.js.map +1 -0
  116. package/src/testing/indexer.mjs.map +1 -0
  117. package/{testing → src/testing}/test-logger.js +7 -3
  118. package/src/testing/test-logger.js.map +1 -0
  119. package/{testing → src/testing}/test-logger.mjs +7 -3
  120. package/src/testing/test-logger.mjs.map +1 -0
  121. package/src/testing/transaction-logger.js.map +1 -0
  122. package/src/testing/transaction-logger.mjs.map +1 -0
  123. package/src/transaction/legacy-bridge.js +129 -0
  124. package/src/transaction/legacy-bridge.js.map +1 -0
  125. package/src/transaction/legacy-bridge.mjs +124 -0
  126. package/src/transaction/legacy-bridge.mjs.map +1 -0
  127. package/{transaction → src/transaction}/perform-atomic-transaction-composer-simulate.js +14 -9
  128. package/src/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -0
  129. package/{transaction → src/transaction}/perform-atomic-transaction-composer-simulate.mjs +15 -10
  130. package/src/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -0
  131. package/{transaction → src/transaction}/transaction.js +221 -141
  132. package/src/transaction/transaction.js.map +1 -0
  133. package/{transaction → src/transaction}/transaction.mjs +222 -142
  134. package/src/transaction/transaction.mjs.map +1 -0
  135. package/src/transfer/transfer-algos.js +31 -0
  136. package/src/transfer/transfer-algos.js.map +1 -0
  137. package/src/transfer/transfer-algos.mjs +29 -0
  138. package/src/transfer/transfer-algos.mjs.map +1 -0
  139. package/src/transfer/transfer.js +112 -0
  140. package/src/transfer/transfer.js.map +1 -0
  141. package/src/transfer/transfer.mjs +108 -0
  142. package/src/transfer/transfer.mjs.map +1 -0
  143. package/{util.js → src/util.js} +33 -7
  144. package/src/util.js.map +1 -0
  145. package/{util.mjs → src/util.mjs} +31 -7
  146. package/src/util.mjs.map +1 -0
  147. package/testing/_asset.d.ts +3 -5
  148. package/testing/account.d.ts +4 -4
  149. package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
  150. package/testing/fixtures/algorand-fixture.d.ts +1 -2
  151. package/testing/fixtures/index.d.ts +0 -1
  152. package/testing/index.d.ts +0 -1
  153. package/testing/index.js +6 -6
  154. package/testing/index.mjs +6 -6
  155. package/testing/indexer.d.ts +0 -1
  156. package/testing/test-logger.d.ts +0 -1
  157. package/testing/transaction-logger.d.ts +0 -1
  158. package/transaction/index.d.ts +0 -1
  159. package/transaction/legacy-bridge.d.ts +35 -0
  160. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +4 -2
  161. package/transaction/transaction.d.ts +39 -20
  162. package/transfer/index.d.ts +0 -1
  163. package/transfer/transfer-algos.d.ts +4 -3
  164. package/transfer/transfer.d.ts +8 -2
  165. package/types/account-manager.d.ts +165 -40
  166. package/types/account-manager.js +255 -59
  167. package/types/account-manager.js.map +1 -1
  168. package/types/account-manager.mjs +255 -59
  169. package/types/account-manager.mjs.map +1 -1
  170. package/types/account.d.ts +137 -14
  171. package/types/account.js +2 -2
  172. package/types/account.js.map +1 -1
  173. package/types/account.mjs +3 -3
  174. package/types/account.mjs.map +1 -1
  175. package/types/algo-http-client-with-retry.d.ts +1 -3
  176. package/types/algo-http-client-with-retry.js +34 -4
  177. package/types/algo-http-client-with-retry.js.map +1 -1
  178. package/types/algo-http-client-with-retry.mjs +33 -3
  179. package/types/algo-http-client-with-retry.mjs.map +1 -1
  180. package/types/algorand-client-interface.d.ts +28 -0
  181. package/types/algorand-client-interface.js +3 -0
  182. package/types/algorand-client-interface.js.map +1 -0
  183. package/types/algorand-client-interface.mjs +2 -0
  184. package/types/algorand-client-interface.mjs.map +1 -0
  185. package/types/algorand-client-transaction-creator.d.ts +718 -0
  186. package/types/algorand-client-transaction-creator.js +683 -0
  187. package/types/algorand-client-transaction-creator.js.map +1 -0
  188. package/types/algorand-client-transaction-creator.mjs +681 -0
  189. package/types/algorand-client-transaction-creator.mjs.map +1 -0
  190. package/types/algorand-client-transaction-sender.d.ts +1158 -0
  191. package/types/algorand-client-transaction-sender.js +852 -0
  192. package/types/algorand-client-transaction-sender.js.map +1 -0
  193. package/types/algorand-client-transaction-sender.mjs +850 -0
  194. package/types/algorand-client-transaction-sender.mjs.map +1 -0
  195. package/types/algorand-client.d.ts +48 -91
  196. package/types/algorand-client.js +53 -132
  197. package/types/algorand-client.js.map +1 -1
  198. package/types/algorand-client.mjs +55 -131
  199. package/types/algorand-client.mjs.map +1 -1
  200. package/types/amount.d.ts +23 -12
  201. package/types/amount.js +33 -10
  202. package/types/amount.js.map +1 -1
  203. package/types/amount.mjs +33 -10
  204. package/types/amount.mjs.map +1 -1
  205. package/types/app-arc56.d.ts +359 -0
  206. package/types/app-arc56.js +184 -0
  207. package/types/app-arc56.js.map +1 -0
  208. package/types/app-arc56.mjs +175 -0
  209. package/types/app-arc56.mjs.map +1 -0
  210. package/types/app-client.d.ts +1511 -15
  211. package/types/app-client.js +1029 -43
  212. package/types/app-client.js.map +1 -1
  213. package/types/app-client.mjs +1030 -45
  214. package/types/app-client.mjs.map +1 -1
  215. package/types/app-deployer.d.ts +126 -0
  216. package/types/app-deployer.js +353 -0
  217. package/types/app-deployer.js.map +1 -0
  218. package/types/app-deployer.mjs +351 -0
  219. package/types/app-deployer.mjs.map +1 -0
  220. package/types/app-factory.d.ts +846 -0
  221. package/types/app-factory.js +410 -0
  222. package/types/app-factory.js.map +1 -0
  223. package/types/app-factory.mjs +408 -0
  224. package/types/app-factory.mjs.map +1 -0
  225. package/types/app-manager.d.ts +244 -0
  226. package/types/app-manager.js +423 -0
  227. package/types/app-manager.js.map +1 -0
  228. package/types/app-manager.mjs +421 -0
  229. package/types/app-manager.mjs.map +1 -0
  230. package/types/app-spec.d.ts +2 -1
  231. package/types/app-spec.js +127 -0
  232. package/types/app-spec.js.map +1 -1
  233. package/types/app-spec.mjs +126 -0
  234. package/types/app-spec.mjs.map +1 -1
  235. package/types/app.d.ts +57 -18
  236. package/types/app.js +1 -1
  237. package/types/app.js.map +1 -1
  238. package/types/app.mjs +1 -1
  239. package/types/app.mjs.map +1 -1
  240. package/types/asset-manager.d.ts +205 -0
  241. package/types/asset-manager.js +176 -0
  242. package/types/asset-manager.js.map +1 -0
  243. package/types/asset-manager.mjs +174 -0
  244. package/types/asset-manager.mjs.map +1 -0
  245. package/types/asset.d.ts +4 -5
  246. package/types/async-event-emitter.d.ts +14 -0
  247. package/types/async-event-emitter.js +50 -0
  248. package/types/async-event-emitter.js.map +1 -0
  249. package/types/async-event-emitter.mjs +48 -0
  250. package/types/async-event-emitter.mjs.map +1 -0
  251. package/types/client-manager.d.ts +171 -58
  252. package/types/client-manager.js +198 -43
  253. package/types/client-manager.js.map +1 -1
  254. package/types/client-manager.mjs +199 -44
  255. package/types/client-manager.mjs.map +1 -1
  256. package/types/composer.d.ts +474 -132
  257. package/types/composer.js +461 -167
  258. package/types/composer.js.map +1 -1
  259. package/types/composer.mjs +461 -168
  260. package/types/composer.mjs.map +1 -1
  261. package/types/config.d.ts +3 -6
  262. package/types/config.js +5 -44
  263. package/types/config.js.map +1 -1
  264. package/types/config.mjs +5 -27
  265. package/types/config.mjs.map +1 -1
  266. package/types/debugging.d.ts +29 -101
  267. package/types/debugging.js +16 -109
  268. package/types/debugging.js.map +1 -1
  269. package/types/debugging.mjs +12 -107
  270. package/types/debugging.mjs.map +1 -1
  271. package/types/dispenser-client.d.ts +14 -6
  272. package/types/dispenser-client.js +19 -14
  273. package/types/dispenser-client.js.map +1 -1
  274. package/types/dispenser-client.mjs +19 -14
  275. package/types/dispenser-client.mjs.map +1 -1
  276. package/types/expand.d.ts +7 -0
  277. package/types/expand.js +3 -0
  278. package/types/expand.js.map +1 -0
  279. package/types/expand.mjs +2 -0
  280. package/types/expand.mjs.map +1 -0
  281. package/types/indexer.d.ts +74 -756
  282. package/types/indexer.js.map +1 -1
  283. package/types/indexer.mjs.map +1 -1
  284. package/types/kmd-account-manager.d.ts +5 -6
  285. package/types/kmd-account-manager.js +9 -9
  286. package/types/kmd-account-manager.js.map +1 -1
  287. package/types/kmd-account-manager.mjs +10 -10
  288. package/types/kmd-account-manager.mjs.map +1 -1
  289. package/types/lifecycle-events.d.ts +10 -0
  290. package/types/lifecycle-events.js +8 -0
  291. package/types/lifecycle-events.js.map +1 -0
  292. package/types/lifecycle-events.mjs +8 -0
  293. package/types/lifecycle-events.mjs.map +1 -0
  294. package/types/logging.d.ts +0 -1
  295. package/types/logging.js.map +1 -1
  296. package/types/logging.mjs.map +1 -1
  297. package/types/logic-error.d.ts +2 -4
  298. package/types/logic-error.js +3 -3
  299. package/types/logic-error.js.map +1 -1
  300. package/types/logic-error.mjs +3 -3
  301. package/types/logic-error.mjs.map +1 -1
  302. package/types/network-client.d.ts +21 -3
  303. package/types/network-client.js +10 -0
  304. package/types/network-client.js.map +1 -1
  305. package/types/network-client.mjs +9 -0
  306. package/types/network-client.mjs.map +1 -1
  307. package/types/testing.d.ts +9 -11
  308. package/types/transaction.d.ts +17 -4
  309. package/types/transfer.d.ts +8 -8
  310. package/util.d.ts +15 -2
  311. package/account/account.d.ts.map +0 -1
  312. package/account/account.js.map +0 -1
  313. package/account/account.mjs.map +0 -1
  314. package/account/get-account-config-from-environment.d.ts.map +0 -1
  315. package/account/get-account-config-from-environment.js.map +0 -1
  316. package/account/get-account-config-from-environment.mjs.map +0 -1
  317. package/account/get-account.d.ts.map +0 -1
  318. package/account/get-account.js.map +0 -1
  319. package/account/get-account.mjs.map +0 -1
  320. package/account/get-dispenser-account.d.ts.map +0 -1
  321. package/account/get-dispenser-account.js.map +0 -1
  322. package/account/get-dispenser-account.mjs.map +0 -1
  323. package/account/index.d.ts.map +0 -1
  324. package/account/mnemonic-account.d.ts.map +0 -1
  325. package/account/mnemonic-account.js.map +0 -1
  326. package/account/mnemonic-account.mjs.map +0 -1
  327. package/amount.d.ts.map +0 -1
  328. package/amount.js +0 -34
  329. package/amount.js.map +0 -1
  330. package/amount.mjs +0 -30
  331. package/amount.mjs.map +0 -1
  332. package/app-client.d.ts.map +0 -1
  333. package/app-client.js.map +0 -1
  334. package/app-client.mjs.map +0 -1
  335. package/app-deploy.d.ts.map +0 -1
  336. package/app-deploy.js +0 -468
  337. package/app-deploy.js.map +0 -1
  338. package/app-deploy.mjs +0 -459
  339. package/app-deploy.mjs.map +0 -1
  340. package/app.d.ts.map +0 -1
  341. package/app.js +0 -599
  342. package/app.js.map +0 -1
  343. package/app.mjs +0 -579
  344. package/app.mjs.map +0 -1
  345. package/asset.d.ts.map +0 -1
  346. package/asset.js +0 -272
  347. package/asset.js.map +0 -1
  348. package/asset.mjs +0 -266
  349. package/asset.mjs.map +0 -1
  350. package/config.d.ts.map +0 -1
  351. package/config.js.map +0 -1
  352. package/config.mjs.map +0 -1
  353. package/debugging/debugging.d.ts.map +0 -1
  354. package/debugging/debugging.js +0 -139
  355. package/debugging/debugging.js.map +0 -1
  356. package/debugging/debugging.mjs +0 -118
  357. package/debugging/debugging.mjs.map +0 -1
  358. package/debugging/index.d.ts.map +0 -1
  359. package/debugging/simulate-and-persist-response.d.ts +0 -20
  360. package/debugging/simulate-and-persist-response.d.ts.map +0 -1
  361. package/debugging/simulate-and-persist-response.js +0 -108
  362. package/debugging/simulate-and-persist-response.js.map +0 -1
  363. package/debugging/simulate-and-persist-response.mjs +0 -89
  364. package/debugging/simulate-and-persist-response.mjs.map +0 -1
  365. package/dispenser-client.d.ts.map +0 -1
  366. package/dispenser-client.js.map +0 -1
  367. package/dispenser-client.mjs.map +0 -1
  368. package/index.d.ts.map +0 -1
  369. package/indexer-lookup.d.ts.map +0 -1
  370. package/indexer-lookup.js.map +0 -1
  371. package/indexer-lookup.mjs.map +0 -1
  372. package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
  373. package/localnet/get-kmd-wallet-account.js.map +0 -1
  374. package/localnet/get-kmd-wallet-account.mjs.map +0 -1
  375. package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
  376. package/localnet/get-localnet-dispenser-account.js.map +0 -1
  377. package/localnet/get-localnet-dispenser-account.mjs.map +0 -1
  378. package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
  379. package/localnet/get-or-create-kmd-wallet-account.js.map +0 -1
  380. package/localnet/get-or-create-kmd-wallet-account.mjs.map +0 -1
  381. package/localnet/index.d.ts.map +0 -1
  382. package/localnet/is-localnet.d.ts.map +0 -1
  383. package/localnet/is-localnet.js.map +0 -1
  384. package/localnet/is-localnet.mjs.map +0 -1
  385. package/network-client.d.ts.map +0 -1
  386. package/network-client.js.map +0 -1
  387. package/network-client.mjs.map +0 -1
  388. package/testing/_asset.d.ts.map +0 -1
  389. package/testing/account.d.ts.map +0 -1
  390. package/testing/account.js.map +0 -1
  391. package/testing/account.mjs.map +0 -1
  392. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
  393. package/testing/fixtures/algokit-log-capture-fixture.js.map +0 -1
  394. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +0 -1
  395. package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
  396. package/testing/fixtures/algorand-fixture.js.map +0 -1
  397. package/testing/fixtures/algorand-fixture.mjs.map +0 -1
  398. package/testing/fixtures/index.d.ts.map +0 -1
  399. package/testing/index.d.ts.map +0 -1
  400. package/testing/indexer.d.ts.map +0 -1
  401. package/testing/indexer.js.map +0 -1
  402. package/testing/indexer.mjs.map +0 -1
  403. package/testing/test-logger.d.ts.map +0 -1
  404. package/testing/test-logger.js.map +0 -1
  405. package/testing/test-logger.mjs.map +0 -1
  406. package/testing/transaction-logger.d.ts.map +0 -1
  407. package/testing/transaction-logger.js.map +0 -1
  408. package/testing/transaction-logger.mjs.map +0 -1
  409. package/transaction/index.d.ts.map +0 -1
  410. package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
  411. package/transaction/perform-atomic-transaction-composer-simulate.js.map +0 -1
  412. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +0 -1
  413. package/transaction/transaction.d.ts.map +0 -1
  414. package/transaction/transaction.js.map +0 -1
  415. package/transaction/transaction.mjs.map +0 -1
  416. package/transfer/index.d.ts.map +0 -1
  417. package/transfer/transfer-algos.d.ts.map +0 -1
  418. package/transfer/transfer-algos.js +0 -40
  419. package/transfer/transfer-algos.js.map +0 -1
  420. package/transfer/transfer-algos.mjs +0 -38
  421. package/transfer/transfer-algos.mjs.map +0 -1
  422. package/transfer/transfer.d.ts.map +0 -1
  423. package/transfer/transfer.js +0 -147
  424. package/transfer/transfer.js.map +0 -1
  425. package/transfer/transfer.mjs +0 -143
  426. package/transfer/transfer.mjs.map +0 -1
  427. package/types/account-manager.d.ts.map +0 -1
  428. package/types/account.d.ts.map +0 -1
  429. package/types/algo-http-client-with-retry.d.ts.map +0 -1
  430. package/types/algorand-client.d.ts.map +0 -1
  431. package/types/amount.d.ts.map +0 -1
  432. package/types/app-client.d.ts.map +0 -1
  433. package/types/app-spec.d.ts.map +0 -1
  434. package/types/app.d.ts.map +0 -1
  435. package/types/asset.d.ts.map +0 -1
  436. package/types/client-manager.d.ts.map +0 -1
  437. package/types/composer.d.ts.map +0 -1
  438. package/types/config.d.ts.map +0 -1
  439. package/types/debugging.d.ts.map +0 -1
  440. package/types/dispenser-client.d.ts.map +0 -1
  441. package/types/indexer.d.ts.map +0 -1
  442. package/types/kmd-account-manager.d.ts.map +0 -1
  443. package/types/logging.d.ts.map +0 -1
  444. package/types/logic-error.d.ts.map +0 -1
  445. package/types/network-client.d.ts.map +0 -1
  446. package/types/testing.d.ts.map +0 -1
  447. package/types/transaction.d.ts.map +0 -1
  448. package/types/transfer.d.ts.map +0 -1
  449. package/types/urlTokenBaseHTTPClient.d.ts +0 -41
  450. package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
  451. package/types/urlTokenBaseHTTPClient.js +0 -153
  452. package/types/urlTokenBaseHTTPClient.js.map +0 -1
  453. package/types/urlTokenBaseHTTPClient.mjs +0 -151
  454. package/types/urlTokenBaseHTTPClient.mjs.map +0 -1
  455. package/util.d.ts.map +0 -1
  456. package/util.js.map +0 -1
  457. package/util.mjs.map +0 -1
  458. /package/{account → src/account}/get-account-config-from-environment.js +0 -0
  459. /package/{account → src/account}/get-account-config-from-environment.mjs +0 -0
  460. /package/{testing → src/testing}/fixtures/algokit-log-capture-fixture.js +0 -0
  461. /package/{testing → src/testing}/fixtures/algokit-log-capture-fixture.mjs +0 -0
  462. /package/{testing → src/testing}/indexer.js +0 -0
  463. /package/{testing → src/testing}/indexer.mjs +0 -0
  464. /package/{testing → src/testing}/transaction-logger.js +0 -0
  465. /package/{testing → src/testing}/transaction-logger.mjs +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.js","sources":["../../src/types/indexer.ts"],"sourcesContent":[null],"names":["ApplicationOnComplete","SignatureType","AccountStatus"],"mappings":";;AA+rBA;AACYA,uCAOX;AAPD,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACnB,CAAC,EAPWA,6BAAqB,KAArBA,6BAAqB,GAOhC,EAAA,CAAA,CAAA,CAAA;AA6ED;AACYC,+BAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA,CAAA;AAED;AACYC,+BAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;;AAEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACvC,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA;;"}
1
+ {"version":3,"file":"indexer.js","sources":["../../src/types/indexer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport indexerModels = algosdk.indexerModels\n\n/** @deprecated Use `algosdk.indexerModels.TransactionsResponse`. Indexer result for a transaction search, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */\nexport type TransactionSearchResults = indexerModels.TransactionsResponse\n\n/** @deprecated Use `algosdk.indexerModels.AccountResponse`. Indexer result for an account lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */\nexport type AccountLookupResult = indexerModels.AccountResponse\n\n/** @deprecated Use `algosdk.indexerModels.AssetHoldingsResponse`. Indexer result for an account's asset holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */\nexport type AssetsLookupResult = indexerModels.AssetHoldingsResponse\n\n/** @deprecated Use `algosdk.indexerModels.AssetsResponse`. Indexer result for an account's created assets, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */\nexport type AssetsCreatedLookupResult = indexerModels.AssetsResponse\n\n/** @deprecated Use `algosdk.indexerModels.ApplicationsResponse`. Indexer result for an account's created applications, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */\nexport type ApplicationCreatedLookupResult = indexerModels.ApplicationsResponse\n\n/** @deprecated Use `algosdk.indexerModels.AssetResponse`. Indexer result for an asset lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */\nexport type AssetLookupResult = indexerModels.AssetResponse\n\n/** Options when looking up an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface LookupAssetHoldingsOptions {\n /** Results should have a decimal units amount less than this value. */\n currencyLessThan?: number | bigint\n /** Results should have a decimal units amount greater than this value. */\n currencyGreaterThan?: number | bigint\n /** Include all items including closed accounts and opted-out asset holdings. */\n includeAll?: boolean\n}\n\n/** @deprecated Use `algosdk.indexerModels.AssetBalancesResponse`. Indexer result for an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport type AssetBalancesLookupResult = indexerModels.AssetBalancesResponse\n\n/** @deprecated Use `algosdk.indexerModels.TransactionResponse`. Indexer result for a transaction lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */\nexport type TransactionLookupResult = indexerModels.TransactionResponse\n\n/** @deprecated Use `algosdk.indexerModels.ApplicationResponse`. Indexer result for an application lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */\nexport type ApplicationLookupResult = indexerModels.ApplicationResponse\n\n/** @deprecated Use `algosdk.indexerModels.Transaction`. Indexer result for a transaction, https://developer.algorand.org/docs/rest-apis/indexer/#transaction */\nexport type TransactionResult = indexerModels.Transaction\n\n/** @deprecated Use `algosdk.indexerModels.Account`. Indexer Account information at a given round https://developer.algorand.org/docs/rest-apis/indexer/#account */\nexport type AccountResult = indexerModels.Account\n\n/** @deprecated Use `algosdk.indexerModels.TransactionPayment`. Indexer Fields for a payment transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionpayment */\nexport type PaymentTransactionResult = indexerModels.TransactionPayment\n\n/** @deprecated Use `algosdk.indexerModels.TransactionStateProof`. Indexer Fields for a state proof transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionstateproof.\n *\n * See also https://developer.algorand.org/docs/get-details/stateproofs/,\n * https://developer.algorand.org/docs/get-details/stateproofs/light_client/,\n * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,\n * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,\n * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and\n * https://developer.algorand.org/docs/rest-apis/algod/#stateproof.\n */\nexport type StateProofTransactionResult = indexerModels.TransactionStateProof\n\n/** @deprecated Use `algosdk.indexerModels.MerkleArrayProof`. Indexer Merkle array Proof.\n *\n * Proof is used to convince a verifier about membership of leaves: h0,h1...hn\n * at indexes i0,i1...in on a tree. The verifier has a trusted value of the tree\n * root hash.\n *\n * Path is bounded by MaxNumLeaves since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxTreeDepth / 2\n *\n * Consider two different reveals for the same tree:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^\n * . hints: [a, r, z, z4]\n * . len(hints) = 4\n * ```\n * You need a to combine with b to get q, need r to combine with the computed q and get y, and so on.\n *\n * The worst case is this:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^ ^ ^ ^ ^ ^ ^ ^\n * .\n * . hints: [b, d, e, g, j, l, m, o]\n * . len(hints) = 2^4/2\n * ```\n */\nexport type MerkleArrayProof = indexerModels.MerkleArrayProof\n\n/** @deprecated Use `algosdk.indexerModels.TransactionApplication`. Indexer Fields for an application transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionapplication */\nexport type ApplicationTransactionResult = indexerModels.TransactionApplication\n\n/** @deprecated Use `algosdk.indexerModels.TransactionAssetConfig`. Indexer Fields for asset allocation, re-configuration, and destruction.\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetconfig\n *\n * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.\n */\nexport type AssetConfigTransactionResult = indexerModels.TransactionAssetConfig\n\n/** @deprecated Use `algosdk.indexerModels.TransactionAssetFreeze`. Indexer Fields for an asset freeze transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetfreeze */\nexport type AssetFreezeTransactionResult = indexerModels.TransactionAssetFreeze\n\n/** @deprecated Use `algosdk.indexerModels.TransactionAssetTransfer`. Indexer Fields for an asset transfer transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassettransfer */\nexport type AssetTransferTransactionResult = indexerModels.TransactionAssetTransfer\n\n/** @deprecated Use `algosdk.indexerModels.TransactionKeyreg`. Indexer Fields for a `keyreg` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionkeyreg */\nexport type KeyRegistrationTransactionResult = indexerModels.TransactionKeyreg\n\n/** @deprecated Use `algosdk.indexerModels.Asset`. Indexer Fields to specify both the unique identifier and the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#asset */\nexport type AssetResult = indexerModels.Asset\n\n/** @deprecated Use `algosdk.indexerModels.Application`. Indexer result of looking up an application\n */\nexport type ApplicationResult = indexerModels.Application\n\n/** @deprecated Use `algosdk.indexerModels.TransactionSignature`. Indexer Validation signature associated with some data. Only one of the signatures should be provided. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignature */\nexport type TransactionSignature = indexerModels.TransactionSignature\n\n/** @deprecated Use `algosdk.indexerModels.TransactionSignatureLogicsig`. Indexer [lsig] Programatic transaction signature.\n *\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturelogicsig\n *\n * https://developer.algorand.org/docs/get-details/transactions/signatures/#logic-signatures\n */\nexport type LogicTransactionSignature = indexerModels.TransactionSignatureLogicsig\n\n/** @deprecated Use `algosdk.indexerModels.TransactionSignatureMultisig`. Indexer [msig] structure holding multiple subsignatures. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisig */\nexport type MultisigTransactionSignature = indexerModels.TransactionSignatureMultisig\n\n/** @deprecated Use `algosdk.indexerModels.TransactionSignatureMultisigSubsignature`. Indexer Sub-signature for a multisig signature https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisigsubsignature */\nexport type MultisigTransactionSubSignature = indexerModels.TransactionSignatureMultisigSubsignature\n\n/** @deprecated Use `algosdk.indexerModels.EvalDeltaKeyValue`. */\nexport type EvalDeltaKeyValue = indexerModels.EvalDeltaKeyValue\n\n/** @deprecated Use `algosdk.indexerModels.AccountStateDelta`. */\nexport type AccountStateDelta = indexerModels.AccountStateDelta\n\n/** @deprecated Use `algosdk.indexerModels.EvalDeltaKeyValue[]`. */\nexport type StateDelta = EvalDeltaKeyValue[]\n\n/** @deprecated Use `algosdk.indexerModels.EvalDelta`. Indexer Represents a TEAL value delta. https://developer.algorand.org/docs/rest-apis/indexer/#evaldelta */\nexport type EvalDelta = indexerModels.EvalDelta\n\n/** @deprecated Use `algosdk.indexerModels.ApplicationParams`. Indexer Stores the global information associated with an application https://developer.algorand.org/docs/rest-apis/indexer/#applicationparams */\nexport type ApplicationParams = indexerModels.ApplicationParams\n\n/** @deprecated Use `algosdk.indexerModels.StateSchema`. Indexer Represents a [apls] local-state or [apgs] global-state schema.\n * https://developer.algorand.org/docs/rest-apis/indexer/#stateschema\n *\n * These schemas determine how much storage may be used in a local-state or global-state for an application.\n *\n * The more space used, the larger minimum balance must be maintained in the account holding the data.\n */\nexport type StateSchema = indexerModels.StateSchema\n\n/** Defines the what additional actions occur with the transaction https://developer.algorand.org/docs/rest-apis/indexer/#oncompletion */\nexport enum ApplicationOnComplete {\n noop = 'noop',\n optin = 'optin',\n closeout = 'closeout',\n clear = 'clear',\n update = 'update',\n delete = 'delete',\n}\n\n/** @deprecated Use `algosdk.indexerModels.AssetParams`. Indexer AssetParams specifies the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#assetparams */\nexport type AssetParams = indexerModels.AssetParams\n\n/** Type of signature used by an account */\nexport enum SignatureType {\n /** Normal signature */\n sig = 'sig',\n /** Multisig */\n msig = 'msig',\n /** Logic signature */\n lsig = 'lsig',\n}\n\n/** Delegation status of the account */\nexport enum AccountStatus {\n /** Indicates that the associated account is delegated */\n Offline = 'Offline',\n /** Indicates that the associated account used as part of the delegation pool */\n Online = 'Online',\n /** Indicates that the associated account is neither a delegator nor a delegate */\n NotParticipating = 'NotParticipating',\n}\n\n/** @deprecated Use `algosdk.indexerModels.AccountParticipation`. Indexer AccountParticipation describes the parameters used by this account in consensus protocol. https://developer.algorand.org/docs/rest-apis/indexer/#accountparticipation */\nexport type AccountParticipation = indexerModels.AccountParticipation\n\n/** @deprecated Use `algosdk.indexerModels.ApplicationLocalState`. Indexer Stores local state associated with an application. https://developer.algorand.org/docs/rest-apis/indexer/#applicationlocalstate */\nexport type AppLocalState = indexerModels.ApplicationLocalState\n\n/** @deprecated Use `algosdk.indexerModels.AssetHolding`. Indexer Describes an asset held by an account. https://developer.algorand.org/docs/rest-apis/indexer/#assetholding */\nexport type AssetHolding = indexerModels.AssetHolding\n\n/** @deprecated Use `algosdk.indexerModels.MiniAssetHolding`. Indexer Describes an asset holding for an account of a known asset. https://developer.algorand.org/docs/rest-apis/indexer/#miniassetholding */\nexport type MiniAssetHolding = indexerModels.MiniAssetHolding\n"],"names":["ApplicationOnComplete","SignatureType","AccountStatus"],"mappings":";;AAqKA;AACYA,uCAOX;AAPD,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACnB,CAAC,EAPWA,6BAAqB,KAArBA,6BAAqB,GAOhC,EAAA,CAAA,CAAA,CAAA;AAKD;AACYC,+BAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA,CA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AEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACvC,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"indexer.mjs","sources":["../../src/types/indexer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport indexerModels = algosdk.indexerModels\n\n/** @deprecated Use `algosdk.indexerModels.TransactionsResponse`. Indexer result for a transaction search, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */\nexport type TransactionSearchResults = indexerModels.TransactionsResponse\n\n/** @deprecated Use `algosdk.indexerModels.AccountResponse`. Indexer result for an account lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */\nexport type AccountLookupResult = indexerModels.AccountResponse\n\n/** @deprecated Use `algosdk.indexerModels.AssetHoldingsResponse`. Indexer result for an account's asset holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */\nexport type AssetsLookupResult = indexerModels.AssetHoldingsResponse\n\n/** @deprecated Use `algosdk.indexerModels.AssetsResponse`. Indexer result for an account's created assets, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */\nexport type AssetsCreatedLookupResult = indexerModels.AssetsResponse\n\n/** @deprecated Use `algosdk.indexerModels.ApplicationsResponse`. Indexer result for an account's created applications, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */\nexport type ApplicationCreatedLookupResult = indexerModels.ApplicationsResponse\n\n/** @deprecated Use `algosdk.indexerModels.AssetResponse`. Indexer result for an asset lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */\nexport type AssetLookupResult = indexerModels.AssetResponse\n\n/** Options when looking up an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface LookupAssetHoldingsOptions {\n /** Results should have a decimal units amount less than this value. */\n currencyLessThan?: number | bigint\n /** Results should have a decimal units amount greater than this value. */\n currencyGreaterThan?: number | bigint\n /** Include all items including closed accounts and opted-out asset holdings. */\n includeAll?: boolean\n}\n\n/** @deprecated Use `algosdk.indexerModels.AssetBalancesResponse`. Indexer result for an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport type AssetBalancesLookupResult = indexerModels.AssetBalancesResponse\n\n/** @deprecated Use `algosdk.indexerModels.TransactionResponse`. Indexer result for a transaction lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */\nexport type TransactionLookupResult = indexerModels.TransactionResponse\n\n/** @deprecated Use `algosdk.indexerModels.ApplicationResponse`. Indexer result for an application lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */\nexport type ApplicationLookupResult = indexerModels.ApplicationResponse\n\n/** @deprecated Use `algosdk.indexerModels.Transaction`. Indexer result for a transaction, https://developer.algorand.org/docs/rest-apis/indexer/#transaction */\nexport type TransactionResult = indexerModels.Transaction\n\n/** @deprecated Use `algosdk.indexerModels.Account`. Indexer Account information at a given round https://developer.algorand.org/docs/rest-apis/indexer/#account */\nexport type AccountResult = indexerModels.Account\n\n/** @deprecated Use `algosdk.indexerModels.TransactionPayment`. Indexer Fields for a payment transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionpayment */\nexport type PaymentTransactionResult = indexerModels.TransactionPayment\n\n/** @deprecated Use `algosdk.indexerModels.TransactionStateProof`. Indexer Fields for a state proof transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionstateproof.\n *\n * See also https://developer.algorand.org/docs/get-details/stateproofs/,\n * https://developer.algorand.org/docs/get-details/stateproofs/light_client/,\n * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,\n * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,\n * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and\n * https://developer.algorand.org/docs/rest-apis/algod/#stateproof.\n */\nexport type StateProofTransactionResult = indexerModels.TransactionStateProof\n\n/** @deprecated Use `algosdk.indexerModels.MerkleArrayProof`. Indexer Merkle array Proof.\n *\n * Proof is used to convince a verifier about membership of leaves: h0,h1...hn\n * at indexes i0,i1...in on a tree. The verifier has a trusted value of the tree\n * root hash.\n *\n * Path is bounded by MaxNumLeaves since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxTreeDepth / 2\n *\n * Consider two different reveals for the same tree:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^\n * . hints: [a, r, z, z4]\n * . len(hints) = 4\n * ```\n * You need a to combine with b to get q, need r to combine with the computed q and get y, and so on.\n *\n * The worst case is this:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^ ^ ^ ^ ^ ^ ^ ^\n * .\n * . hints: [b, d, e, g, j, l, m, o]\n * . len(hints) = 2^4/2\n * ```\n */\nexport type MerkleArrayProof = indexerModels.MerkleArrayProof\n\n/** @deprecated Use `algosdk.indexerModels.TransactionApplication`. Indexer Fields for an application transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionapplication */\nexport type ApplicationTransactionResult = indexerModels.TransactionApplication\n\n/** @deprecated Use `algosdk.indexerModels.TransactionAssetConfig`. Indexer Fields for asset allocation, re-configuration, and destruction.\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetconfig\n *\n * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.\n */\nexport type AssetConfigTransactionResult = indexerModels.TransactionAssetConfig\n\n/** @deprecated Use `algosdk.indexerModels.TransactionAssetFreeze`. Indexer Fields for an asset freeze transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetfreeze */\nexport type AssetFreezeTransactionResult = indexerModels.TransactionAssetFreeze\n\n/** @deprecated Use `algosdk.indexerModels.TransactionAssetTransfer`. Indexer Fields for an asset transfer transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassettransfer */\nexport type AssetTransferTransactionResult = indexerModels.TransactionAssetTransfer\n\n/** @deprecated Use `algosdk.indexerModels.TransactionKeyreg`. Indexer Fields for a `keyreg` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionkeyreg */\nexport type KeyRegistrationTransactionResult = indexerModels.TransactionKeyreg\n\n/** @deprecated Use `algosdk.indexerModels.Asset`. Indexer Fields to specify both the unique identifier and the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#asset */\nexport type AssetResult = indexerModels.Asset\n\n/** @deprecated Use `algosdk.indexerModels.Application`. Indexer result of looking up an application\n */\nexport type ApplicationResult = indexerModels.Application\n\n/** @deprecated Use `algosdk.indexerModels.TransactionSignature`. Indexer Validation signature associated with some data. Only one of the signatures should be provided. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignature */\nexport type TransactionSignature = indexerModels.TransactionSignature\n\n/** @deprecated Use `algosdk.indexerModels.TransactionSignatureLogicsig`. Indexer [lsig] Programatic transaction signature.\n *\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturelogicsig\n *\n * https://developer.algorand.org/docs/get-details/transactions/signatures/#logic-signatures\n */\nexport type LogicTransactionSignature = indexerModels.TransactionSignatureLogicsig\n\n/** @deprecated Use `algosdk.indexerModels.TransactionSignatureMultisig`. Indexer [msig] structure holding multiple subsignatures. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisig */\nexport type MultisigTransactionSignature = indexerModels.TransactionSignatureMultisig\n\n/** @deprecated Use `algosdk.indexerModels.TransactionSignatureMultisigSubsignature`. Indexer Sub-signature for a multisig signature https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisigsubsignature */\nexport type MultisigTransactionSubSignature = indexerModels.TransactionSignatureMultisigSubsignature\n\n/** @deprecated Use `algosdk.indexerModels.EvalDeltaKeyValue`. */\nexport type EvalDeltaKeyValue = indexerModels.EvalDeltaKeyValue\n\n/** @deprecated Use `algosdk.indexerModels.AccountStateDelta`. */\nexport type AccountStateDelta = indexerModels.AccountStateDelta\n\n/** @deprecated Use `algosdk.indexerModels.EvalDeltaKeyValue[]`. */\nexport type StateDelta = EvalDeltaKeyValue[]\n\n/** @deprecated Use `algosdk.indexerModels.EvalDelta`. Indexer Represents a TEAL value delta. https://developer.algorand.org/docs/rest-apis/indexer/#evaldelta */\nexport type EvalDelta = indexerModels.EvalDelta\n\n/** @deprecated Use `algosdk.indexerModels.ApplicationParams`. Indexer Stores the global information associated with an application https://developer.algorand.org/docs/rest-apis/indexer/#applicationparams */\nexport type ApplicationParams = indexerModels.ApplicationParams\n\n/** @deprecated Use `algosdk.indexerModels.StateSchema`. Indexer Represents a [apls] local-state or [apgs] global-state schema.\n * https://developer.algorand.org/docs/rest-apis/indexer/#stateschema\n *\n * These schemas determine how much storage may be used in a local-state or global-state for an application.\n *\n * The more space used, the larger minimum balance must be maintained in the account holding the data.\n */\nexport type StateSchema = indexerModels.StateSchema\n\n/** Defines the what additional actions occur with the transaction https://developer.algorand.org/docs/rest-apis/indexer/#oncompletion */\nexport enum ApplicationOnComplete {\n noop = 'noop',\n optin = 'optin',\n closeout = 'closeout',\n clear = 'clear',\n update = 'update',\n delete = 'delete',\n}\n\n/** @deprecated Use `algosdk.indexerModels.AssetParams`. Indexer AssetParams specifies the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#assetparams */\nexport type AssetParams = indexerModels.AssetParams\n\n/** Type of signature used by an account */\nexport enum SignatureType {\n /** Normal signature */\n sig = 'sig',\n /** Multisig */\n msig = 'msig',\n /** Logic signature */\n lsig = 'lsig',\n}\n\n/** Delegation status of the account */\nexport enum AccountStatus {\n /** Indicates that the associated account is delegated */\n Offline = 'Offline',\n /** Indicates that the associated account used as part of the delegation pool */\n Online = 'Online',\n /** Indicates that the associated account is neither a delegator nor a delegate */\n NotParticipating = 'NotParticipating',\n}\n\n/** @deprecated Use `algosdk.indexerModels.AccountParticipation`. Indexer AccountParticipation describes the parameters used by this account in consensus protocol. https://developer.algorand.org/docs/rest-apis/indexer/#accountparticipation */\nexport type AccountParticipation = indexerModels.AccountParticipation\n\n/** @deprecated Use `algosdk.indexerModels.ApplicationLocalState`. Indexer Stores local state associated with an application. https://developer.algorand.org/docs/rest-apis/indexer/#applicationlocalstate */\nexport type AppLocalState = indexerModels.ApplicationLocalState\n\n/** @deprecated Use `algosdk.indexerModels.AssetHolding`. Indexer Describes an asset held by an account. https://developer.algorand.org/docs/rest-apis/indexer/#assetholding */\nexport type AssetHolding = indexerModels.AssetHolding\n\n/** @deprecated Use `algosdk.indexerModels.MiniAssetHolding`. Indexer Describes an asset holding for an account of a known asset. https://developer.algorand.org/docs/rest-apis/indexer/#miniassetholding */\nexport type MiniAssetHolding = indexerModels.MiniAssetHolding\n"],"names":[],"mappings":"AAqKA;IACY,sBAOX;AAPD,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACnB,CAAC,EAPW,qBAAqB,KAArB,qBAAqB,GAOhC,EAAA,CAAA,CAAA,CAAA;AAKD;IACY,cAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA,CAAA;AAED;IACY,cAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;;AAEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACvC,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import algosdk from 'algosdk';
1
+ import algosdk, { Address } from 'algosdk';
2
2
  import { SigningAccount, TransactionSignerAccount } from './account';
3
3
  import { AlgoAmount } from './amount';
4
4
  import { ClientManager } from './client-manager';
@@ -29,7 +29,7 @@ export declare class KmdAccountManager {
29
29
  * ```
30
30
  * @returns The signing account (with private key loaded) or undefined if no matching wallet or account was found
31
31
  */
32
- getWalletAccount(walletName: string, predicate?: (account: Record<string, any>) => boolean, sender?: string): Promise<(TransactionSignerAccount & {
32
+ getWalletAccount(walletName: string, predicate?: (account: Record<string, any>) => boolean, sender?: string | Address): Promise<(TransactionSignerAccount & {
33
33
  account: SigningAccount;
34
34
  }) | undefined>;
35
35
  /**
@@ -42,13 +42,13 @@ export declare class KmdAccountManager {
42
42
  * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!
43
43
  *
44
44
  * @param name The name of the wallet to retrieve / create
45
- * @param fundWith The number of Algos to fund the account with when it gets created, if not specified then 1000 Algos will be funded from the dispenser account
45
+ * @param fundWith The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account
46
46
  *
47
47
  * @example
48
48
  * ```typescript
49
49
  * // Idempotently get (if exists) or crate (if it doesn't exist yet) an account by name using KMD
50
- * // if creating it then fund it with 2 Algos from the default dispenser account
51
- * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algos())
50
+ * // if creating it then fund it with 2 ALGO from the default dispenser account
51
+ * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algo())
52
52
  * // This will return the same account as above since the name matches
53
53
  * const existingAccount = await kmdAccountManager.getOrCreateWalletAccount('account1')
54
54
  * ```
@@ -70,4 +70,3 @@ export declare class KmdAccountManager {
70
70
  account: SigningAccount;
71
71
  }>;
72
72
  }
73
- //# sourceMappingURL=kmd-account-manager.d.ts.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var algosdk = require('algosdk');
4
- var config = require('../config.js');
4
+ var config = require('../src/config.js');
5
5
  var types_account = require('./account.js');
6
6
  var types_amount = require('./amount.js');
7
7
  var types_clientManager = require('./client-manager.js');
@@ -19,7 +19,7 @@ class KmdAccountManager {
19
19
  try {
20
20
  this._kmd = clientManager.kmd;
21
21
  }
22
- catch (e) {
22
+ catch {
23
23
  this._kmd = undefined;
24
24
  }
25
25
  }
@@ -101,13 +101,13 @@ class KmdAccountManager {
101
101
  * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!
102
102
  *
103
103
  * @param name The name of the wallet to retrieve / create
104
- * @param fundWith The number of Algos to fund the account with when it gets created, if not specified then 1000 Algos will be funded from the dispenser account
104
+ * @param fundWith The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account
105
105
  *
106
106
  * @example
107
107
  * ```typescript
108
108
  * // Idempotently get (if exists) or crate (if it doesn't exist yet) an account by name using KMD
109
- * // if creating it then fund it with 2 Algos from the default dispenser account
110
- * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algos())
109
+ * // if creating it then fund it with 2 ALGO from the default dispenser account
110
+ * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algo())
111
111
  * // This will return the same account as above since the name matches
112
112
  * const existingAccount = await kmdAccountManager.getOrCreateWalletAccount('account1')
113
113
  * ```
@@ -128,20 +128,20 @@ class KmdAccountManager {
128
128
  // Get the account from the new KMD wallet
129
129
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
130
130
  const account = (await this.getWalletAccount(name));
131
- config.Config.logger.info(`LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${fundWith?.algos ?? 1000} ALGOs`);
131
+ config.Config.logger.info(`LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${fundWith?.algo ?? 1000} ALGO`);
132
132
  // Fund the account from the dispenser
133
133
  const dispenser = await this.getLocalNetDispenserAccount();
134
- await new types_composer({
134
+ await new types_composer.TransactionComposer({
135
135
  algod: this._clientManager.algod,
136
136
  getSigner: () => dispenser.signer,
137
137
  getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),
138
138
  })
139
139
  .addPayment({
140
- amount: fundWith ?? types_amount.AlgoAmount.Algos(1000),
140
+ amount: fundWith ?? types_amount.AlgoAmount.Algo(1000),
141
141
  receiver: account.addr,
142
142
  sender: dispenser.addr,
143
143
  })
144
- .execute();
144
+ .send();
145
145
  return account;
146
146
  }
147
147
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"kmd-account-manager.js","sources":["../../src/types/kmd-account-manager.ts"],"sourcesContent":[null],"names":["ClientManager","SigningAccount","Config","AlgokitComposer","AlgoAmount"],"mappings":";;;;;;;;;AAOA;AACgE;MACnD,iBAAiB,CAAA;AAI5B;;;AAGG;AACH,IAAA,WAAA,CAAY,aAA4B,EAAA;AACtC,QAAA,IAAI,CAAC,cAAc,GAAG,aAAa,CAAA;AACnC,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG,CAAA;SAC9B;QAAC,OAAO,CAAC,EAAE;AACV,YAAA,IAAI,CAAC,IAAI,GAAG,SAAS,CAAA;SACtB;KACF;AAED,IAAA,MAAM,GAAG,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;YAC3B,IAAI,MAA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MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,EAAE;AAC7C,YAAA,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAA;SAClF;QAED,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,GAAG,UAAa,CAAC,CAAA;QACtI,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAA;SACzG;;AAGD,QAAA,OAAO,SAAS,CAAA;KACjB;AACF;;;;"}
1
+ {"version":3,"file":"kmd-account-manager.js","sources":["../../src/types/kmd-account-manager.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { Config } from '../config'\nimport { SigningAccount, TransactionSignerAccount } from './account'\nimport { AlgoAmount } from './amount'\nimport { ClientManager } from './client-manager'\nimport { TransactionComposer } from './composer'\n\n/** Provides abstractions over a [KMD](https://github.com/algorand/go-algorand/blob/master/daemon/kmd/README.md) instance\n * that makes it easier to get and manage accounts using KMD. */\nexport class KmdAccountManager {\n private _clientManager: Omit<ClientManager, 'kmd'>\n private _kmd?: algosdk.Kmd | null\n\n /**\n * Create a new KMD manager.\n * @param clientManager A ClientManager client to use for algod and kmd clients\n */\n constructor(clientManager: ClientManager) {\n this._clientManager = clientManager\n try {\n this._kmd = clientManager.kmd\n } catch {\n this._kmd = undefined\n }\n }\n\n async kmd(): Promise<algosdk.Kmd> {\n if (this._kmd === undefined) {\n if (await this._clientManager.isLocalNet()) {\n const { kmdConfig } = ClientManager.getConfigFromEnvironmentOrLocalNet()\n if (kmdConfig) {\n this._kmd = ClientManager.getKmdClient(kmdConfig)\n return this._kmd\n }\n }\n this._kmd = null\n }\n\n if (!this._kmd) {\n throw new Error('Attempt to use Kmd client in AlgoKit instance with no Kmd configured')\n }\n\n return this._kmd\n }\n\n /**\n * Returns an Algorand signing account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletName The name of the wallet to retrieve an account from\n * @param predicate An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param sender The optional sender address to use this signer for (aka a rekeyed account)\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await kmdAccountManager.getWalletAccount(\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n * @returns The signing account (with private key loaded) or undefined if no matching wallet or account was found\n */\n public async getWalletAccount(\n walletName: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean,\n sender?: string | Address,\n ): Promise<(TransactionSignerAccount & { account: SigningAccount }) | undefined> {\n const kmd = await this.kmd()\n\n const walletsResponse = await kmd.listWallets()\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const wallet = walletsResponse.wallets.filter((w: any) => w.name === walletName)\n if (wallet.length === 0) {\n return undefined\n }\n\n const walletId = wallet[0].id\n\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n const addresses = (await kmd.listKeys(walletHandle)).addresses\n\n let i = 0\n if (predicate) {\n for (i = 0; i < addresses.length; i++) {\n const address = addresses[i]\n const account = await this._clientManager.algod.accountInformation(address).do()\n if (predicate(account)) {\n break\n }\n }\n }\n\n if (i >= addresses.length) {\n return undefined\n }\n\n const accountKey = (await kmd.exportKey(walletHandle, '', addresses[i])).private_key\n\n const accountMnemonic = algosdk.secretKeyToMnemonic(accountKey)\n\n const account = algosdk.mnemonicToSecretKey(accountMnemonic)\n const signingAccount = new SigningAccount(account, sender)\n\n return {\n account: signingAccount,\n addr: signingAccount.addr,\n signer: signingAccount.signer,\n }\n }\n\n /**\n * Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.\n *\n * This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).\n *\n * This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.\n *\n * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!\n *\n * @param name The name of the wallet to retrieve / create\n * @param fundWith The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account\n *\n * @example\n * ```typescript\n * // Idempotently get (if exists) or crate (if it doesn't exist yet) an account by name using KMD\n * // if creating it then fund it with 2 ALGO from the default dispenser account\n * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algo())\n * // This will return the same account as above since the name matches\n * const existingAccount = await kmdAccountManager.getOrCreateWalletAccount('account1')\n * ```\n *\n * @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you\n */\n public async getOrCreateWalletAccount(\n name: string,\n fundWith?: AlgoAmount,\n ): Promise<TransactionSignerAccount & { account: SigningAccount }> {\n // Get an existing account from the KMD wallet\n const existing = await this.getWalletAccount(name)\n if (existing) {\n return existing\n }\n\n const kmd = await this.kmd()\n\n // None existed: create the KMD wallet instead\n const walletId = (await kmd.createWallet(name, '')).wallet.id\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n await kmd.generateKey(walletHandle)\n\n // Get the account from the new KMD wallet\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const account = (await this.getWalletAccount(name))!\n\n Config.logger.info(\n `LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${\n fundWith?.algo ?? 1000\n } ALGO`,\n )\n\n // Fund the account from the dispenser\n const dispenser = await this.getLocalNetDispenserAccount()\n await new TransactionComposer({\n algod: this._clientManager.algod,\n getSigner: () => dispenser.signer,\n getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),\n })\n .addPayment({\n amount: fundWith ?? AlgoAmount.Algo(1000),\n receiver: account.addr,\n sender: dispenser.addr,\n })\n .send()\n\n return account\n }\n\n /**\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts).\n * @example\n * ```typescript\n * const dispenser = await kmdAccountManager.getLocalNetDispenserAccount()\n * ```\n * @returns The default LocalNet dispenser account\n */\n public async getLocalNetDispenserAccount() {\n if (!(await this._clientManager.isLocalNet())) {\n throw new Error(\"Can't get LocalNet dispenser account from non LocalNet network\")\n }\n\n const dispenser = await this.getWalletAccount('unencrypted-default-wallet', (a) => a.status !== 'Offline' && a.amount > 1_000_000_000)\n if (!dispenser) {\n throw new Error(\"Error retrieving LocalNet dispenser account; couldn't find the default account in KMD\")\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return dispenser\n }\n}\n"],"names":["ClientManager","SigningAccount","Config","TransactionComposer","AlgoAmount"],"mappings":";;;;;;;;;AAOA;AACgE;MACnD,iBAAiB,CAAA;AAI5B;;;AAGG;AACH,IAAA,WAAA,CAAY,aAA4B,EAAA;AACtC,QAAA,IAAI,CAAC,cAAc,GAAG,aAAa,CAAA;AACnC,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG,CAAA;SAC9B;AAAC,QAAA,MAAM;AACN,YAAA,IAAI,CAAC,IAAI,GAAG,SAAS,CAAA;SACtB;KACF;AAED,IAAA,MAAM,GAAG,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;YAC3B,IAAI,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE;gBAC1C,MAAM,EAAE,SAAS,EAAE,GAAGA,iCAAa,CAAC,kCAAkC,EAAE,CAAA;gBACxE,IAAI,SAAS,EAAE;oBACb,IAAI,CAAC,IAAI,GAAGA,iCAAa,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;oBACjD,OAAO,IAAI,CAAC,IAAI,CAAA;iBACjB;aACF;AACD,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;SACjB;AAED,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;AACd,YA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G;;AAGD,QAAA,OAAO,SAAS,CAAA;KACjB;AACF;;;;"}
@@ -1,9 +1,9 @@
1
1
  import algosdk from 'algosdk';
2
- import { Config } from '../config.mjs';
2
+ import { Config } from '../src/config.mjs';
3
3
  import { SigningAccount } from './account.mjs';
4
4
  import { AlgoAmount } from './amount.mjs';
5
5
  import { ClientManager } from './client-manager.mjs';
6
- import AlgokitComposer from './composer.mjs';
6
+ import { TransactionComposer } from './composer.mjs';
7
7
 
8
8
  /** Provides abstractions over a [KMD](https://github.com/algorand/go-algorand/blob/master/daemon/kmd/README.md) instance
9
9
  * that makes it easier to get and manage accounts using KMD. */
@@ -17,7 +17,7 @@ class KmdAccountManager {
17
17
  try {
18
18
  this._kmd = clientManager.kmd;
19
19
  }
20
- catch (e) {
20
+ catch {
21
21
  this._kmd = undefined;
22
22
  }
23
23
  }
@@ -99,13 +99,13 @@ class KmdAccountManager {
99
99
  * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!
100
100
  *
101
101
  * @param name The name of the wallet to retrieve / create
102
- * @param fundWith The number of Algos to fund the account with when it gets created, if not specified then 1000 Algos will be funded from the dispenser account
102
+ * @param fundWith The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account
103
103
  *
104
104
  * @example
105
105
  * ```typescript
106
106
  * // Idempotently get (if exists) or crate (if it doesn't exist yet) an account by name using KMD
107
- * // if creating it then fund it with 2 Algos from the default dispenser account
108
- * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algos())
107
+ * // if creating it then fund it with 2 ALGO from the default dispenser account
108
+ * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algo())
109
109
  * // This will return the same account as above since the name matches
110
110
  * const existingAccount = await kmdAccountManager.getOrCreateWalletAccount('account1')
111
111
  * ```
@@ -126,20 +126,20 @@ class KmdAccountManager {
126
126
  // Get the account from the new KMD wallet
127
127
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
128
128
  const account = (await this.getWalletAccount(name));
129
- Config.logger.info(`LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${fundWith?.algos ?? 1000} ALGOs`);
129
+ Config.logger.info(`LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${fundWith?.algo ?? 1000} ALGO`);
130
130
  // Fund the account from the dispenser
131
131
  const dispenser = await this.getLocalNetDispenserAccount();
132
- await new AlgokitComposer({
132
+ await new TransactionComposer({
133
133
  algod: this._clientManager.algod,
134
134
  getSigner: () => dispenser.signer,
135
135
  getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),
136
136
  })
137
137
  .addPayment({
138
- amount: fundWith ?? AlgoAmount.Algos(1000),
138
+ amount: fundWith ?? AlgoAmount.Algo(1000),
139
139
  receiver: account.addr,
140
140
  sender: dispenser.addr,
141
141
  })
142
- .execute();
142
+ .send();
143
143
  return account;
144
144
  }
145
145
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"kmd-account-manager.mjs","sources":["../../src/types/kmd-account-manager.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAOA;AACgE;MACnD,iBAAiB,CAAA;AAI5B;;;AAGG;AACH,IAAA,WAAA,CAAY,aAA4B,EAAA;AACtC,QAAA,IAAI,CAAC,cAAc,GAAG,aAAa,CAAA;AACnC,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG,CAAA;SAC9B;QAAC,OAAO,CAAC,EAAE;AACV,YAAA,IAAI,CAAC,IAAI,GAAG,SAAS,CAAA;SACtB;KACF;AAED,IAAA,MAAM,GAAG,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;YAC3B,IAAI,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE;gBAC1C,MAAM,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,kCAAkC,EAAE,CAAA;gBACxE,IAAI,SAAS,EAAE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,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,GAAG,UAAa,CAAC,CAAA;QACtI,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAA;SACzG;;AAGD,QAAA,OAAO,SAAS,CAAA;KACjB;AACF;;;;"}
1
+ {"version":3,"file":"kmd-account-manager.mjs","sources":["../../src/types/kmd-account-manager.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { Config } from '../config'\nimport { SigningAccount, TransactionSignerAccount } from './account'\nimport { AlgoAmount } from './amount'\nimport { ClientManager } from './client-manager'\nimport { TransactionComposer } from './composer'\n\n/** Provides abstractions over a [KMD](https://github.com/algorand/go-algorand/blob/master/daemon/kmd/README.md) instance\n * that makes it easier to get and manage accounts using KMD. */\nexport class KmdAccountManager {\n private _clientManager: Omit<ClientManager, 'kmd'>\n private _kmd?: algosdk.Kmd | null\n\n /**\n * Create a new KMD manager.\n * @param clientManager A ClientManager client to use for algod and kmd clients\n */\n constructor(clientManager: ClientManager) {\n this._clientManager = clientManager\n try {\n this._kmd = clientManager.kmd\n } catch {\n this._kmd = undefined\n }\n }\n\n async kmd(): Promise<algosdk.Kmd> {\n if (this._kmd === undefined) {\n if (await this._clientManager.isLocalNet()) {\n const { kmdConfig } = ClientManager.getConfigFromEnvironmentOrLocalNet()\n if (kmdConfig) {\n this._kmd = ClientManager.getKmdClient(kmdConfig)\n return this._kmd\n }\n }\n this._kmd = null\n }\n\n if (!this._kmd) {\n throw new Error('Attempt to use Kmd client in AlgoKit instance with no Kmd configured')\n }\n\n return this._kmd\n }\n\n /**\n * Returns an Algorand signing account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletName The name of the wallet to retrieve an account from\n * @param predicate An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param sender The optional sender address to use this signer for (aka a rekeyed account)\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await kmdAccountManager.getWalletAccount(\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n * @returns The signing account (with private key loaded) or undefined if no matching wallet or account was found\n */\n public async getWalletAccount(\n walletName: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean,\n sender?: string | Address,\n ): Promise<(TransactionSignerAccount & { account: SigningAccount }) | undefined> {\n const kmd = await this.kmd()\n\n const walletsResponse = await kmd.listWallets()\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const wallet = walletsResponse.wallets.filter((w: any) => w.name === walletName)\n if (wallet.length === 0) {\n return undefined\n }\n\n const walletId = wallet[0].id\n\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n const addresses = (await kmd.listKeys(walletHandle)).addresses\n\n let i = 0\n if (predicate) {\n for (i = 0; i < addresses.length; i++) {\n const address = addresses[i]\n const account = await this._clientManager.algod.accountInformation(address).do()\n if (predicate(account)) {\n break\n }\n }\n }\n\n if (i >= addresses.length) {\n return undefined\n }\n\n const accountKey = (await kmd.exportKey(walletHandle, '', addresses[i])).private_key\n\n const accountMnemonic = algosdk.secretKeyToMnemonic(accountKey)\n\n const account = algosdk.mnemonicToSecretKey(accountMnemonic)\n const signingAccount = new SigningAccount(account, sender)\n\n return {\n account: signingAccount,\n addr: signingAccount.addr,\n signer: signingAccount.signer,\n }\n }\n\n /**\n * Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.\n *\n * This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).\n *\n * This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.\n *\n * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!\n *\n * @param name The name of the wallet to retrieve / create\n * @param fundWith The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account\n *\n * @example\n * ```typescript\n * // Idempotently get (if exists) or crate (if it doesn't exist yet) an account by name using KMD\n * // if creating it then fund it with 2 ALGO from the default dispenser account\n * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algo())\n * // This will return the same account as above since the name matches\n * const existingAccount = await kmdAccountManager.getOrCreateWalletAccount('account1')\n * ```\n *\n * @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you\n */\n public async getOrCreateWalletAccount(\n name: string,\n fundWith?: AlgoAmount,\n ): Promise<TransactionSignerAccount & { account: SigningAccount }> {\n // Get an existing account from the KMD wallet\n const existing = await this.getWalletAccount(name)\n if (existing) {\n return existing\n }\n\n const kmd = await this.kmd()\n\n // None existed: create the KMD wallet instead\n const walletId = (await kmd.createWallet(name, '')).wallet.id\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n await kmd.generateKey(walletHandle)\n\n // Get the account from the new KMD wallet\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const account = (await this.getWalletAccount(name))!\n\n Config.logger.info(\n `LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${\n fundWith?.algo ?? 1000\n } ALGO`,\n )\n\n // Fund the account from the dispenser\n const dispenser = await this.getLocalNetDispenserAccount()\n await new TransactionComposer({\n algod: this._clientManager.algod,\n getSigner: () => dispenser.signer,\n getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),\n })\n .addPayment({\n amount: fundWith ?? AlgoAmount.Algo(1000),\n receiver: account.addr,\n sender: dispenser.addr,\n })\n .send()\n\n return account\n }\n\n /**\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts).\n * @example\n * ```typescript\n * const dispenser = await kmdAccountManager.getLocalNetDispenserAccount()\n * ```\n * @returns The default LocalNet dispenser account\n */\n public async getLocalNetDispenserAccount() {\n if (!(await this._clientManager.isLocalNet())) {\n throw new Error(\"Can't get LocalNet dispenser account from non LocalNet network\")\n }\n\n const dispenser = await this.getWalletAccount('unencrypted-default-wallet', (a) => a.status !== 'Offline' && a.amount > 1_000_000_000)\n if (!dispenser) {\n throw new Error(\"Error retrieving LocalNet dispenser account; couldn't find the default account in KMD\")\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return dispenser\n }\n}\n"],"names":[],"mappings":";;;;;;;AAOA;AACgE;MACnD,iBAAiB,CAAA;AAI5B;;;AAGG;AACH,IAAA,WAAA,CAAY,aAA4B,EAAA;AACtC,QAAA,IAAI,CAAC,cAAc,GAAG,aAAa,CAAA;AACnC,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG,CAAA;SAC9B;AAAC,QAAA,MAAM;AACN,YAAA,IAAI,CAAC,IAAI,GAAG,SAAS,CAAA;SACtB;KACF;AAED,IAAA,MAAM,GAAG,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;YAC3B,IAAI,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE;gBAC1C,MAAM,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,kCAAkC,EAAE,CAAA;gBACxE,IAAI,SAAS,EAAE;oBACb,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;oBACjD,OAAO,IAAI,CAAC,IAAI,CAAA;iBACjB;aACF;AACD,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;SACjB;AAED,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAA;SACxF;QAED,OAAO,IAAI,CAAC,IAAI,CAAA;KACjB;AAED;;;;;;;;;;;;;;;AAeG;IACI,MAAM,gBAAgB,CAC3B,UAAkB;;AAElB,IAAA,SAAqD,EACrD,MAAyB,EAAA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pB,CAAA,KAAA,CAAO,CACR,CAAA;;AAGD,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,2BAA2B,EAAE,CAAA;QAC1D,MAAM,IAAI,mBAAmB,CAAC;AAC5B,YAAA,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK;AAChC,YAAA,SAAS,EAAE,MAAM,SAAS,CAAC,MAAM;AACjC,YAAA,kBAAkB,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,oBAAoB,EAAE,CAAC,EAAE,EAAE;SAChF,CAAC;AACC,aAAA,UAAU,CAAC;YACV,MAAM,EAAE,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;YACzC,QAAQ,EAAE,OAAO,CAAC,IAAI;YACtB,MAAM,EAAE,SAAS,CAAC,IAAI;SACvB,CAAC;AACD,aAAA,IAAI,EAAE,CAAA;AAET,QAAA,OAAO,OAAO,CAAA;KACf;AAED;;;;;;;AAOG;AACI,IAAA,MAAM,2BAA2B,GAAA;QACtC,IAAI,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,EAAE;AAC7C,YAAA,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAA;SAClF;QAED,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,GAAG,UAAa,CAAC,CAAA;QACtI,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAA;SACzG;;AAGD,QAAA,OAAO,SAAS,CAAA;KACjB;AACF;;;;"}
@@ -0,0 +1,10 @@
1
+ import { AVMTracesEventData, TealSourcesDebugEventData } from './debugging';
2
+ export declare enum EventType {
3
+ TxnGroupSimulated = "TxnGroupSimulated",
4
+ AppCompiled = "AppCompiled"
5
+ }
6
+ export type EventDataMap = {
7
+ [EventType.TxnGroupSimulated]: AVMTracesEventData;
8
+ [EventType.AppCompiled]: TealSourcesDebugEventData;
9
+ [key: string]: unknown;
10
+ };
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ exports.EventType = void 0;
4
+ (function (EventType) {
5
+ EventType["TxnGroupSimulated"] = "TxnGroupSimulated";
6
+ EventType["AppCompiled"] = "AppCompiled";
7
+ })(exports.EventType || (exports.EventType = {}));
8
+ //# sourceMappingURL=lifecycle-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-events.js","sources":["../../src/types/lifecycle-events.ts"],"sourcesContent":["import { AVMTracesEventData, TealSourcesDebugEventData } from './debugging'\n\nexport enum EventType {\n TxnGroupSimulated = 'TxnGroupSimulated',\n AppCompiled = 'AppCompiled',\n}\n\nexport type EventDataMap = {\n [EventType.TxnGroupSimulated]: AVMTracesEventData\n [EventType.AppCompiled]: TealSourcesDebugEventData\n [key: string]: unknown\n}\n"],"names":["EventType"],"mappings":";;AAEYA,2BAGX;AAHD,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC,CAAA;AACvC,IAAA,SAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC7B,CAAC,EAHWA,iBAAS,KAATA,iBAAS,GAGpB,EAAA,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
1
+ var EventType;
2
+ (function (EventType) {
3
+ EventType["TxnGroupSimulated"] = "TxnGroupSimulated";
4
+ EventType["AppCompiled"] = "AppCompiled";
5
+ })(EventType || (EventType = {}));
6
+
7
+ export { EventType };
8
+ //# sourceMappingURL=lifecycle-events.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-events.mjs","sources":["../../src/types/lifecycle-events.ts"],"sourcesContent":["import { AVMTracesEventData, TealSourcesDebugEventData } from './debugging'\n\nexport enum EventType {\n TxnGroupSimulated = 'TxnGroupSimulated',\n AppCompiled = 'AppCompiled',\n}\n\nexport type EventDataMap = {\n [EventType.TxnGroupSimulated]: AVMTracesEventData\n [EventType.AppCompiled]: TealSourcesDebugEventData\n [key: string]: unknown\n}\n"],"names":[],"mappings":"IAEY,UAGX;AAHD,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC,CAAA;AACvC,IAAA,SAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,KAAT,SAAS,GAGpB,EAAA,CAAA,CAAA;;;;"}
@@ -13,4 +13,3 @@ export declare const verboseConsoleLogger: Logger;
13
13
  export declare const warningConsoleLogger: Logger;
14
14
  /** A logger implementation that does nothing */
15
15
  export declare const nullLogger: Logger;
16
- //# sourceMappingURL=logging.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logging.js","sources":["../../src/types/logging.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;AAWA;AACa,MAAA,aAAa,GAAW;IACnC,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,IAAA,OAAO,EAAE,MAAK,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC,KAAK;EACrB;AAEY,MAAA,iBAAiB,GAAW;IACvC,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,IAAA,OAAO,EAAE,MAAK,GAAG;AACjB,IAAA,KAAK,EAAE,MAAK,GAAG;EAChB;AAEY,MAAA,oBAAoB,GAAW;IAC1C,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,OAAO,EAAE,OAAO,CAAC,KAAK;IACtB,KAAK,EAAE,OAAO,CAAC,KAAK;EACrB;AAEY,MAAA,oBAAoB,GAAW;IAC1C,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,IAAA,IAAI,EAAE,MAAK,GAAG;AACd,IAAA,OAAO,EAAE,MAAK,GAAG;AACjB,IAAA,KAAK,EAAE,MAAK,GAAG;EAChB;AAED;AACa,MAAA,UAAU,GAAW;;AAEhC,IAAA,KAAK,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAExE,IAAA,IAAI,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAEvE,IAAA,IAAI,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAEvE,IAAA,OAAO,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAE1E,IAAA,KAAK,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;;;;;;;;"}
1
+ {"version":3,"file":"logging.js","sources":["../../src/types/logging.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-console */\n\n/** General purpose logger type, compatible with Winston and others. */\nexport type Logger = {\n error(message: string, ...optionalParams: unknown[]): void\n warn(message: string, ...optionalParams: unknown[]): void\n info(message: string, ...optionalParams: unknown[]): void\n verbose(message: string, ...optionalParams: unknown[]): void\n debug(message: string, ...optionalParams: unknown[]): void\n}\n\n/** A logger implementation that writes to console */\nexport const consoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: () => {},\n debug: console.debug,\n}\n\nexport const infoConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: () => {},\n debug: () => {},\n}\n\nexport const verboseConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: console.trace,\n debug: console.debug,\n}\n\nexport const warningConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: () => {},\n verbose: () => {},\n debug: () => {},\n}\n\n/** A logger implementation that does nothing */\nexport const nullLogger: Logger = {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n error: function (message: string, ...optionalParams: unknown[]): void {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n warn: function (message: string, ...optionalParams: unknown[]): void {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n info: function (message: string, ...optionalParams: unknown[]): void {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n verbose: function (message: string, ...optionalParams: unknown[]): void {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n debug: function (message: string, ...optionalParams: unknown[]): void {},\n}\n"],"names":[],"mappings":";;AAAA;AACA;AAWA;AACa,MAAA,aAAa,GAAW;IACnC,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,IAAA,OAAO,EAAE,MAAK,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC,KAAK;EACrB;AAEY,MAAA,iBAAiB,GAAW;IACvC,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,IAAA,OAAO,EAAE,MAAK,GAAG;AACjB,IAAA,KAAK,EAAE,MAAK,GAAG;EAChB;AAEY,MAAA,oBAAoB,GAAW;IAC1C,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,OAAO,EAAE,OAAO,CAAC,KAAK;IACtB,KAAK,EAAE,OAAO,CAAC,KAAK;EACrB;AAEY,MAAA,oBAAoB,GAAW;IAC1C,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,IAAA,IAAI,EAAE,MAAK,GAAG;AACd,IAAA,OAAO,EAAE,MAAK,GAAG;A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IAAI;AAClB,IAAA,IAAI,EAAE,MAAK,GAAG;AACd,IAAA,OAAO,EAAE,MAAK,GAAG;AACjB,IAAA,KAAK,EAAE,MAAK,GAAG;EAChB;AAED;AACa,MAAA,UAAU,GAAW;;AAEhC,IAAA,KAAK,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAExE,IAAA,IAAI,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAEvE,IAAA,IAAI,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAEvE,IAAA,OAAO,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAE1E,IAAA,KAAK,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;;;;"}
1
+ {"version":3,"file":"logging.mjs","sources":["../../src/types/logging.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-console */\n\n/** General purpose logger type, compatible with Winston and others. */\nexport type Logger = {\n error(message: string, ...optionalParams: unknown[]): void\n warn(message: string, ...optionalParams: unknown[]): void\n info(message: string, ...optionalParams: unknown[]): void\n verbose(message: string, ...optionalParams: unknown[]): void\n debug(message: string, ...optionalParams: unknown[]): void\n}\n\n/** A logger implementation that writes to console */\nexport const consoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: () => {},\n debug: console.debug,\n}\n\nexport const infoConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: () => {},\n debug: () => {},\n}\n\nexport const verboseConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: console.trace,\n debug: console.debug,\n}\n\nexport const warningConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: () => {},\n verbose: () => {},\n debug: () => {},\n}\n\n/** A logger implementation that does nothing */\nexport const nullLogger: Logger = {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n error: function (message: string, ...optionalParams: unknown[]): void {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n warn: function (message: string, ...optionalParams: unknown[]): void {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n info: function (message: string, ...optionalParams: unknown[]): void {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n verbose: function (message: string, ...optionalParams: unknown[]): void {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n debug: function (message: string, ...optionalParams: unknown[]): void {},\n}\n"],"names":[],"mappings":"AAAA;AACA;AAWA;AACa,MAAA,aAAa,GAAW;IACnC,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,IAAA,OAAO,EAAE,MAAK,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC,KAAK;EACrB;AAEY,MAAA,iBAAiB,GAAW;IACvC,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,IAAA,OAAO,EAAE,MAAK,GAAG;AACjB,IAAA,KAAK,EAAE,MAAK,GAAG;EAChB;AAEY,MAAA,oBAAoB,GAAW;IAC1C,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,OAAO,EAAE,OAAO,CAAC,KAAK;IACtB,KAAK,EAAE,OAAO,CAAC,KAAK;EACrB;AAEY,MAAA,oBAAoB,GAAW;IAC1C,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,IAAA,IAAI,EAAE,MAAK,GAAG;AACd,IAAA,OAAO,EAAE,MAAK,GAAG;AACjB,IAAA,KAAK,EAAE,MAAK,GAAG;EAChB;AAED;AACa,MAAA,UAAU,GAAW;;AAEhC,IAAA,KAAK,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAExE,IAAA,IAAI,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAEvE,IAAA,IAAI,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAEvE,IAAA,OAAO,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;AAE1E,IAAA,KAAK,EAAE,UAAU,OAAe,EAAE,GAAG,cAAyB,KAAU;;;;;"}
@@ -1,4 +1,3 @@
1
- import type algosdk from 'algosdk';
2
1
  /**
3
2
  * Details about a smart contract logic error
4
3
  */
@@ -30,8 +29,7 @@ export declare class LogicError extends Error {
30
29
  * Create a new logic error object.
31
30
  * @param errorDetails The details of the logic error
32
31
  * @param program The TEAL source code, split by line
33
- * @param map The source map of the TEAL source code
32
+ * @param getLineForPc The source map of the TEAL source code
34
33
  */
35
- constructor(errorDetails: LogicErrorDetails, program: string[], map: algosdk.SourceMap);
34
+ constructor(errorDetails: LogicErrorDetails, program: string[], getLineForPc: (pc: number) => number | undefined);
36
35
  }
37
- //# sourceMappingURL=logic-error.d.ts.map
@@ -25,15 +25,15 @@ class LogicError extends Error {
25
25
  * Create a new logic error object.
26
26
  * @param errorDetails The details of the logic error
27
27
  * @param program The TEAL source code, split by line
28
- * @param map The source map of the TEAL source code
28
+ * @param getLineForPc The source map of the TEAL source code
29
29
  */
30
- constructor(errorDetails, program, map) {
30
+ constructor(errorDetails, program, getLineForPc) {
31
31
  super();
32
32
  this.lines = 5;
33
33
  this.teal_line = 0;
34
34
  this.led = errorDetails;
35
35
  this.program = program;
36
- const line = map.getLineForPc(errorDetails.pc);
36
+ const line = getLineForPc(errorDetails.pc);
37
37
  this.teal_line = line === undefined ? 0 : line;
38
38
  this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`;
39
39
  if (this.teal_line > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"logic-error.js","sources":["../../src/types/logic-error.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA,MAAM,WA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,CAAA;AAE9D,QAAA,IAAI,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE;YACtB,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;AAC3E,YAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAA;YAExG,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YAE9C,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,aAAa,CAAA;YAEpD,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACpC;KACF;AACF;;;;"}
1
+ {"version":3,"file":"logic-error.js","sources":["../../src/types/logic-error.ts"],"sourcesContent":["const LOGIC_ERROR = /transaction ([A-Z0-9]+): logic eval error: (.*). Details: .*pc=([0-9]+).*/\n\n/**\n * Details about a smart contract logic error\n */\nexport interface LogicErrorDetails {\n /** The ID of the transaction with the logic error */\n txId: string\n /** The program counter where the error was */\n pc: number\n /** The error message */\n msg: string\n /** The full error description */\n desc: string\n /** Any trace information included in the error */\n traces: Record<string, unknown>[]\n}\n\n/** Wraps key functionality around processing logic errors */\nexport class LogicError extends Error {\n /** Takes an error message and parses out the details of any logic errors in there.\n * @param error The error message to parse\n * @returns The logic error details if any, or undefined\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static parseLogicError(error: any): LogicErrorDetails | undefined {\n const errorMessage = error.message\n const res = LOGIC_ERROR.exec(errorMessage)\n if (res === null || res.length <= 3) return undefined\n\n return {\n txId: res[1],\n msg: res[2],\n desc: errorMessage,\n pc: parseInt(res[3] ? res[3] : '0'),\n traces: error.traces,\n } as LogicErrorDetails\n }\n\n public led: LogicErrorDetails\n public program: string[]\n public lines = 5\n public teal_line = 0\n override stack?: string\n\n /**\n * Create a new logic error object.\n * @param errorDetails The details of the logic error\n * @param program The TEAL source code, split by line\n * @param getLineForPc The source map of the TEAL source code\n */\n constructor(errorDetails: LogicErrorDetails, program: string[], getLineForPc: (pc: number) => number | undefined) {\n super()\n this.led = errorDetails\n this.program = program\n\n const line = getLineForPc(errorDetails.pc)\n this.teal_line = line === undefined ? 0 : line\n\n this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`\n\n if (this.teal_line > 0) {\n const start = this.teal_line > this.lines ? this.teal_line - this.lines : 0\n const stop = program.length > this.teal_line + this.lines ? this.teal_line + this.lines : program.length\n\n const stack_lines = program.slice(start, stop)\n\n stack_lines[stack_lines.length / 2] += ' <--- Error'\n\n this.stack = stack_lines.join('\\n')\n }\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,WAAW,GAAG,2EAA2E,CAAA;AAkB/F;AACM,MAAO,UAAW,SAAQ,KAAK,CAAA;AACnC;;;AAGG;;IAEH,OAAO,eAAe,CAAC,KAAU,EAAA;AAC/B,QAAA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAA;QAClC,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAC1C,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC;AAAE,YAAA,OAAO,SAAS,CAAA;QAErD,OAAO;AACL,YAAA,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACZ,YAAA,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AACX,YAAA,IAAI,EAAE,YAAY;AAClB,YAAA,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;YACnC,MAAM,EAAE,KAAK,CAAC,MAAM;SACA,C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class LogicError extends Error {
23
23
  * Create a new logic error object.
24
24
  * @param errorDetails The details of the logic error
25
25
  * @param program The TEAL source code, split by line
26
- * @param map The source map of the TEAL source code
26
+ * @param getLineForPc The source map of the TEAL source code
27
27
  */
28
- constructor(errorDetails, program, map) {
28
+ constructor(errorDetails, program, getLineForPc) {
29
29
  super();
30
30
  this.lines = 5;
31
31
  this.teal_line = 0;
32
32
  this.led = errorDetails;
33
33
  this.program = program;
34
- const line = map.getLineForPc(errorDetails.pc);
34
+ const line = getLineForPc(errorDetails.pc);
35
35
  this.teal_line = line === undefined ? 0 : line;
36
36
  this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`;
37
37
  if (this.teal_line > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"logic-error.mjs","sources":["../../src/types/logic-error.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAG,2EAA2E,CAAA;AAkB/F;AACM,MAAO,UAAW,SAAQ,KAAK,CAAA;AACnC;;;AAGG;;IAEH,OAAO,eAAe,CAAC,KAAU,EAAA;AAC/B,QAAA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAA;QAClC,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAC1C,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC;AAAE,YAAA,OAAO,SAAS,CAAA;QAErD,OAAO;AACL,YAAA,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACZ,YAAA,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AACX,YAAA,IAAI,EAAE,YAAY;AAClB,YAAA,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;YACnC,MAAM,EAAE,KAAK,CAAC,MAAM;SACA,CAAA;KACvB;AAQD;;;;;AAKG;AACH,IAAA,WAAA,CAAY,YAA+B,EAAE,OA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= /transaction ([A-Z0-9]+): logic eval error: (.*). Details: .*pc=([0-9]+).*/\n\n/**\n * Details about a smart contract logic error\n */\nexport interface LogicErrorDetails {\n /** The ID of the transaction with the logic error */\n txId: string\n /** The program counter where the error was */\n pc: number\n /** The error message */\n msg: string\n /** The full error description */\n desc: string\n /** Any trace information included in the error */\n traces: Record<string, unknown>[]\n}\n\n/** Wraps key functionality around processing logic errors */\nexport class LogicError extends Error {\n /** Takes an error message and parses out the details of any logic errors in there.\n * @param error The error message to parse\n * @returns The logic error details if any, or undefined\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static parseLogicError(error: any): LogicErrorDetails | undefined {\n const errorMessage = error.message\n const res = LOGIC_ERROR.exec(errorMessage)\n if (res === null || res.length <= 3) return undefined\n\n return {\n txId: res[1],\n msg: res[2],\n desc: errorMessage,\n pc: parseInt(res[3] ? res[3] : '0'),\n traces: error.traces,\n } as LogicErrorDetails\n }\n\n public led: LogicErrorDetails\n public program: string[]\n public lines = 5\n public teal_line = 0\n override stack?: string\n\n /**\n * Create a new logic error object.\n * @param errorDetails The details of the logic error\n * @param program The TEAL source code, split by line\n * @param getLineForPc The source map of the TEAL source code\n */\n constructor(errorDetails: LogicErrorDetails, program: string[], getLineForPc: (pc: number) => number | undefined) {\n super()\n this.led = errorDetails\n this.program = program\n\n const line = getLineForPc(errorDetails.pc)\n this.teal_line = line === undefined ? 0 : line\n\n this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`\n\n if (this.teal_line > 0) {\n const start = this.teal_line > this.lines ? this.teal_line - this.lines : 0\n const stop = program.length > this.teal_line + this.lines ? this.teal_line + this.lines : program.length\n\n const stack_lines = program.slice(start, stop)\n\n stack_lines[stack_lines.length / 2] += ' <--- Error'\n\n this.stack = stack_lines.join('\\n')\n }\n }\n}\n"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,2EAA2E,CAAA;AAkB/F;AACM,MAAO,UAAW,SAAQ,KAAK,CAAA;AACnC;;;AAGG;;IA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,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;AAC3E,YAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAA;YAExG,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YAE9C,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,aAAa,CAAA;YAEpD,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACpC;KACF;AACF;;;;"}
@@ -1,4 +1,4 @@
1
- import type { TokenHeader } from 'algosdk/dist/types/client/urlTokenBaseHTTPClient';
1
+ import { TokenHeader } from 'algosdk';
2
2
  /** Config for an Algorand SDK client. */
3
3
  export interface AlgoClientConfig {
4
4
  /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */
@@ -10,11 +10,29 @@ export interface AlgoClientConfig {
10
10
  }
11
11
  /** Configuration for algod, indexer and kmd clients. */
12
12
  export interface AlgoConfig {
13
- /** Algo client configuration */
13
+ /** Algod client configuration */
14
14
  algodConfig: AlgoClientConfig;
15
15
  /** Indexer client configuration */
16
16
  indexerConfig?: AlgoClientConfig;
17
17
  /** Kmd configuration */
18
18
  kmdConfig?: AlgoClientConfig;
19
19
  }
20
- //# sourceMappingURL=network-client.d.ts.map
20
+ /** Details of the current network. */
21
+ export interface NetworkDetails {
22
+ /** Whether or not the network is TestNet. */
23
+ isTestNet: boolean;
24
+ /** Whether or not the network is MainNet. */
25
+ isMainNet: boolean;
26
+ /** Whether or not the network is LocalNet. */
27
+ isLocalNet: boolean;
28
+ /** The genesis ID of the current network. */
29
+ genesisId: string;
30
+ /** The base64 genesis hash of the current network. */
31
+ genesisHash: string;
32
+ }
33
+ /**
34
+ * Returns true if the given network genesisId is associated with a LocalNet network.
35
+ * @param genesisId The network genesis ID
36
+ * @returns Whether the given genesis ID is associated with a LocalNet network
37
+ */
38
+ export declare function genesisIdIsLocalNet(genesisId: string): boolean;
@@ -1,3 +1,13 @@
1
1
  'use strict';
2
2
 
3
+ /**
4
+ * Returns true if the given network genesisId is associated with a LocalNet network.
5
+ * @param genesisId The network genesis ID
6
+ * @returns Whether the given genesis ID is associated with a LocalNet network
7
+ */
8
+ function genesisIdIsLocalNet(genesisId) {
9
+ return genesisId === 'devnet-v1' || genesisId === 'sandnet-v1' || genesisId === 'dockernet-v1';
10
+ }
11
+
12
+ exports.genesisIdIsLocalNet = genesisIdIsLocalNet;
3
13
  //# sourceMappingURL=network-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"network-client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"network-client.js","sources":["../../src/types/network-client.ts"],"sourcesContent":["import { TokenHeader } from 'algosdk'\n\n/** Config for an Algorand SDK client. */\nexport interface AlgoClientConfig {\n /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */\n server: string\n /** The port to use e.g. 4001, 443, etc. */\n port?: string | number\n /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */\n token?: string | TokenHeader\n}\n\n/** Configuration for algod, indexer and kmd clients. */\nexport interface AlgoConfig {\n /** Algod client configuration */\n algodConfig: AlgoClientConfig\n /** Indexer client configuration */\n indexerConfig?: AlgoClientConfig\n /** Kmd configuration */\n kmdConfig?: AlgoClientConfig\n}\n\n/** Details of the current network. */\nexport interface NetworkDetails {\n /** Whether or not the network is TestNet. */\n isTestNet: boolean\n /** Whether or not the network is MainNet. */\n isMainNet: boolean\n /** Whether or not the network is LocalNet. */\n isLocalNet: boolean\n /** The genesis ID of the current network. */\n genesisId: string\n /** The base64 genesis hash of the current network. */\n genesisHash: string\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 */\nexport function genesisIdIsLocalNet(genesisId: string) {\n return genesisId === 'devnet-v1' || genesisId === 'sandnet-v1' || genesisId === 'dockernet-v1'\n}\n"],"names":[],"mappings":";;AAoCA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,SAAiB,EAAA;IACnD,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,KAAK,YAAY,IAAI,SAAS,KAAK,cAAc,CAAA;AAChG;;;;"}
@@ -1,2 +1,11 @@
1
+ /**
2
+ * Returns true if the given network genesisId is associated with a LocalNet network.
3
+ * @param genesisId The network genesis ID
4
+ * @returns Whether the given genesis ID is associated with a LocalNet network
5
+ */
6
+ function genesisIdIsLocalNet(genesisId) {
7
+ return genesisId === 'devnet-v1' || genesisId === 'sandnet-v1' || genesisId === 'dockernet-v1';
8
+ }
1
9
 
10
+ export { genesisIdIsLocalNet };
2
11
  //# sourceMappingURL=network-client.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"network-client.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"network-client.mjs","sources":["../../src/types/network-client.ts"],"sourcesContent":["import { TokenHeader } from 'algosdk'\n\n/** Config for an Algorand SDK client. */\nexport interface AlgoClientConfig {\n /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */\n server: string\n /** The port to use e.g. 4001, 443, etc. */\n port?: string | number\n /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */\n token?: string | TokenHeader\n}\n\n/** Configuration for algod, indexer and kmd clients. */\nexport interface AlgoConfig {\n /** Algod client configuration */\n algodConfig: AlgoClientConfig\n /** Indexer client configuration */\n indexerConfig?: AlgoClientConfig\n /** Kmd configuration */\n kmdConfig?: AlgoClientConfig\n}\n\n/** Details of the current network. */\nexport interface NetworkDetails {\n /** Whether or not the network is TestNet. */\n isTestNet: boolean\n /** Whether or not the network is MainNet. */\n isMainNet: boolean\n /** Whether or not the network is LocalNet. */\n isLocalNet: boolean\n /** The genesis ID of the current network. */\n genesisId: string\n /** The base64 genesis hash of the current network. */\n genesisHash: string\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 */\nexport function genesisIdIsLocalNet(genesisId: string) {\n return genesisId === 'devnet-v1' || genesisId === 'sandnet-v1' || genesisId === 'dockernet-v1'\n}\n"],"names":[],"mappings":"AAoCA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,SAAiB,EAAA;IACnD,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,KAAK,YAAY,IAAI,SAAS,KAAK,cAAc,CAAA;AAChG;;;;"}