@algorandfoundation/algokit-utils 6.3.0-beta.1 → 7.0.0-alpha.2

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 (379) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -26
  3. package/account/account.d.ts +12 -10
  4. package/account/account.js +17 -14
  5. package/account/account.js.map +1 -1
  6. package/account/account.mjs +18 -15
  7. package/account/account.mjs.map +1 -1
  8. package/account/get-account-config-from-environment.d.ts +0 -1
  9. package/account/get-account-config-from-environment.js.map +1 -1
  10. package/account/get-account-config-from-environment.mjs.map +1 -1
  11. package/account/get-account.d.ts +2 -3
  12. package/account/get-account.js +1 -1
  13. package/account/get-account.js.map +1 -1
  14. package/account/get-account.mjs +1 -1
  15. package/account/get-account.mjs.map +1 -1
  16. package/account/get-dispenser-account.d.ts +2 -3
  17. package/account/get-dispenser-account.js +1 -1
  18. package/account/get-dispenser-account.js.map +1 -1
  19. package/account/get-dispenser-account.mjs +1 -1
  20. package/account/get-dispenser-account.mjs.map +1 -1
  21. package/account/index.d.ts +0 -1
  22. package/account/mnemonic-account.d.ts +1 -2
  23. package/account/mnemonic-account.js +1 -1
  24. package/account/mnemonic-account.js.map +1 -1
  25. package/account/mnemonic-account.mjs +1 -1
  26. package/account/mnemonic-account.mjs.map +1 -1
  27. package/amount.d.ts +15 -5
  28. package/amount.js +9 -2
  29. package/amount.js.map +1 -1
  30. package/amount.mjs +9 -3
  31. package/amount.mjs.map +1 -1
  32. package/app-client.d.ts +19 -5
  33. package/app-client.js +19 -4
  34. package/app-client.js.map +1 -1
  35. package/app-client.mjs +19 -4
  36. package/app-client.mjs.map +1 -1
  37. package/app-deploy.d.ts +18 -2
  38. package/app-deploy.js +159 -342
  39. package/app-deploy.js.map +1 -1
  40. package/app-deploy.mjs +163 -346
  41. package/app-deploy.mjs.map +1 -1
  42. package/app.d.ts +39 -3
  43. package/app.js +121 -371
  44. package/app.js.map +1 -1
  45. package/app.mjs +122 -372
  46. package/app.mjs.map +1 -1
  47. package/asset.d.ts +5 -6
  48. package/asset.js +5 -8
  49. package/asset.js.map +1 -1
  50. package/asset.mjs +5 -8
  51. package/asset.mjs.map +1 -1
  52. package/config.d.ts +0 -1
  53. package/config.js.map +1 -1
  54. package/config.mjs.map +1 -1
  55. package/debugging/debugging.d.ts +3 -5
  56. package/debugging/debugging.js +4 -128
  57. package/debugging/debugging.js.map +1 -1
  58. package/debugging/debugging.mjs +4 -109
  59. package/debugging/debugging.mjs.map +1 -1
  60. package/debugging/index.d.ts +0 -2
  61. package/dispenser-client.d.ts +0 -1
  62. package/dispenser-client.js.map +1 -1
  63. package/dispenser-client.mjs.map +1 -1
  64. package/index.d.ts +5 -4
  65. package/index.js +36 -26
  66. package/index.js.map +1 -1
  67. package/index.mjs +6 -5
  68. package/index.mjs.map +1 -1
  69. package/indexer-lookup.d.ts +10 -9
  70. package/indexer-lookup.js +14 -10
  71. package/indexer-lookup.js.map +1 -1
  72. package/indexer-lookup.mjs +14 -10
  73. package/indexer-lookup.mjs.map +1 -1
  74. package/localnet/get-kmd-wallet-account.d.ts +1 -2
  75. package/localnet/get-kmd-wallet-account.js +1 -1
  76. package/localnet/get-kmd-wallet-account.js.map +1 -1
  77. package/localnet/get-kmd-wallet-account.mjs +1 -1
  78. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  79. package/localnet/get-localnet-dispenser-account.d.ts +1 -2
  80. package/localnet/get-localnet-dispenser-account.js +1 -1
  81. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  82. package/localnet/get-localnet-dispenser-account.mjs +1 -1
  83. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  84. package/localnet/get-or-create-kmd-wallet-account.d.ts +1 -2
  85. package/localnet/get-or-create-kmd-wallet-account.js +1 -1
  86. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  87. package/localnet/get-or-create-kmd-wallet-account.mjs +1 -1
  88. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  89. package/localnet/index.d.ts +0 -1
  90. package/localnet/is-localnet.d.ts +1 -2
  91. package/localnet/is-localnet.js +1 -1
  92. package/localnet/is-localnet.js.map +1 -1
  93. package/localnet/is-localnet.mjs +1 -1
  94. package/localnet/is-localnet.mjs.map +1 -1
  95. package/network-client.d.ts +3 -10
  96. package/network-client.js +4 -11
  97. package/network-client.js.map +1 -1
  98. package/network-client.mjs +4 -11
  99. package/network-client.mjs.map +1 -1
  100. package/package.json +3 -4
  101. package/testing/_asset.d.ts +2 -2
  102. package/testing/account.d.ts +4 -4
  103. package/testing/account.js +8 -2
  104. package/testing/account.js.map +1 -1
  105. package/testing/account.mjs +9 -3
  106. package/testing/account.mjs.map +1 -1
  107. package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
  108. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  109. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  110. package/testing/fixtures/algorand-fixture.d.ts +0 -1
  111. package/testing/fixtures/algorand-fixture.js +13 -14
  112. package/testing/fixtures/algorand-fixture.js.map +1 -1
  113. package/testing/fixtures/algorand-fixture.mjs +13 -14
  114. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  115. package/testing/fixtures/index.d.ts +0 -1
  116. package/testing/index.d.ts +0 -1
  117. package/testing/indexer.d.ts +0 -1
  118. package/testing/indexer.js.map +1 -1
  119. package/testing/indexer.mjs.map +1 -1
  120. package/testing/test-logger.d.ts +0 -1
  121. package/testing/test-logger.js +7 -3
  122. package/testing/test-logger.js.map +1 -1
  123. package/testing/test-logger.mjs +7 -3
  124. package/testing/test-logger.mjs.map +1 -1
  125. package/testing/transaction-logger.d.ts +0 -1
  126. package/testing/transaction-logger.js.map +1 -1
  127. package/testing/transaction-logger.mjs.map +1 -1
  128. package/transaction/index.d.ts +0 -1
  129. package/transaction/legacy-bridge.d.ts +31 -6
  130. package/transaction/legacy-bridge.js +101 -7
  131. package/transaction/legacy-bridge.js.map +1 -1
  132. package/transaction/legacy-bridge.mjs +101 -10
  133. package/transaction/legacy-bridge.mjs.map +1 -1
  134. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +4 -2
  135. package/transaction/perform-atomic-transaction-composer-simulate.js +14 -9
  136. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  137. package/transaction/perform-atomic-transaction-composer-simulate.mjs +15 -10
  138. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  139. package/transaction/transaction.d.ts +38 -19
  140. package/transaction/transaction.js +217 -137
  141. package/transaction/transaction.js.map +1 -1
  142. package/transaction/transaction.mjs +218 -138
  143. package/transaction/transaction.mjs.map +1 -1
  144. package/transfer/index.d.ts +0 -1
  145. package/transfer/transfer-algos.d.ts +1 -2
  146. package/transfer/transfer-algos.js +1 -1
  147. package/transfer/transfer-algos.js.map +1 -1
  148. package/transfer/transfer-algos.mjs +1 -1
  149. package/transfer/transfer-algos.mjs.map +1 -1
  150. package/transfer/transfer.d.ts +1 -2
  151. package/transfer/transfer.js +6 -4
  152. package/transfer/transfer.js.map +1 -1
  153. package/transfer/transfer.mjs +6 -4
  154. package/transfer/transfer.mjs.map +1 -1
  155. package/types/account-manager.d.ts +33 -25
  156. package/types/account-manager.js +54 -31
  157. package/types/account-manager.js.map +1 -1
  158. package/types/account-manager.mjs +56 -33
  159. package/types/account-manager.mjs.map +1 -1
  160. package/types/account.d.ts +17 -9
  161. package/types/account.js +2 -2
  162. package/types/account.js.map +1 -1
  163. package/types/account.mjs +3 -3
  164. package/types/account.mjs.map +1 -1
  165. package/types/algo-http-client-with-retry.d.ts +1 -3
  166. package/types/algo-http-client-with-retry.js +33 -3
  167. package/types/algo-http-client-with-retry.js.map +1 -1
  168. package/types/algo-http-client-with-retry.mjs +32 -2
  169. package/types/algo-http-client-with-retry.mjs.map +1 -1
  170. package/types/algorand-client-interface.d.ts +28 -0
  171. package/types/algorand-client-interface.js +3 -0
  172. package/types/algorand-client-interface.js.map +1 -0
  173. package/types/algorand-client-interface.mjs +2 -0
  174. package/types/algorand-client-interface.mjs.map +1 -0
  175. package/types/algorand-client-transaction-creator.d.ts +452 -23
  176. package/types/algorand-client-transaction-creator.js +407 -23
  177. package/types/algorand-client-transaction-creator.js.map +1 -1
  178. package/types/algorand-client-transaction-creator.mjs +407 -23
  179. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  180. package/types/algorand-client-transaction-sender.d.ts +772 -47
  181. package/types/algorand-client-transaction-sender.js +445 -15
  182. package/types/algorand-client-transaction-sender.js.map +1 -1
  183. package/types/algorand-client-transaction-sender.mjs +445 -15
  184. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  185. package/types/algorand-client.d.ts +24 -17
  186. package/types/algorand-client.js +26 -16
  187. package/types/algorand-client.js.map +1 -1
  188. package/types/algorand-client.mjs +28 -15
  189. package/types/algorand-client.mjs.map +1 -1
  190. package/types/amount.d.ts +10 -11
  191. package/types/amount.js +7 -7
  192. package/types/amount.js.map +1 -1
  193. package/types/amount.mjs +7 -7
  194. package/types/amount.mjs.map +1 -1
  195. package/types/app-arc56.d.ts +359 -0
  196. package/types/app-arc56.js +184 -0
  197. package/types/app-arc56.js.map +1 -0
  198. package/types/app-arc56.mjs +175 -0
  199. package/types/app-arc56.mjs.map +1 -0
  200. package/types/app-client.d.ts +1508 -12
  201. package/types/app-client.js +1018 -29
  202. package/types/app-client.js.map +1 -1
  203. package/types/app-client.mjs +1020 -32
  204. package/types/app-client.mjs.map +1 -1
  205. package/types/app-deployer.d.ts +126 -0
  206. package/types/app-deployer.js +353 -0
  207. package/types/app-deployer.js.map +1 -0
  208. package/types/app-deployer.mjs +351 -0
  209. package/types/app-deployer.mjs.map +1 -0
  210. package/types/app-factory.d.ts +846 -0
  211. package/types/app-factory.js +410 -0
  212. package/types/app-factory.js.map +1 -0
  213. package/types/app-factory.mjs +408 -0
  214. package/types/app-factory.mjs.map +1 -0
  215. package/types/app-manager.d.ts +244 -0
  216. package/types/app-manager.js +423 -0
  217. package/types/app-manager.js.map +1 -0
  218. package/types/app-manager.mjs +421 -0
  219. package/types/app-manager.mjs.map +1 -0
  220. package/types/app-spec.d.ts +2 -1
  221. package/types/app-spec.js +127 -0
  222. package/types/app-spec.js.map +1 -1
  223. package/types/app-spec.mjs +126 -0
  224. package/types/app-spec.mjs.map +1 -1
  225. package/types/app.d.ts +57 -18
  226. package/types/app.js +1 -1
  227. package/types/app.js.map +1 -1
  228. package/types/app.mjs +1 -1
  229. package/types/app.mjs.map +1 -1
  230. package/types/asset-manager.d.ts +10 -10
  231. package/types/asset-manager.js +13 -17
  232. package/types/asset-manager.js.map +1 -1
  233. package/types/asset-manager.mjs +13 -17
  234. package/types/asset-manager.mjs.map +1 -1
  235. package/types/asset.d.ts +0 -1
  236. package/types/async-event-emitter.d.ts +14 -0
  237. package/types/async-event-emitter.js +50 -0
  238. package/types/async-event-emitter.js.map +1 -0
  239. package/types/async-event-emitter.mjs +48 -0
  240. package/types/async-event-emitter.mjs.map +1 -0
  241. package/types/client-manager.d.ts +135 -60
  242. package/types/client-manager.js +158 -44
  243. package/types/client-manager.js.map +1 -1
  244. package/types/client-manager.mjs +159 -45
  245. package/types/client-manager.mjs.map +1 -1
  246. package/types/composer.d.ts +271 -87
  247. package/types/composer.js +405 -125
  248. package/types/composer.js.map +1 -1
  249. package/types/composer.mjs +407 -125
  250. package/types/composer.mjs.map +1 -1
  251. package/types/config.d.ts +3 -6
  252. package/types/config.js +5 -44
  253. package/types/config.js.map +1 -1
  254. package/types/config.mjs +5 -27
  255. package/types/config.mjs.map +1 -1
  256. package/types/debugging.d.ts +29 -101
  257. package/types/debugging.js +16 -109
  258. package/types/debugging.js.map +1 -1
  259. package/types/debugging.mjs +12 -107
  260. package/types/debugging.mjs.map +1 -1
  261. package/types/dispenser-client.d.ts +2 -2
  262. package/types/dispenser-client.js +10 -5
  263. package/types/dispenser-client.js.map +1 -1
  264. package/types/dispenser-client.mjs +10 -5
  265. package/types/dispenser-client.mjs.map +1 -1
  266. package/types/expand.d.ts +7 -0
  267. package/types/expand.js +3 -0
  268. package/types/expand.js.map +1 -0
  269. package/types/expand.mjs +2 -0
  270. package/types/expand.mjs.map +1 -0
  271. package/types/indexer.d.ts +74 -756
  272. package/types/indexer.js.map +1 -1
  273. package/types/indexer.mjs.map +1 -1
  274. package/types/kmd-account-manager.d.ts +2 -3
  275. package/types/kmd-account-manager.js +3 -3
  276. package/types/kmd-account-manager.js.map +1 -1
  277. package/types/kmd-account-manager.mjs +4 -4
  278. package/types/kmd-account-manager.mjs.map +1 -1
  279. package/types/lifecycle-events.d.ts +10 -0
  280. package/types/lifecycle-events.js +8 -0
  281. package/types/lifecycle-events.js.map +1 -0
  282. package/types/lifecycle-events.mjs +8 -0
  283. package/types/lifecycle-events.mjs.map +1 -0
  284. package/types/logging.d.ts +0 -1
  285. package/types/logging.js.map +1 -1
  286. package/types/logging.mjs.map +1 -1
  287. package/types/logic-error.d.ts +2 -4
  288. package/types/logic-error.js +3 -3
  289. package/types/logic-error.js.map +1 -1
  290. package/types/logic-error.mjs +3 -3
  291. package/types/logic-error.mjs.map +1 -1
  292. package/types/network-client.d.ts +14 -2
  293. package/types/network-client.js.map +1 -1
  294. package/types/network-client.mjs.map +1 -1
  295. package/types/testing.d.ts +8 -10
  296. package/types/transaction.d.ts +17 -4
  297. package/types/transfer.d.ts +0 -1
  298. package/util.d.ts +2 -2
  299. package/util.js +11 -10
  300. package/util.js.map +1 -1
  301. package/util.mjs +11 -10
  302. package/util.mjs.map +1 -1
  303. package/account/account.d.ts.map +0 -1
  304. package/account/get-account-config-from-environment.d.ts.map +0 -1
  305. package/account/get-account.d.ts.map +0 -1
  306. package/account/get-dispenser-account.d.ts.map +0 -1
  307. package/account/index.d.ts.map +0 -1
  308. package/account/mnemonic-account.d.ts.map +0 -1
  309. package/amount.d.ts.map +0 -1
  310. package/app-client.d.ts.map +0 -1
  311. package/app-deploy.d.ts.map +0 -1
  312. package/app.d.ts.map +0 -1
  313. package/asset.d.ts.map +0 -1
  314. package/config.d.ts.map +0 -1
  315. package/debugging/debugging.d.ts.map +0 -1
  316. package/debugging/index.d.ts.map +0 -1
  317. package/debugging/simulate-and-persist-response.d.ts +0 -20
  318. package/debugging/simulate-and-persist-response.d.ts.map +0 -1
  319. package/debugging/simulate-and-persist-response.js +0 -108
  320. package/debugging/simulate-and-persist-response.js.map +0 -1
  321. package/debugging/simulate-and-persist-response.mjs +0 -89
  322. package/debugging/simulate-and-persist-response.mjs.map +0 -1
  323. package/dispenser-client.d.ts.map +0 -1
  324. package/index.d.ts.map +0 -1
  325. package/indexer-lookup.d.ts.map +0 -1
  326. package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
  327. package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
  328. package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
  329. package/localnet/index.d.ts.map +0 -1
  330. package/localnet/is-localnet.d.ts.map +0 -1
  331. package/network-client.d.ts.map +0 -1
  332. package/testing/_asset.d.ts.map +0 -1
  333. package/testing/account.d.ts.map +0 -1
  334. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
  335. package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
  336. package/testing/fixtures/index.d.ts.map +0 -1
  337. package/testing/index.d.ts.map +0 -1
  338. package/testing/indexer.d.ts.map +0 -1
  339. package/testing/test-logger.d.ts.map +0 -1
  340. package/testing/transaction-logger.d.ts.map +0 -1
  341. package/transaction/index.d.ts.map +0 -1
  342. package/transaction/legacy-bridge.d.ts.map +0 -1
  343. package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
  344. package/transaction/transaction.d.ts.map +0 -1
  345. package/transfer/index.d.ts.map +0 -1
  346. package/transfer/transfer-algos.d.ts.map +0 -1
  347. package/transfer/transfer.d.ts.map +0 -1
  348. package/types/account-manager.d.ts.map +0 -1
  349. package/types/account.d.ts.map +0 -1
  350. package/types/algo-http-client-with-retry.d.ts.map +0 -1
  351. package/types/algorand-client-transaction-creator.d.ts.map +0 -1
  352. package/types/algorand-client-transaction-sender.d.ts.map +0 -1
  353. package/types/algorand-client.d.ts.map +0 -1
  354. package/types/amount.d.ts.map +0 -1
  355. package/types/app-client.d.ts.map +0 -1
  356. package/types/app-spec.d.ts.map +0 -1
  357. package/types/app.d.ts.map +0 -1
  358. package/types/asset-manager.d.ts.map +0 -1
  359. package/types/asset.d.ts.map +0 -1
  360. package/types/client-manager.d.ts.map +0 -1
  361. package/types/composer.d.ts.map +0 -1
  362. package/types/config.d.ts.map +0 -1
  363. package/types/debugging.d.ts.map +0 -1
  364. package/types/dispenser-client.d.ts.map +0 -1
  365. package/types/indexer.d.ts.map +0 -1
  366. package/types/kmd-account-manager.d.ts.map +0 -1
  367. package/types/logging.d.ts.map +0 -1
  368. package/types/logic-error.d.ts.map +0 -1
  369. package/types/network-client.d.ts.map +0 -1
  370. package/types/testing.d.ts.map +0 -1
  371. package/types/transaction.d.ts.map +0 -1
  372. package/types/transfer.d.ts.map +0 -1
  373. package/types/urlTokenBaseHTTPClient.d.ts +0 -41
  374. package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
  375. package/types/urlTokenBaseHTTPClient.js +0 -153
  376. package/types/urlTokenBaseHTTPClient.js.map +0 -1
  377. package/types/urlTokenBaseHTTPClient.mjs +0 -151
  378. package/types/urlTokenBaseHTTPClient.mjs.map +0 -1
  379. package/util.d.ts.map +0 -1
@@ -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,CAA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A,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;AA6ED;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
+ {"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
  /**
@@ -70,4 +70,3 @@ export declare class KmdAccountManager {
70
70
  account: SigningAccount;
71
71
  }>;
72
72
  }
73
- //# sourceMappingURL=kmd-account-manager.d.ts.map
@@ -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
  }
@@ -131,7 +131,7 @@ class KmdAccountManager {
131
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.default({
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(),
@@ -141,7 +141,7 @@ class KmdAccountManager {
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,QAA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AA,UAAU,CAAC;YACV,MAAM,EAAE,QAAQ,IAAIC,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC;YACzC,QAAQ,EAAE,OAAO,CAAC,IAAI;YACtB,MAAM,EAAE,SAAS,CAAC,IAAI;SACvB,CAAC;AACD,aAAA,OAAO,EAAE,CAAA;AAEZ,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;;;;"}
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,E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M,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;;;;"}
@@ -3,7 +3,7 @@ import { Config } from '../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
  }
@@ -129,7 +129,7 @@ class KmdAccountManager {
129
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(),
@@ -139,7 +139,7 @@ class KmdAccountManager {
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;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,MAAe,EAAA;AAEf,QAAA,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,CAAA;AAE5B,QAAA,MAAM,eAAe,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE,CAAA;;AAG/C,QAAA,MAAM,MAAM,GAAG,eAAe,CA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AAC,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,OAAO,EAAE,CAAA;AAEZ,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;;;;"}
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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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":";;AA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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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,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.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,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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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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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;;;;"}
@@ -23,15 +23,15 @@ 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,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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.mjs","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,CAAA;KACvB;AAQD;;;;;AAKG;AACH,IAAA,WAAA,CAAY,YAA+B,EAA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okenHeader } 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. */
@@ -17,10 +17,22 @@ export interface AlgoConfig {
17
17
  /** Kmd configuration */
18
18
  kmdConfig?: AlgoClientConfig;
19
19
  }
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
+ }
20
33
  /**
21
34
  * Returns true if the given network genesisId is associated with a LocalNet network.
22
35
  * @param genesisId The network genesis ID
23
36
  * @returns Whether the given genesis ID is associated with a LocalNet network
24
37
  */
25
38
  export declare function genesisIdIsLocalNet(genesisId: string): boolean;
26
- //# sourceMappingURL=network-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"network-client.js","sources":["../../src/types/network-client.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAsBA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,SAAiB,EAAA;IACnD,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,KAAK,YAAY,IAAI,SAAS,KAAK,cAAc,CAAA;AAChG;;;;"}
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 +1 @@
1
- {"version":3,"file":"network-client.mjs","sources":["../../src/types/network-client.ts"],"sourcesContent":[null],"names":[],"mappings":"AAsBA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,SAAiB,EAAA;IACnD,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,KAAK,YAAY,IAAI,SAAS,KAAK,cAAc,CAAA;AAChG;;;;"}
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;;;;"}
@@ -1,16 +1,15 @@
1
- import algosdk from 'algosdk';
1
+ import algosdk, { Address } from 'algosdk';
2
2
  import { TransactionLogger } from '../testing';
3
3
  import { TestLogger } from '../testing/test-logger';
4
4
  import { AlgoAmount } from '../types/amount';
5
- import { SendTransactionFrom } from '../types/transaction';
6
- import { TransactionSignerAccount } from './account';
7
- import AlgorandClient from './algorand-client';
8
- import { TransactionLookupResult } from './indexer';
5
+ import { MultisigAccount, SigningAccount, TransactionSignerAccount } from './account';
6
+ import { AlgorandClient } from './algorand-client';
9
7
  import { AlgoConfig } from './network-client';
10
8
  import Account = algosdk.Account;
11
9
  import Algodv2 = algosdk.Algodv2;
12
10
  import Indexer = algosdk.Indexer;
13
11
  import Kmd = algosdk.Kmd;
12
+ import LogicSigAccount = algosdk.LogicSigAccount;
14
13
  import Transaction = algosdk.Transaction;
15
14
  /**
16
15
  * Test automation context.
@@ -27,13 +26,13 @@ export interface AlgorandTestAutomationContext {
27
26
  /** Transaction logger that will log transaction IDs for all transactions issued by `algod` */
28
27
  transactionLogger: TransactionLogger;
29
28
  /** Default, funded test account that is ephemerally created */
30
- testAccount: Account & TransactionSignerAccount;
29
+ testAccount: Address & TransactionSignerAccount & Account;
31
30
  /** Generate and fund an additional ephemerally created account */
32
- generateAccount: (params: GetTestAccountParams) => Promise<Account & TransactionSignerAccount>;
31
+ generateAccount: (params: GetTestAccountParams) => Promise<Address & Account & TransactionSignerAccount>;
33
32
  /** Wait for the indexer to catch up with all transactions logged by `transactionLogger` */
34
33
  waitForIndexer: () => Promise<void>;
35
34
  /** Wait for the indexer to catch up with the given transaction ID */
36
- waitForIndexerTransaction: (transactionId: string) => Promise<TransactionLookupResult>;
35
+ waitForIndexerTransaction: (transactionId: string) => Promise<algosdk.indexerModels.TransactionResponse>;
37
36
  }
38
37
  /**
39
38
  * Parameters for the `getTestAccount` function.
@@ -89,7 +88,7 @@ export interface LogSnapshotConfig {
89
88
  /** Any transaction IDs or transactions to replace the ID for predictably */
90
89
  transactions?: (string | Transaction)[];
91
90
  /** Any accounts/addresses to replace the address for predictably */
92
- accounts?: (string | SendTransactionFrom)[];
91
+ accounts?: (string | Address | Account | SigningAccount | LogicSigAccount | MultisigAccount | TransactionSignerAccount)[];
93
92
  /** Any app IDs to replace predictably */
94
93
  apps?: (string | number | bigint)[];
95
94
  }
@@ -105,4 +104,3 @@ export interface AlgoKitLogCaptureFixture {
105
104
  */
106
105
  afterEach: () => void;
107
106
  }
108
- //# sourceMappingURL=testing.d.ts.map
@@ -2,6 +2,7 @@ import algosdk from 'algosdk';
2
2
  import { MultisigAccount, SigningAccount, TransactionSignerAccount } from './account';
3
3
  import { AlgoAmount } from './amount';
4
4
  import { ABIReturn } from './app';
5
+ import { Expand } from './expand';
5
6
  import Account = algosdk.Account;
6
7
  import AtomicTransactionComposer = algosdk.AtomicTransactionComposer;
7
8
  import LogicSigAccount = algosdk.LogicSigAccount;
@@ -39,6 +40,8 @@ export interface SendTransactionParams {
39
40
  /** **WARNING**: Not recommended for production use due to https://github.com/algorand/go-algorand/issues/5914. Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to true when there are app calls in the group. */
40
41
  populateAppCallResources?: boolean;
41
42
  }
43
+ /** Result from sending a single transaction. */
44
+ export type SendSingleTransactionResult = Expand<SendAtomicTransactionComposerResults & ConfirmedTransactionResult>;
42
45
  /** The result of sending a transaction */
43
46
  export interface SendTransactionResult {
44
47
  /** The transaction */
@@ -88,7 +91,7 @@ export interface ConfirmedTransactionResults extends SendTransactionResult, Send
88
91
  * * `SigningAccount` - An AlgoKit Utils class that wraps Account to provide support for rekeyed accounts
89
92
  * * `LogicSigAccount` - The in-built `algosdk.LogicSigAccount` type for logic signatures
90
93
  * * `MultisigAccount` - An AlgoKit Utils class that wraps a multisig account and provides mechanisms to get a multisig account
91
- * * `TransactionSignerAccount` - An AlgoKitUtils class that wraps the in-built `algosdk.TransactionSigner` along with the sender address
94
+ * * `TransactionSignerAccount` - An AlgoKit Utils class that wraps the in-built `algosdk.TransactionSigner` along with the sender address
92
95
  */
93
96
  export type SendTransactionFrom = Account | SigningAccount | LogicSigAccount | MultisigAccount | TransactionSignerAccount;
94
97
  /** Defines an unsigned transaction that will appear in a group of transactions along with its signing information */
@@ -112,11 +115,21 @@ export interface TransactionGroupToSend {
112
115
  /** Optional signer to pass in, required if at least one transaction provided is just the transaction, ignored otherwise */
113
116
  signer?: SendTransactionFrom;
114
117
  }
118
+ /** Parameters to configure transaction sending. */
119
+ export interface SendParams {
120
+ /** The number of rounds to wait for confirmation. By default until the latest lastValid has past. */
121
+ maxRoundsToWaitForConfirmation?: number;
122
+ /** Whether to suppress log messages from transaction send, default: do not suppress. */
123
+ suppressLog?: boolean;
124
+ /** Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to `Config.populateAppCallResources`. */
125
+ populateAppCallResources?: boolean;
126
+ }
115
127
  /** An `AtomicTransactionComposer` with transactions to send. */
116
- export interface AtomicTransactionComposerToSend {
128
+ export interface AtomicTransactionComposerToSend extends SendParams {
117
129
  /** The `AtomicTransactionComposer` with transactions loaded to send */
118
130
  atc: AtomicTransactionComposer;
119
- /** Any parameters to control the semantics of the send to the network */
131
+ /**
132
+ * @deprecated - set the parameters at the top level instead
133
+ * Any parameters to control the semantics of the send to the network */
120
134
  sendParams?: Omit<SendTransactionParams, 'fee' | 'maxFee' | 'skipSending' | 'atc'>;
121
135
  }
122
- //# sourceMappingURL=transaction.d.ts.map
@@ -74,4 +74,3 @@ export interface EnsureFundedReturnType {
74
74
  /** The response if the transaction was sent and waited for */
75
75
  amount: number;
76
76
  }
77
- //# sourceMappingURL=transfer.d.ts.map
package/util.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare class UnsafeConversionError extends Error {
14
14
  * @param minFundingIncrement The minimum amount of funds that can be added to the wallet
15
15
  * @returns The amount of funds to add to the wallet or null if the wallet is already above the minimum spending balance
16
16
  */
17
- export declare const calculateFundAmount: (minSpendingBalance: number, currentSpendingBalance: number, minFundingIncrement: number) => number | null;
17
+ export declare const calculateFundAmount: (minSpendingBalance: bigint, currentSpendingBalance: bigint, minFundingIncrement: bigint) => bigint | null;
18
18
  /**
19
19
  * Checks if the current environment is Node.js
20
20
  *
@@ -34,4 +34,4 @@ export declare function chunkArray<T>(array: T[], batchSize: number): Generator<
34
34
  * @returns The memoized function
35
35
  */
36
36
  export declare const memoize: <T = unknown, R = unknown>(fn: (val: T) => R) => (val: T) => R;
37
- //# sourceMappingURL=util.d.ts.map
37
+ export declare const binaryStartsWith: (base: Uint8Array, startsWith: Uint8Array) => boolean;