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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -25
  3. package/account/account.d.ts +1 -2
  4. package/account/account.js +6 -4
  5. package/account/account.js.map +1 -1
  6. package/account/account.mjs +6 -4
  7. package/account/account.mjs.map +1 -1
  8. package/account/get-account-config-from-environment.d.ts +0 -1
  9. package/account/get-account-config-from-environment.js.map +1 -1
  10. package/account/get-account-config-from-environment.mjs.map +1 -1
  11. package/account/get-account.d.ts +0 -1
  12. package/account/get-account.js.map +1 -1
  13. package/account/get-account.mjs.map +1 -1
  14. package/account/get-dispenser-account.d.ts +0 -1
  15. package/account/get-dispenser-account.js.map +1 -1
  16. package/account/get-dispenser-account.mjs.map +1 -1
  17. package/account/index.d.ts +0 -1
  18. package/account/mnemonic-account.d.ts +0 -1
  19. package/account/mnemonic-account.js.map +1 -1
  20. package/account/mnemonic-account.mjs.map +1 -1
  21. package/amount.d.ts +14 -5
  22. package/amount.js +6 -0
  23. package/amount.js.map +1 -1
  24. package/amount.mjs +6 -0
  25. package/amount.mjs.map +1 -1
  26. package/app-client.d.ts +15 -1
  27. package/app-client.js +15 -0
  28. package/app-client.js.map +1 -1
  29. package/app-client.mjs +15 -0
  30. package/app-client.mjs.map +1 -1
  31. package/app-deploy.d.ts +0 -1
  32. package/app-deploy.js +4 -6
  33. package/app-deploy.js.map +1 -1
  34. package/app-deploy.mjs +7 -9
  35. package/app-deploy.mjs.map +1 -1
  36. package/app.d.ts +10 -11
  37. package/app.js +15 -11
  38. package/app.js.map +1 -1
  39. package/app.mjs +15 -11
  40. package/app.mjs.map +1 -1
  41. package/asset.d.ts +3 -4
  42. package/asset.js +3 -6
  43. package/asset.js.map +1 -1
  44. package/asset.mjs +3 -6
  45. package/asset.mjs.map +1 -1
  46. package/config.d.ts +0 -1
  47. package/config.js.map +1 -1
  48. package/config.mjs.map +1 -1
  49. package/debugging/debugging.d.ts +3 -5
  50. package/debugging/debugging.js +4 -128
  51. package/debugging/debugging.js.map +1 -1
  52. package/debugging/debugging.mjs +4 -109
  53. package/debugging/debugging.mjs.map +1 -1
  54. package/debugging/index.d.ts +0 -2
  55. package/dispenser-client.d.ts +0 -1
  56. package/dispenser-client.js.map +1 -1
  57. package/dispenser-client.mjs.map +1 -1
  58. package/index.d.ts +6 -5
  59. package/index.js +48 -38
  60. package/index.js.map +1 -1
  61. package/index.mjs +6 -5
  62. package/index.mjs.map +1 -1
  63. package/indexer-lookup.d.ts +0 -1
  64. package/indexer-lookup.js.map +1 -1
  65. package/indexer-lookup.mjs.map +1 -1
  66. package/localnet/get-kmd-wallet-account.d.ts +0 -1
  67. package/localnet/get-kmd-wallet-account.js.map +1 -1
  68. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  69. package/localnet/get-localnet-dispenser-account.d.ts +0 -1
  70. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  71. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  72. package/localnet/get-or-create-kmd-wallet-account.d.ts +0 -1
  73. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  74. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  75. package/localnet/index.d.ts +0 -1
  76. package/localnet/is-localnet.d.ts +0 -1
  77. package/localnet/is-localnet.js.map +1 -1
  78. package/localnet/is-localnet.mjs.map +1 -1
  79. package/network-client.d.ts +0 -1
  80. package/network-client.js.map +1 -1
  81. package/network-client.mjs.map +1 -1
  82. package/package.json +2 -2
  83. package/testing/_asset.d.ts +0 -1
  84. package/testing/account.d.ts +0 -1
  85. package/testing/account.js.map +1 -1
  86. package/testing/account.mjs.map +1 -1
  87. package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
  88. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  89. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  90. package/testing/fixtures/algorand-fixture.d.ts +0 -1
  91. package/testing/fixtures/algorand-fixture.js +1 -1
  92. package/testing/fixtures/algorand-fixture.js.map +1 -1
  93. package/testing/fixtures/algorand-fixture.mjs +1 -1
  94. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  95. package/testing/fixtures/index.d.ts +0 -1
  96. package/testing/index.d.ts +0 -1
  97. package/testing/indexer.d.ts +0 -1
  98. package/testing/indexer.js.map +1 -1
  99. package/testing/indexer.mjs.map +1 -1
  100. package/testing/test-logger.d.ts +0 -1
  101. package/testing/test-logger.js +1 -3
  102. package/testing/test-logger.js.map +1 -1
  103. package/testing/test-logger.mjs +1 -3
  104. package/testing/test-logger.mjs.map +1 -1
  105. package/testing/transaction-logger.d.ts +0 -1
  106. package/testing/transaction-logger.js.map +1 -1
  107. package/testing/transaction-logger.mjs.map +1 -1
  108. package/transaction/index.d.ts +0 -1
  109. package/transaction/legacy-bridge.d.ts +5 -6
  110. package/transaction/legacy-bridge.js +1 -1
  111. package/transaction/legacy-bridge.js.map +1 -1
  112. package/transaction/legacy-bridge.mjs +4 -4
  113. package/transaction/legacy-bridge.mjs.map +1 -1
  114. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +0 -1
  115. package/transaction/perform-atomic-transaction-composer-simulate.js +1 -0
  116. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  117. package/transaction/perform-atomic-transaction-composer-simulate.mjs +1 -0
  118. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  119. package/transaction/transaction.d.ts +41 -6
  120. package/transaction/transaction.js +113 -61
  121. package/transaction/transaction.js.map +1 -1
  122. package/transaction/transaction.mjs +113 -62
  123. package/transaction/transaction.mjs.map +1 -1
  124. package/transfer/index.d.ts +0 -1
  125. package/transfer/transfer-algos.d.ts +1 -2
  126. package/transfer/transfer-algos.js +1 -1
  127. package/transfer/transfer-algos.js.map +1 -1
  128. package/transfer/transfer-algos.mjs +1 -1
  129. package/transfer/transfer-algos.mjs.map +1 -1
  130. package/transfer/transfer.d.ts +1 -2
  131. package/transfer/transfer.js +3 -3
  132. package/transfer/transfer.js.map +1 -1
  133. package/transfer/transfer.mjs +3 -3
  134. package/transfer/transfer.mjs.map +1 -1
  135. package/types/account-manager.d.ts +15 -7
  136. package/types/account-manager.js +27 -11
  137. package/types/account-manager.js.map +1 -1
  138. package/types/account-manager.mjs +29 -13
  139. package/types/account-manager.mjs.map +1 -1
  140. package/types/account.d.ts +9 -1
  141. package/types/account.js.map +1 -1
  142. package/types/account.mjs.map +1 -1
  143. package/types/algo-http-client-with-retry.d.ts +0 -1
  144. package/types/algo-http-client-with-retry.js.map +1 -1
  145. package/types/algo-http-client-with-retry.mjs.map +1 -1
  146. package/types/algorand-client-interface.d.ts +28 -0
  147. package/types/algorand-client-interface.js +3 -0
  148. package/types/algorand-client-interface.js.map +1 -0
  149. package/types/algorand-client-interface.mjs +2 -0
  150. package/types/algorand-client-interface.mjs.map +1 -0
  151. package/types/algorand-client-transaction-creator.d.ts +33 -34
  152. package/types/algorand-client-transaction-creator.js +31 -31
  153. package/types/algorand-client-transaction-creator.js.map +1 -1
  154. package/types/algorand-client-transaction-creator.mjs +31 -31
  155. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  156. package/types/algorand-client-transaction-sender.d.ts +31 -32
  157. package/types/algorand-client-transaction-sender.js +25 -9
  158. package/types/algorand-client-transaction-sender.js.map +1 -1
  159. package/types/algorand-client-transaction-sender.mjs +25 -9
  160. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  161. package/types/algorand-client.d.ts +13 -13
  162. package/types/algorand-client.js +10 -10
  163. package/types/algorand-client.js.map +1 -1
  164. package/types/algorand-client.mjs +12 -12
  165. package/types/algorand-client.mjs.map +1 -1
  166. package/types/amount.d.ts +10 -11
  167. package/types/amount.js +7 -7
  168. package/types/amount.js.map +1 -1
  169. package/types/amount.mjs +7 -7
  170. package/types/amount.mjs.map +1 -1
  171. package/types/app-arc56.d.ts +358 -0
  172. package/types/app-arc56.js +184 -0
  173. package/types/app-arc56.js.map +1 -0
  174. package/types/app-arc56.mjs +175 -0
  175. package/types/app-arc56.mjs.map +1 -0
  176. package/types/app-client.d.ts +1488 -8
  177. package/types/app-client.js +1000 -19
  178. package/types/app-client.js.map +1 -1
  179. package/types/app-client.mjs +1000 -20
  180. package/types/app-client.mjs.map +1 -1
  181. package/types/app-deployer.d.ts +19 -14
  182. package/types/app-deployer.js +25 -25
  183. package/types/app-deployer.js.map +1 -1
  184. package/types/app-deployer.mjs +27 -27
  185. package/types/app-deployer.mjs.map +1 -1
  186. package/types/app-factory.d.ts +846 -0
  187. package/types/app-factory.js +411 -0
  188. package/types/app-factory.js.map +1 -0
  189. package/types/app-factory.mjs +409 -0
  190. package/types/app-factory.mjs.map +1 -0
  191. package/types/app-manager.d.ts +12 -3
  192. package/types/app-manager.js +13 -15
  193. package/types/app-manager.js.map +1 -1
  194. package/types/app-manager.mjs +13 -15
  195. package/types/app-manager.mjs.map +1 -1
  196. package/types/app-spec.d.ts +2 -1
  197. package/types/app-spec.js +121 -0
  198. package/types/app-spec.js.map +1 -1
  199. package/types/app-spec.mjs +120 -0
  200. package/types/app-spec.mjs.map +1 -1
  201. package/types/app.d.ts +14 -9
  202. package/types/app.js.map +1 -1
  203. package/types/app.mjs.map +1 -1
  204. package/types/asset-manager.d.ts +7 -7
  205. package/types/asset-manager.js +5 -6
  206. package/types/asset-manager.js.map +1 -1
  207. package/types/asset-manager.mjs +5 -6
  208. package/types/asset-manager.mjs.map +1 -1
  209. package/types/asset.d.ts +0 -1
  210. package/types/async-event-emitter.d.ts +14 -0
  211. package/types/async-event-emitter.js +50 -0
  212. package/types/async-event-emitter.js.map +1 -0
  213. package/types/async-event-emitter.mjs +48 -0
  214. package/types/async-event-emitter.mjs.map +1 -0
  215. package/types/client-manager.d.ts +131 -51
  216. package/types/client-manager.js +143 -23
  217. package/types/client-manager.js.map +1 -1
  218. package/types/client-manager.mjs +144 -24
  219. package/types/client-manager.mjs.map +1 -1
  220. package/types/composer.d.ts +110 -37
  221. package/types/composer.js +139 -26
  222. package/types/composer.js.map +1 -1
  223. package/types/composer.mjs +140 -27
  224. package/types/composer.mjs.map +1 -1
  225. package/types/config.d.ts +3 -6
  226. package/types/config.js +5 -44
  227. package/types/config.js.map +1 -1
  228. package/types/config.mjs +5 -27
  229. package/types/config.mjs.map +1 -1
  230. package/types/debugging.d.ts +29 -101
  231. package/types/debugging.js +16 -109
  232. package/types/debugging.js.map +1 -1
  233. package/types/debugging.mjs +12 -107
  234. package/types/debugging.mjs.map +1 -1
  235. package/types/dispenser-client.d.ts +1 -2
  236. package/types/dispenser-client.js +6 -5
  237. package/types/dispenser-client.js.map +1 -1
  238. package/types/dispenser-client.mjs +6 -5
  239. package/types/dispenser-client.mjs.map +1 -1
  240. package/types/expand.d.ts +0 -1
  241. package/types/indexer.d.ts +0 -1
  242. package/types/indexer.js.map +1 -1
  243. package/types/indexer.mjs.map +1 -1
  244. package/types/kmd-account-manager.d.ts +0 -1
  245. package/types/kmd-account-manager.js +2 -2
  246. package/types/kmd-account-manager.js.map +1 -1
  247. package/types/kmd-account-manager.mjs +4 -4
  248. package/types/kmd-account-manager.mjs.map +1 -1
  249. package/types/lifecycle-events.d.ts +10 -0
  250. package/types/lifecycle-events.js +8 -0
  251. package/types/lifecycle-events.js.map +1 -0
  252. package/types/lifecycle-events.mjs +8 -0
  253. package/types/lifecycle-events.mjs.map +1 -0
  254. package/types/logging.d.ts +0 -1
  255. package/types/logging.js.map +1 -1
  256. package/types/logging.mjs.map +1 -1
  257. package/types/logic-error.d.ts +2 -4
  258. package/types/logic-error.js +3 -3
  259. package/types/logic-error.js.map +1 -1
  260. package/types/logic-error.mjs +3 -3
  261. package/types/logic-error.mjs.map +1 -1
  262. package/types/network-client.d.ts +13 -1
  263. package/types/network-client.js.map +1 -1
  264. package/types/network-client.mjs.map +1 -1
  265. package/types/testing.d.ts +3 -4
  266. package/types/transaction.d.ts +14 -4
  267. package/types/transfer.d.ts +0 -1
  268. package/types/urlTokenBaseHTTPClient.d.ts +0 -1
  269. package/types/urlTokenBaseHTTPClient.js +1 -1
  270. package/types/urlTokenBaseHTTPClient.js.map +1 -1
  271. package/types/urlTokenBaseHTTPClient.mjs +1 -1
  272. package/types/urlTokenBaseHTTPClient.mjs.map +1 -1
  273. package/util.d.ts +2 -2
  274. package/util.js +11 -10
  275. package/util.js.map +1 -1
  276. package/util.mjs +11 -10
  277. package/util.mjs.map +1 -1
  278. package/account/account.d.ts.map +0 -1
  279. package/account/get-account-config-from-environment.d.ts.map +0 -1
  280. package/account/get-account.d.ts.map +0 -1
  281. package/account/get-dispenser-account.d.ts.map +0 -1
  282. package/account/index.d.ts.map +0 -1
  283. package/account/mnemonic-account.d.ts.map +0 -1
  284. package/amount.d.ts.map +0 -1
  285. package/app-client.d.ts.map +0 -1
  286. package/app-deploy.d.ts.map +0 -1
  287. package/app.d.ts.map +0 -1
  288. package/asset.d.ts.map +0 -1
  289. package/config.d.ts.map +0 -1
  290. package/debugging/debugging.d.ts.map +0 -1
  291. package/debugging/index.d.ts.map +0 -1
  292. package/debugging/simulate-and-persist-response.d.ts +0 -20
  293. package/debugging/simulate-and-persist-response.d.ts.map +0 -1
  294. package/debugging/simulate-and-persist-response.js +0 -108
  295. package/debugging/simulate-and-persist-response.js.map +0 -1
  296. package/debugging/simulate-and-persist-response.mjs +0 -89
  297. package/debugging/simulate-and-persist-response.mjs.map +0 -1
  298. package/dispenser-client.d.ts.map +0 -1
  299. package/index.d.ts.map +0 -1
  300. package/indexer-lookup.d.ts.map +0 -1
  301. package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
  302. package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
  303. package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
  304. package/localnet/index.d.ts.map +0 -1
  305. package/localnet/is-localnet.d.ts.map +0 -1
  306. package/network-client.d.ts.map +0 -1
  307. package/testing/_asset.d.ts.map +0 -1
  308. package/testing/account.d.ts.map +0 -1
  309. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
  310. package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
  311. package/testing/fixtures/index.d.ts.map +0 -1
  312. package/testing/index.d.ts.map +0 -1
  313. package/testing/indexer.d.ts.map +0 -1
  314. package/testing/test-logger.d.ts.map +0 -1
  315. package/testing/transaction-logger.d.ts.map +0 -1
  316. package/transaction/index.d.ts.map +0 -1
  317. package/transaction/legacy-bridge.d.ts.map +0 -1
  318. package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
  319. package/transaction/transaction.d.ts.map +0 -1
  320. package/transfer/index.d.ts.map +0 -1
  321. package/transfer/transfer-algos.d.ts.map +0 -1
  322. package/transfer/transfer.d.ts.map +0 -1
  323. package/types/account-manager.d.ts.map +0 -1
  324. package/types/account.d.ts.map +0 -1
  325. package/types/algo-http-client-with-retry.d.ts.map +0 -1
  326. package/types/algorand-client-transaction-creator.d.ts.map +0 -1
  327. package/types/algorand-client-transaction-sender.d.ts.map +0 -1
  328. package/types/algorand-client.d.ts.map +0 -1
  329. package/types/amount.d.ts.map +0 -1
  330. package/types/app-client.d.ts.map +0 -1
  331. package/types/app-deployer.d.ts.map +0 -1
  332. package/types/app-manager.d.ts.map +0 -1
  333. package/types/app-spec.d.ts.map +0 -1
  334. package/types/app.d.ts.map +0 -1
  335. package/types/asset-manager.d.ts.map +0 -1
  336. package/types/asset.d.ts.map +0 -1
  337. package/types/client-manager.d.ts.map +0 -1
  338. package/types/composer.d.ts.map +0 -1
  339. package/types/config.d.ts.map +0 -1
  340. package/types/debugging.d.ts.map +0 -1
  341. package/types/dispenser-client.d.ts.map +0 -1
  342. package/types/expand.d.ts.map +0 -1
  343. package/types/indexer.d.ts.map +0 -1
  344. package/types/kmd-account-manager.d.ts.map +0 -1
  345. package/types/logging.d.ts.map +0 -1
  346. package/types/logic-error.d.ts.map +0 -1
  347. package/types/network-client.d.ts.map +0 -1
  348. package/types/testing.d.ts.map +0 -1
  349. package/types/transaction.d.ts.map +0 -1
  350. package/types/transfer.d.ts.map +0 -1
  351. package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
  352. package/util.d.ts.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Algorand Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # AlgoKit TypeScript Utilities
1
+ # AlgoKit TypeScript Utilities
2
2
 
3
3
  A set of core Algorand utilities written in TypeScript and released via npm that make it easier to build solutions on Algorand. This project is part of [AlgoKit](https://github.com/algorandfoundation/algokit-cli).
4
4
 
@@ -13,7 +13,7 @@ Note: If you prefer Python there's an equivalent [Python utility library](https:
13
13
  This library can be installed from NPM using your favourite npm client, e.g.:
14
14
 
15
15
  ```
16
- npm install @algorandfoundation/algokit-utils
16
+ npm install algosdk@2 @algorandfoundation/algokit-utils
17
17
  ```
18
18
 
19
19
  Then to import it:
@@ -22,34 +22,12 @@ Then to import it:
22
22
  import { AlgorandClient, Config } from '@algorandfoundation/algokit-utils'
23
23
  ```
24
24
 
25
- See [usage](./docs/README.md#usage) for more.
25
+ See [usage](./docs/README.md#usage) for more details.
26
26
 
27
27
  ## Guiding principles
28
28
 
29
29
  This library follows the [Guiding Principles of AlgoKit](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/algokit.md#guiding-principles).
30
30
 
31
- ## NextJS compatibility
32
-
33
- `algokit-utils-ts` has a set of `node` specific utilities used for simplifying aggregation of artifacts for [AlgoKit VSCode Debugger Extension](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). Which causes Next.js based projects to fail on `fs` module not found. To fix this issue, you can add the following to your `next.config.js` file:
34
-
35
- ```js
36
- webpack: (config, { isServer }) => {
37
- // Fix for Module not found: Can't resolve 'fs'
38
- if (!isServer) {
39
- config.resolve.fallback.fs = false;
40
- }
41
- return config;
42
- },
43
- ```
44
-
45
- The root cause is due to the fact that, unlike many frameworks, Next.js allows you to import server-only (Node.js APIs that don't work in a browser) code into your page files. When Next.js builds your project, it removes server only code from your client-side bundle by checking which code exists inside one any of the following built-in methods (code splitting):
46
-
47
- - getServerSideProps
48
- - getStaticProps
49
- - getStaticPaths
50
-
51
- The Module not found: can't resolve 'xyz' error happens when you try to use server only code outside of these methods. Despite `algokit-utils` lazy loading the node specific code dynamically, Next.js does not seem to correctly identify whether a dynamic import is specific to server or client side. Hence the above fix disables the fallback for `fs` module so it ignores polyfilling it on client side.
52
-
53
31
  ## Contributing
54
32
 
55
33
  This is an open source project managed by the Algorand Foundation. See the [AlgoKit contributing page](https://github.com/algorandfoundation/algokit-cli/blob/main/CONTRIBUTING.md) to learn about making improvements.
@@ -96,7 +96,7 @@ export declare function getAccountAddressAsUint8Array(account: SendTransactionFr
96
96
  * @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key
97
97
  */
98
98
  export declare function getAccountAddressAsString(addressEncodedInB64: string): string;
99
- type NumberConverter<T extends AccountInformationModel> = {
99
+ export type NumberConverter<T extends AccountInformationModel> = {
100
100
  [key in keyof T]: ToNumberIfExtends<T[key], number | bigint>;
101
101
  };
102
102
  type ToNumberIfExtends<K, E> = K extends E ? number : K;
@@ -139,4 +139,3 @@ export declare function getAccountInformation(sender: string | SendTransactionFr
139
139
  */
140
140
  export declare function getAccountAssetInformation(sender: string | SendTransactionFrom, assetId: number | bigint, algod: Algodv2): Promise<AccountAssetInformation>;
141
141
  export {};
142
- //# sourceMappingURL=account.d.ts.map
@@ -139,10 +139,12 @@ async function getAccountInformation(sender, algod) {
139
139
  totalAssetsOptedIn: Number(account.totalAssetsOptedIn),
140
140
  totalCreatedApps: Number(account.totalCreatedApps),
141
141
  totalCreatedAssets: Number(account.totalCreatedAssets),
142
- appsTotalExtraPages: account.appsTotalExtraPages ? Number(account.appsTotalExtraPages) : undefined,
143
- rewardBase: account.rewardBase ? Number(account.rewardBase) : undefined,
144
- totalBoxBytes: account.totalBoxBytes ? Number(account.totalBoxBytes) : undefined,
145
- totalBoxes: account.totalBoxes ? Number(account.totalBoxes) : undefined,
142
+ appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,
143
+ rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,
144
+ totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,
145
+ totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,
146
+ lastHeartbeat: account.lastHeartbeat !== undefined ? Number(account.lastHeartbeat) : undefined,
147
+ lastProposed: account.lastProposed !== undefined ? Number(account.lastProposed) : undefined,
146
148
  };
147
149
  }
148
150
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sources":["../../src/account/account.ts"],"sourcesContent":[null],"names":["MultisigAccount","SigningAccount","AccountManager","ClientManager","getSenderAddress","AlgorandClient"],"mappings":";;;;;;;;;AAaA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U,CAAC,GAAG,SAAS;AACvE,QAAA,aAAa,EAAE,OAAO,CAAC,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS;AAChF,QAAA,UAAU,EAAE,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,SAAS;KACxE,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;AAiBG;AACI,eAAe,0BAA0B,CAC9C,MAAoC,EACpC,OAAwB,EACxB,KAAc,EAAA;IAEd,OAAOC,mCAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAACD,4BAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACrH;;;;;;;;;;;;"}
1
+ {"version":3,"file":"account.js","sources":["../../src/account/account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { getSenderAddress } from '../transaction/transaction'\nimport { AccountAssetInformation, MultisigAccount, SigningAccount, TransactionSignerAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgorandClient } from '../types/algorand-client'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { SendTransactionFrom } from '../types/transaction'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport TransactionSigner = algosdk.TransactionSigner\nimport AccountInformationModel = algosdk.modelsv2.Account\n\n/**\n * @deprecated Use `algorand.account.multisig(multisigParams, signingAccounts)` or `new MultisigAccount(multisigParams, signingAccounts)` instead.\n *\n * Returns an account wrapper that supports partial or full multisig signing.\n * @param multisigParams The parameters that define the multisig account\n * @param signingAccounts The signers that are currently present\n * @returns A multisig account wrapper\n */\nexport function multisigAccount(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n return new MultisigAccount(multisigParams, signingAccounts)\n}\n\n/**\n * @deprecated Use `algorand.account.rekeyed(sender, account)` or `new SigningAccount(account, sender)` instead.\n *\n * Returns an account wrapper that supports a rekeyed account.\n * @param signer The account, with private key loaded, that is signing\n * @param sender The address of the rekeyed account that will act as a sender\n * @returns The SigningAccount wrapper\n */\nexport function rekeyedAccount(signer: Account, sender: string) {\n return new SigningAccount(signer, sender)\n}\n\n/**\n * @deprecated Use `algorand.account.getSigner(sender)` (after previously registering the signer with `setSigner`) or `{ addr: sender, signer }` instead.\n *\n * Returns an account wrapper that supports a transaction signer with associated sender address.\n * @param signer The transaction signer\n * @param sender The address of sender account\n * @returns The SigningAccount wrapper\n */\nexport function transactionSignerAccount(signer: TransactionSigner, sender: string): TransactionSignerAccount {\n return { addr: sender, signer }\n}\n\n/**\n * @deprecated Use `algorand.account.random()` or `algosdk.generateAccount()` instead.\n *\n * Returns a new, random Algorand account with secret key loaded.\n *\n * This is a wrapper around algosdk.generateAccount to provide a more friendly/obvious name.\n *\n */\nexport function randomAccount(): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.generateAccount()\n}\n\n/**\n * @deprecated Use `algorand.account.fromEnvironment(name, fundWith)` or `new AccountManager(clientManager).fromEnvironment()` instead.\n *\n * Returns an Algorand account with private key loaded by convention from environment variables based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.MY_ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await mnemonicAccountFromEnvironment('MY_ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n * If not running against LocalNet then it will use proces.env.MY_ACCOUNT_MNEMONIC as the private key and (if present) process.env.MY_ACCOUNT_SENDER as the sender address.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: string: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function mnemonicAccountFromEnvironment(\n account: string | { name: string; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n return (\n await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(\n typeof account === 'string' ? account : account.name,\n typeof account === 'string' ? undefined : account.fundWith,\n )\n ).account\n}\n\n/**\n * @deprecated Use `algosdk.decodeAddress` instead.\n *\n * Returns an account's address as a byte array\n *\n * @param account Either an account (with private key loaded) or the string address of an account\n */\nexport function getAccountAddressAsUint8Array(account: SendTransactionFrom | string) {\n return algosdk.decodeAddress(typeof account === 'string' ? account : getSenderAddress(account)).publicKey\n}\n\n/**\n * @deprecated Use `algosdk.encodeAddress` instead.\n *\n * Returns the string address of an Algorand account from a base64 encoded version of the underlying byte array of the address public key\n *\n * @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key\n */\nexport function getAccountAddressAsString(addressEncodedInB64: string): string {\n return algosdk.encodeAddress(Buffer.from(addressEncodedInB64, 'base64'))\n}\n\nexport type NumberConverter<T extends AccountInformationModel> = { [key in keyof T]: ToNumberIfExtends<T[key], number | bigint> }\ntype ToNumberIfExtends<K, E> = K extends E ? number : K\n/** @deprecated Account information at a given round. */\nexport type AccountInformation = Omit<NumberConverter<AccountInformationModel>, 'get_obj_for_encoding'>\n\n/**\n * @deprecated Use `algorand.account.getInformation(sender)` or `new AccountManager(clientManager).getInformation(sender)` instead.\n *\n * Returns the given sender account's current status, balance and spendable amounts.\n *\n * @example\n * ```typescript\n * const address = \"XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA\";\n * const accountInfo = await account.getInformation(address, algod);\n * ```\n *\n * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)\n * @param sender The address of the sender/account to look up\n * @param algod The algod instance\n * @returns The account information\n */\nexport async function getAccountInformation(sender: string | SendTransactionFrom, algod: Algodv2): Promise<AccountInformation> {\n const account = AccountInformationModel.from_obj_for_encoding(await algod.accountInformation(getSenderAddress(sender)).do())\n\n return {\n ...account,\n // None of these can practically overflow 2^53\n amount: Number(account.amount),\n amountWithoutPendingRewards: Number(account.amountWithoutPendingRewards),\n minBalance: Number(account.minBalance),\n pendingRewards: Number(account.pendingRewards),\n rewards: Number(account.rewards),\n round: Number(account.round),\n totalAppsOptedIn: Number(account.totalAppsOptedIn),\n totalAssetsOptedIn: Number(account.totalAssetsOptedIn),\n totalCreatedApps: Number(account.totalCreatedApps),\n totalCreatedAssets: Number(account.totalCreatedAssets),\n appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,\n rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,\n totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,\n totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,\n lastHeartbeat: account.lastHeartbeat !== undefined ? Number(account.lastHeartbeat) : undefined,\n lastProposed: account.lastProposed !== undefined ? Number(account.lastProposed) : undefined,\n }\n}\n\n/**\n * @deprecated Use `algorand.asset.getAccountInformation(sender, assetId)` or `new AssetManager(...).getAccountInformation(sender, assetId)` instead.\n *\n * Returns the given sender account's asset holding for a given asset.\n *\n * @example\n * ```typescript\n * const address = \"XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA\";\n * const assetId = 123345;\n * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);\n * ```\n *\n * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddressassetsasset-id)\n * @param sender The address of the sender/account to look up\n * @param assetId The ID of the asset to return a holding for\n * @param algod The algod instance\n * @returns The account asset holding information\n */\nexport async function getAccountAssetInformation(\n sender: string | SendTransactionFrom,\n assetId: number | bigint,\n algod: Algodv2,\n): Promise<AccountAssetInformation> {\n return AlgorandClient.fromClients({ algod }).asset.getAccountInformation(getSenderAddress(sender), BigInt(assetId))\n}\n"],"names":["MultisigAccount","SigningAccount","AccountManager","ClientManager","getSenderAddress","AlgorandClient"],"mappings":";;;;;;;;;AAaA,IAAO,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAA;AAEzD;;;;;;;AAOG;AACa,SAAA,eAAe,CAAC,cAAgC,EAAE,eAA6C,EAAA;AAC7G,IAAA,OAAO,IAAIA,6BAAe,CAAC,cAAc,EAAE,eAAe,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;;;AAOG;AACa,SAAA,cAAc,CAAC,MAAe,EAAE,MAAc,EAAA;AAC5D,IAAA,OAAO,IAAIC,4BAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;;AAOG;AACa,SAAA,wBAAwB,CAAC,MAAyB,EAAE,MAAc,EAAA;AAChF,IAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AACjC,CAAC;AAED;;;;;;;AAOG;SACa,aAAa,GAAA;;AAE3B,IAAA,OAAO,OA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AoC,EACpC,OAAwB,EACxB,KAAc,EAAA;IAEd,OAAOC,mCAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAACD,4BAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACrH;;;;;;;;;;;;"}
@@ -137,10 +137,12 @@ async function getAccountInformation(sender, algod) {
137
137
  totalAssetsOptedIn: Number(account.totalAssetsOptedIn),
138
138
  totalCreatedApps: Number(account.totalCreatedApps),
139
139
  totalCreatedAssets: Number(account.totalCreatedAssets),
140
- appsTotalExtraPages: account.appsTotalExtraPages ? Number(account.appsTotalExtraPages) : undefined,
141
- rewardBase: account.rewardBase ? Number(account.rewardBase) : undefined,
142
- totalBoxBytes: account.totalBoxBytes ? Number(account.totalBoxBytes) : undefined,
143
- totalBoxes: account.totalBoxes ? Number(account.totalBoxes) : undefined,
140
+ appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,
141
+ rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,
142
+ totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,
143
+ totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,
144
+ lastHeartbeat: account.lastHeartbeat !== undefined ? Number(account.lastHeartbeat) : undefined,
145
+ lastProposed: account.lastProposed !== undefined ? Number(account.lastProposed) : undefined,
144
146
  };
145
147
  }
146
148
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"account.mjs","sources":["../../src/account/account.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAaA,IAAO,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAA;AAEzD;;;;;;;AAOG;AACa,SAAA,eAAe,CAAC,cAAgC,EAAE,eAA6C,EAAA;AAC7G,IAAA,OAAO,IAAI,eAAe,CAAC,cAAc,EAAE,eAAe,CAAC,CA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AG,SAAS;KACxE,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;AAiBG;AACI,eAAe,0BAA0B,CAC9C,MAAoC,EACpC,OAAwB,EACxB,KAAc,EAAA;IAEd,OAAO,cAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACrH;;;;"}
1
+ {"version":3,"file":"account.mjs","sources":["../../src/account/account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { getSenderAddress } from '../transaction/transaction'\nimport { AccountAssetInformation, MultisigAccount, SigningAccount, TransactionSignerAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgorandClient } from '../types/algorand-client'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { SendTransactionFrom } from '../types/transaction'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport TransactionSigner = algosdk.TransactionSigner\nimport AccountInformationModel = algosdk.modelsv2.Account\n\n/**\n * @deprecated Use `algorand.account.multisig(multisigParams, signingAccounts)` or `new MultisigAccount(multisigParams, signingAccounts)` instead.\n *\n * Returns an account wrapper that supports partial or full multisig signing.\n * @param multisigParams The parameters that define the multisig account\n * @param signingAccounts The signers that are currently present\n * @returns A multisig account wrapper\n */\nexport function multisigAccount(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n return new MultisigAccount(multisigParams, signingAccounts)\n}\n\n/**\n * @deprecated Use `algorand.account.rekeyed(sender, account)` or `new SigningAccount(account, sender)` instead.\n *\n * Returns an account wrapper that supports a rekeyed account.\n * @param signer The account, with private key loaded, that is signing\n * @param sender The address of the rekeyed account that will act as a sender\n * @returns The SigningAccount wrapper\n */\nexport function rekeyedAccount(signer: Account, sender: string) {\n return new SigningAccount(signer, sender)\n}\n\n/**\n * @deprecated Use `algorand.account.getSigner(sender)` (after previously registering the signer with `setSigner`) or `{ addr: sender, signer }` instead.\n *\n * Returns an account wrapper that supports a transaction signer with associated sender address.\n * @param signer The transaction signer\n * @param sender The address of sender account\n * @returns The SigningAccount wrapper\n */\nexport function transactionSignerAccount(signer: TransactionSigner, sender: string): TransactionSignerAccount {\n return { addr: sender, signer }\n}\n\n/**\n * @deprecated Use `algorand.account.random()` or `algosdk.generateAccount()` instead.\n *\n * Returns a new, random Algorand account with secret key loaded.\n *\n * This is a wrapper around algosdk.generateAccount to provide a more friendly/obvious name.\n *\n */\nexport function randomAccount(): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.generateAccount()\n}\n\n/**\n * @deprecated Use `algorand.account.fromEnvironment(name, fundWith)` or `new AccountManager(clientManager).fromEnvironment()` instead.\n *\n * Returns an Algorand account with private key loaded by convention from environment variables based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.MY_ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await mnemonicAccountFromEnvironment('MY_ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n * If not running against LocalNet then it will use proces.env.MY_ACCOUNT_MNEMONIC as the private key and (if present) process.env.MY_ACCOUNT_SENDER as the sender address.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: string: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function mnemonicAccountFromEnvironment(\n account: string | { name: string; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n return (\n await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(\n typeof account === 'string' ? account : account.name,\n typeof account === 'string' ? undefined : account.fundWith,\n )\n ).account\n}\n\n/**\n * @deprecated Use `algosdk.decodeAddress` instead.\n *\n * Returns an account's address as a byte array\n *\n * @param account Either an account (with private key loaded) or the string address of an account\n */\nexport function getAccountAddressAsUint8Array(account: SendTransactionFrom | string) {\n return algosdk.decodeAddress(typeof account === 'string' ? account : getSenderAddress(account)).publicKey\n}\n\n/**\n * @deprecated Use `algosdk.encodeAddress` instead.\n *\n * Returns the string address of an Algorand account from a base64 encoded version of the underlying byte array of the address public key\n *\n * @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key\n */\nexport function getAccountAddressAsString(addressEncodedInB64: string): string {\n return algosdk.encodeAddress(Buffer.from(addressEncodedInB64, 'base64'))\n}\n\nexport type NumberConverter<T extends AccountInformationModel> = { [key in keyof T]: ToNumberIfExtends<T[key], number | bigint> }\ntype ToNumberIfExtends<K, E> = K extends E ? number : K\n/** @deprecated Account information at a given round. */\nexport type AccountInformation = Omit<NumberConverter<AccountInformationModel>, 'get_obj_for_encoding'>\n\n/**\n * @deprecated Use `algorand.account.getInformation(sender)` or `new AccountManager(clientManager).getInformation(sender)` instead.\n *\n * Returns the given sender account's current status, balance and spendable amounts.\n *\n * @example\n * ```typescript\n * const address = \"XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA\";\n * const accountInfo = await account.getInformation(address, algod);\n * ```\n *\n * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)\n * @param sender The address of the sender/account to look up\n * @param algod The algod instance\n * @returns The account information\n */\nexport async function getAccountInformation(sender: string | SendTransactionFrom, algod: Algodv2): Promise<AccountInformation> {\n const account = AccountInformationModel.from_obj_for_encoding(await algod.accountInformation(getSenderAddress(sender)).do())\n\n return {\n ...account,\n // None of these can practically overflow 2^53\n amount: Number(account.amount),\n amountWithoutPendingRewards: Number(account.amountWithoutPendingRewards),\n minBalance: Number(account.minBalance),\n pendingRewards: Number(account.pendingRewards),\n rewards: Number(account.rewards),\n round: Number(account.round),\n totalAppsOptedIn: Number(account.totalAppsOptedIn),\n totalAssetsOptedIn: Number(account.totalAssetsOptedIn),\n totalCreatedApps: Number(account.totalCreatedApps),\n totalCreatedAssets: Number(account.totalCreatedAssets),\n appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,\n rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,\n totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,\n totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,\n lastHeartbeat: account.lastHeartbeat !== undefined ? Number(account.lastHeartbeat) : undefined,\n lastProposed: account.lastProposed !== undefined ? Number(account.lastProposed) : undefined,\n }\n}\n\n/**\n * @deprecated Use `algorand.asset.getAccountInformation(sender, assetId)` or `new AssetManager(...).getAccountInformation(sender, assetId)` instead.\n *\n * Returns the given sender account's asset holding for a given asset.\n *\n * @example\n * ```typescript\n * const address = \"XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA\";\n * const assetId = 123345;\n * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);\n * ```\n *\n * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddressassetsasset-id)\n * @param sender The address of the sender/account to look up\n * @param assetId The ID of the asset to return a holding for\n * @param algod The algod instance\n * @returns The account asset holding information\n */\nexport async function getAccountAssetInformation(\n sender: string | SendTransactionFrom,\n assetId: number | bigint,\n algod: Algodv2,\n): Promise<AccountAssetInformation> {\n return AlgorandClient.fromClients({ algod }).asset.getAccountInformation(getSenderAddress(sender), BigInt(assetId))\n}\n"],"names":[],"mappings":";;;;;;;AAaA,IAAO,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAA;AAEzD;;;;;;;AAOG;AACa,SAAA,eAAe,CAAC,cAAgC,EAAE,eAA6C,EAAA;AAC7G,IAAA,OAAO,IAAI,eAAe,CAAC,cAAc,EAAE,eAAe,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;;;AAOG;AACa,SAAA,cAAc,CAAC,MAAe,EAAE,MAAc,EAAA;AAC5D,IAAA,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;;AAOG;AACa,SAAA,wBAAwB,CAAC,MAAyB,EAAE,MAAc,EAAA;AAChF,IAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AACjC,CAAC;AAED;;;;;;;AAOG;SACa,aAAa,GAAA;;AAE3B,IAAA,OAAO,OAAO,CAAC,eAAe,EAAE,CAAA;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACI,eAAe,8BAA8B,CAClD,OAAyD,EACzD,KAAc,EACd,SAAe,EAAA;IAEf,OAAO,CACL,MAAM,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAA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getAccountConfigFromEnvironment(accountName: string): AccountConfig;
13
- //# sourceMappingURL=get-account-config-from-environment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-account-config-from-environment.js","sources":["../../src/account/get-account-config-from-environment.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;AASG;AACG,SAAU,+BAA+B,CAAC,WAAmB,EAAA;IACjE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;KACtG;IAED,OAAO;AACL,QAAA,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,WAAW,CAAC,WAAW,EAAE,CAAW,SAAA,CAAA,CAAC,IAAI,EAAE;QAC3E,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAG,EAAA,WAAW,CAAC,WAAW,EAAE,CAAA,OAAA,CAAS,CAAC;QACjE,WAAW;KACZ,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"get-account-config-from-environment.js","sources":["../../src/account/get-account-config-from-environment.ts"],"sourcesContent":["import { AccountConfig } from '../types/account'\n\n/** @deprecated Use algokit.mnemonicAccountFromEnvironment, which doesn't need this function\n * Returns the Account configuration from environment variables\n *\n * @param accountName account name\n *\n * @example environment variables\n * {accountName}_MNEMONIC\n * {accountName}_SENDER\n *\n */\nexport function getAccountConfigFromEnvironment(accountName: string): AccountConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get account with private key from a non Node.js context; not supported!')\n }\n\n return {\n accountMnemonic: process.env[`${accountName.toUpperCase()}_MNEMONIC`] || '',\n senderAddress: process.env[`${accountName.toUpperCase()}_SENDER`],\n accountName,\n }\n}\n"],"names":[],"mappings":";;AAEA;;;;;;;;;AASG;AACG,SAAU,+BAA+B,CAAC,WAAmB,EAAA;IACjE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;KACtG;IAED,OAAO;AACL,QAAA,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,WAAW,CAAC,WAAW,EAAE,CAAW,SAAA,CAAA,CAAC,IAAI,EAAE;QAC3E,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAG,EAAA,WAAW,CAAC,WAAW,EAAE,CAAA,OAAA,CAAS,CAAC;QACjE,WAAW;KACZ,CAAA;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-account-config-from-environment.mjs","sources":["../../src/account/get-account-config-from-environment.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;;;AASG;AACG,SAAU,+BAA+B,CAAC,WAAmB,EAAA;IACjE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;KACtG;IAED,OAAO;AACL,QAAA,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,WAAW,CAAC,WAAW,EAAE,CAAW,SAAA,CAAA,CAAC,IAAI,EAAE;QAC3E,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAG,EAAA,WAAW,CAAC,WAAW,EAAE,CAAA,OAAA,CAAS,CAAC;QACjE,WAAW;KACZ,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"get-account-config-from-environment.mjs","sources":["../../src/account/get-account-config-from-environment.ts"],"sourcesContent":["import { AccountConfig } from '../types/account'\n\n/** @deprecated Use algokit.mnemonicAccountFromEnvironment, which doesn't need this function\n * Returns the Account configuration from environment variables\n *\n * @param accountName account name\n *\n * @example environment variables\n * {accountName}_MNEMONIC\n * {accountName}_SENDER\n *\n */\nexport function getAccountConfigFromEnvironment(accountName: string): AccountConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get account with private key from a non Node.js context; not supported!')\n }\n\n return {\n accountMnemonic: process.env[`${accountName.toUpperCase()}_MNEMONIC`] || '',\n senderAddress: process.env[`${accountName.toUpperCase()}_SENDER`],\n accountName,\n }\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;;AASG;AACG,SAAU,+BAA+B,CAAC,WAAmB,EAAA;IACjE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;KACtG;IAED,OAAO;AACL,QAAA,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,WAAW,CAAC,WAAW,EAAE,CAAW,SAAA,CAAA,CAAC,IAAI,EAAE;QAC3E,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAG,EAAA,WAAW,CAAC,WAAW,EAAE,CAAA,OAAA,CAAS,CAAC;QACjE,WAAW;KACZ,CAAA;AACH;;;;"}
@@ -63,4 +63,3 @@ export declare function getAccount(account: {
63
63
  config: AccountConfig;
64
64
  fundWith?: AlgoAmount;
65
65
  }, algod: Algodv2, kmdClient?: Kmd): Promise<Account | SigningAccount>;
66
- //# sourceMappingURL=get-account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-account.js","sources":["../../src/account/get-account.ts"],"sourcesContent":[null],"names":["getAccountConfigFromEnvironment","AccountManager","ClientManager"],"mappings":";;;;;;AAyEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,eAAe,UAAU,CAC9B,OAA4G,EAC5G,KAAc,EACd,SAAe,EAAA;AAEf,IAAA,IAAI,IAAY,CAAA;IAChB,IAAI,QAAQ,GAA2B,SAAS,CAAA;AAChD,IAAA,IAAI,MAAqB,CAAA;AAEzB,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,IAAI,GAAG,OAAO,CAAA;AACd,QAAA,MAAM,GAAGA,+DAA+B,CAAC,IAAI,CAAC,CAAA;KAC/C;AAAM,SAAA,IAAI,MAAM,IAAI,OAAO,EAAE;AAC5B,QAAA,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACnB,QAAA,MAAM,GAAGA,+DAA+B,CAAC,IAAI,CAAC,CAAA;AAC9C,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;AAAM,SAAA,IAAI,QAAQ,IAAI,OAAO,EAAE;AAC9B,QAAA,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AACvB,QAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAA;AACzB,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;SAAM;AACL,QAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;KAClD;IAED,OAAO,CAAC,MAAM,IAAIC,mCAAc,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;AACzH;;;;"}
1
+ {"version":3,"file":"get-account.js","sources":["../../src/account/get-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountConfig, SigningAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { getAccountConfigFromEnvironment } from './get-account-config-from-environment'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n *\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount('ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName)\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { config: AccountConfig; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName) OR\n * * `name`: string: The name identifier of the account (deprecated)\n * And optionally\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | { config: AccountConfig; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n let name: string\n let fundWith: AlgoAmount | undefined = undefined\n let config: AccountConfig\n\n if (typeof account === 'string') {\n name = account\n config = getAccountConfigFromEnvironment(name)\n } else if ('name' in account) {\n name = account.name\n config = getAccountConfigFromEnvironment(name)\n fundWith = account.fundWith\n } else if ('config' in account) {\n config = account.config\n name = config.accountName\n fundWith = account.fundWith\n } else {\n throw new Error('Missing name or account config')\n }\n\n return (await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(name, fundWith)).account\n}\n"],"names":["getAccountConfigFromEnvironment","AccountManager","ClientManager"],"mappings":";;;;;;AAyEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,eAAe,UAAU,CAC9B,OAA4G,EAC5G,KAAc,EACd,SAAe,EAAA;AAEf,IAAA,IAAI,IAAY,CAAA;IAChB,IAAI,QAAQ,GAA2B,SAAS,CAAA;AAChD,IAAA,IAAI,MAAqB,CAAA;AAEzB,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,IAAI,GAAG,OAAO,CAAA;AACd,QAAA,MAAM,GAAGA,+DAA+B,CAAC,IAAI,CAAC,CAAA;KAC/C;AAAM,SAAA,IAAI,MAAM,IAAI,OAAO,EAAE;AAC5B,QAAA,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACnB,QAAA,MAAM,GAAGA,+DAA+B,CAAC,IAAI,CAAC,CAAA;AAC9C,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;AAAM,SAAA,IAAI,QAAQ,IAAI,OAAO,EAAE;AAC9B,QAAA,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AACvB,QAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAA;AACzB,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;SAAM;AACL,QA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AAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;AACzH;;;;"}
1
+ {"version":3,"file":"get-account.mjs","sources":["../../src/account/get-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountConfig, SigningAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { getAccountConfigFromEnvironment } from './get-account-config-from-environment'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n *\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount('ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName)\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { config: AccountConfig; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName) OR\n * * `name`: string: The name identifier of the account (deprecated)\n * And optionally\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | { config: AccountConfig; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n let name: string\n let fundWith: AlgoAmount | undefined = undefined\n let config: AccountConfig\n\n if (typeof account === 'string') {\n name = account\n config = getAccountConfigFromEnvironment(name)\n } else if ('name' in account) {\n name = account.name\n config = getAccountConfigFromEnvironment(name)\n fundWith = account.fundWith\n } else if ('config' in account) {\n config = account.config\n name = config.accountName\n fundWith = account.fundWith\n } else {\n throw new Error('Missing name or account config')\n }\n\n return (await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(name, fundWith)).account\n}\n"],"names":[],"mappings":";;;;AAyEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,eAAe,UAAU,CAC9B,OAA4G,EAC5G,KAAc,EACd,SAAe,EAAA;AAEf,IAAA,IAAI,IAAY,CAAA;IAChB,IAAI,QAAQ,GAA2B,SAAS,CAAA;AAChD,IAAA,IAAI,MAAqB,CAAA;AAEzB,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,IAAI,GAAG,OAAO,CAAA;AACd,QAAA,MAAM,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAA;KAC/C;AAAM,SAAA,IAAI,MAAM,IAAI,OAAO,EAAE;AAC5B,QAAA,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACnB,QAAA,MAAM,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAA;AAC9C,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;AAAM,SAAA,IAAI,QAAQ,IAAI,OAAO,EAAE;AAC9B,QAAA,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AACvB,QAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAA;AACzB,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;SAAM;AACL,QAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;KAClD;IAED,OAAO,CAAC,MAAM,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;AACzH;;;;"}
@@ -15,4 +15,3 @@ import Kmd = algosdk.Kmd;
15
15
  export declare function getDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<import("../types/account").TransactionSignerAccount & {
16
16
  account: import("../types/account").SigningAccount;
17
17
  }>;
18
- //# sourceMappingURL=get-dispenser-account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-dispenser-account.js","sources":["../../src/account/get-dispenser-account.ts"],"sourcesContent":[null],"names":["AccountManager","ClientManager"],"mappings":";;;;;AAOA;;;;;;;;;;AAUG;AACI,eAAe,mBAAmB,CAAC,KAAc,EAAE,GAAS,EAAA;AACjE,IAAA,OAAO,IAAIA,mCAAc,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAA;AACzF;;;;"}
1
+ {"version":3,"file":"get-dispenser-account.js","sources":["../../src/account/get-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\n\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated Use `algorand.account.dispenserFromEnvironment()` or `new AccountManager(clientManager).dispenserFromEnvironment()` instead\n *\n * Returns an account (with private key loaded) that can act as a dispenser\n *\n * If running on LocalNet then it will return the default dispenser account automatically,\n * otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getDispenserAccount(algod: Algodv2, kmd?: Kmd) {\n return new AccountManager(new ClientManager({ algod, kmd })).dispenserFromEnvironment()\n}\n"],"names":["AccountManager","ClientManager"],"mappings":";;;;;AAOA;;;;;;;;;;AAUG;AACI,eAAe,mBAAmB,CAAC,KAAc,EAAE,GAAS,EAAA;AACjE,IAAA,OAAO,IAAIA,mCAAc,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAA;AACzF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-dispenser-account.mjs","sources":["../../src/account/get-dispenser-account.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAOA;;;;;;;;;;AAUG;AACI,eAAe,mBAAmB,CAAC,KAAc,EAAE,GAAS,EAAA;AACjE,IAAA,OAAO,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAA;AACzF;;;;"}
1
+ {"version":3,"file":"get-dispenser-account.mjs","sources":["../../src/account/get-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\n\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated Use `algorand.account.dispenserFromEnvironment()` or `new AccountManager(clientManager).dispenserFromEnvironment()` instead\n *\n * Returns an account (with private key loaded) that can act as a dispenser\n *\n * If running on LocalNet then it will return the default dispenser account automatically,\n * otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getDispenserAccount(algod: Algodv2, kmd?: Kmd) {\n return new AccountManager(new ClientManager({ algod, kmd })).dispenserFromEnvironment()\n}\n"],"names":[],"mappings":";;;AAOA;;;;;;;;;;AAUG;AACI,eAAe,mBAAmB,CAAC,KAAc,EAAE,GAAS,EAAA;AACjE,IAAA,OAAO,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAA;AACzF;;;;"}
@@ -3,4 +3,3 @@ export * from './get-account';
3
3
  export * from './get-account-config-from-environment';
4
4
  export * from './get-dispenser-account';
5
5
  export * from './mnemonic-account';
6
- //# sourceMappingURL=index.d.ts.map
@@ -11,4 +11,3 @@ import Account = algosdk.Account;
11
11
  * never commit it into source control and ideally load it from the environment (ideally via a secret storage service) rather than the file system.
12
12
  */
13
13
  export declare function mnemonicAccount(mnemonicSecret: string): Account;
14
- //# sourceMappingURL=mnemonic-account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mnemonic-account.js","sources":["../../src/account/mnemonic-account.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAGA;;;;;;;;;AASG;AACG,SAAU,eAAe,CAAC,cAAsB,EAAA;;AAEpD,IAAA,OAAO,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AACpD;;;;"}
1
+ {"version":3,"file":"mnemonic-account.js","sources":["../../src/account/mnemonic-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport Account = algosdk.Account\n\n/**\n * @deprecated Use `algorand.account.fromMnemonic(mnemonicSecret)` or `algosdk.mnemonicToSecretKey(mnemonicSecret)` instead.\n *\n * Returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.\n *\n * This is a wrapper around algosdk.mnemonicToSecretKey to provide a more friendly/obvious name.\n *\n * @param mnemonicSecret The mnemonic secret representing the private key of an account; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it from the environment (ideally via a secret storage service) rather than the file system.\n */\nexport function mnemonicAccount(mnemonicSecret: string): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.mnemonicToSecretKey(mnemonicSecret)\n}\n"],"names":[],"mappings":";;;;AAGA;;;;;;;;;AASG;AACG,SAAU,eAAe,CAAC,cAAsB,EAAA;;AAEpD,IAAA,OAAO,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AACpD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"mnemonic-account.mjs","sources":["../../src/account/mnemonic-account.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;;;;;;;;AASG;AACG,SAAU,eAAe,CAAC,cAAsB,EAAA;;AAEpD,IAAA,OAAO,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AACpD;;;;"}
1
+ {"version":3,"file":"mnemonic-account.mjs","sources":["../../src/account/mnemonic-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport Account = algosdk.Account\n\n/**\n * @deprecated Use `algorand.account.fromMnemonic(mnemonicSecret)` or `algosdk.mnemonicToSecretKey(mnemonicSecret)` instead.\n *\n * Returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.\n *\n * This is a wrapper around algosdk.mnemonicToSecretKey to provide a more friendly/obvious name.\n *\n * @param mnemonicSecret The mnemonic secret representing the private key of an account; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it from the environment (ideally via a secret storage service) rather than the file system.\n */\nexport function mnemonicAccount(mnemonicSecret: string): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.mnemonicToSecretKey(mnemonicSecret)\n}\n"],"names":[],"mappings":";;AAGA;;;;;;;;;AASG;AACG,SAAU,eAAe,CAAC,cAAsB,EAAA;;AAEpD,IAAA,OAAO,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AACpD;;;;"}
package/amount.d.ts CHANGED
@@ -18,25 +18,34 @@ declare global {
18
18
  */
19
19
  algo(this: number): AlgoAmount;
20
20
  }
21
+ interface BigInt {
22
+ /**
23
+ * Returns an `AlgoAmount` using this number of microAlgo.
24
+ */
25
+ microAlgo(this: bigint): AlgoAmount;
26
+ /**
27
+ * Returns an `AlgoAmount` using this number of Algo.
28
+ */
29
+ algo(this: bigint): AlgoAmount;
30
+ }
21
31
  }
22
32
  /** Returns an amount of Algo using AlgoAmount
23
33
  * @param algos The amount of Algo
24
34
  */
25
- export declare const algos: (algos: number) => AlgoAmount;
35
+ export declare const algos: (algos: number | bigint) => AlgoAmount;
26
36
  /** Returns an amount of Algo using AlgoAmount
27
37
  * @param algos The amount of Algo
28
38
  */
29
- export declare const algo: (algos: number) => AlgoAmount;
39
+ export declare const algo: (algos: number | bigint) => AlgoAmount;
30
40
  /** Returns an amount of µAlgo using AlgoAmount
31
41
  * @param microAlgos The amount of µAlgo
32
42
  */
33
- export declare const microAlgos: (microAlgos: number) => AlgoAmount;
43
+ export declare const microAlgos: (microAlgos: number | bigint) => AlgoAmount;
34
44
  /** Returns an amount of µAlgo using AlgoAmount
35
45
  * @param microAlgos The amount of µAlgo
36
46
  */
37
- export declare const microAlgo: (microAlgos: number) => AlgoAmount;
47
+ export declare const microAlgo: (microAlgos: number | bigint) => AlgoAmount;
38
48
  /** Returns an amount of µAlgo to cover standard fees for the given number of transactions using AlgoAmount
39
49
  * @param numberOfTransactions The of standard transaction fees to return the amount of Algo
40
50
  */
41
51
  export declare const transactionFees: (numberOfTransactions: number) => AlgoAmount;
42
- //# sourceMappingURL=amount.d.ts.map
package/amount.js CHANGED
@@ -15,6 +15,12 @@ Number.prototype.microAlgo = function () {
15
15
  Number.prototype.algo = function () {
16
16
  return types_amount.AlgoAmount.Algo(this);
17
17
  };
18
+ BigInt.prototype.microAlgo = function () {
19
+ return types_amount.AlgoAmount.MicroAlgo(this);
20
+ };
21
+ BigInt.prototype.algo = function () {
22
+ return types_amount.AlgoAmount.Algo(this);
23
+ };
18
24
  /** Returns an amount of Algo using AlgoAmount
19
25
  * @param algos The amount of Algo
20
26
  */
package/amount.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"amount.js","sources":["../src/amount.ts"],"sourcesContent":[null],"names":["AlgoAmount"],"mappings":";;;;;AAwBA,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,YAAA;AAC5B,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,YAAA;AACvB,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED;;AAEG;AACU,MAAA,KAAK,GAAG,CAAC,KAAa,KAAI;AACrC,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,IAAI,GAAG,CAAC,KAAa,KAAI;AACpC,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,UAAU,GAAG,CAAC,UAAkB,KAAI;AAC/C,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,SAAS,GAAG,CAAC,UAAkB,KAAI;AAC9C,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,eAAe,GAAG,CAAC,oBAA4B,KAAI;IAC9D,OAAOA,uBAAU,CAAC,SAAS,CAAC,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACjF;;;;;;;;"}
1
+ {"version":3,"file":"amount.js","sources":["../src/amount.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AlgoAmount } from './types/amount'\n\ndeclare global {\n interface Number {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: number): AlgoAmount\n }\n interface BigInt {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: bigint): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: bigint): AlgoAmount\n }\n}\n\nNumber.prototype.microAlgos = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algos = function () {\n return AlgoAmount.Algo(this)\n}\n\nNumber.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\nBigInt.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nBigInt.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algos = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algo = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgos = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgo = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo to cover standard fees for the given number of transactions using AlgoAmount\n * @param numberOfTransactions The of standard transaction fees to return the amount of Algo\n */\nexport const transactionFees = (numberOfTransactions: number) => {\n return AlgoAmount.MicroAlgo(numberOfTransactions * algosdk.ALGORAND_MIN_TX_FEE)\n}\n"],"names":["AlgoAmount"],"mappings":";;;;;AAkCA,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,YAAA;AAC5B,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,YAAA;AACvB,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED;;AAEG;AACU,MAAA,KAAK,GAAG,CAAC,KAAsB,KAAI;AAC9C,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,IAAI,GAAG,CAAC,KAAsB,KAAI;AAC7C,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,UAAU,GAAG,CAAC,UAA2B,KAAI;AACxD,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,SAAS,GAAG,CAAC,UAA2B,KAAI;AACvD,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,eAAe,GAAG,CAAC,oBAA4B,KAAI;IAC9D,OAAOA,uBAAU,CAAC,SAAS,CAAC,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACjF;;;;;;;;"}
package/amount.mjs CHANGED
@@ -13,6 +13,12 @@ Number.prototype.microAlgo = function () {
13
13
  Number.prototype.algo = function () {
14
14
  return AlgoAmount.Algo(this);
15
15
  };
16
+ BigInt.prototype.microAlgo = function () {
17
+ return AlgoAmount.MicroAlgo(this);
18
+ };
19
+ BigInt.prototype.algo = function () {
20
+ return AlgoAmount.Algo(this);
21
+ };
16
22
  /** Returns an amount of Algo using AlgoAmount
17
23
  * @param algos The amount of Algo
18
24
  */
package/amount.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"amount.mjs","sources":["../src/amount.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAwBA,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,YAAA;AAC5B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,YAAA;AACvB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED;;AAEG;AACU,MAAA,KAAK,GAAG,CAAC,KAAa,KAAI;AACrC,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,IAAI,GAAG,CAAC,KAAa,KAAI;AACpC,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,UAAU,GAAG,CAAC,UAAkB,KAAI;AAC/C,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,SAAS,GAAG,CAAC,UAAkB,KAAI;AAC9C,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,eAAe,GAAG,CAAC,oBAA4B,KAAI;IAC9D,OAAO,UAAU,CAAC,SAAS,CAAC,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACjF;;;;"}
1
+ {"version":3,"file":"amount.mjs","sources":["../src/amount.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AlgoAmount } from './types/amount'\n\ndeclare global {\n interface Number {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: number): AlgoAmount\n }\n interface BigInt {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: bigint): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: bigint): AlgoAmount\n }\n}\n\nNumber.prototype.microAlgos = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algos = function () {\n return AlgoAmount.Algo(this)\n}\n\nNumber.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\nBigInt.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nBigInt.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algos = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algo = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgos = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgo = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo to cover standard fees for the given number of transactions using AlgoAmount\n * @param numberOfTransactions The of standard transaction fees to return the amount of Algo\n */\nexport const transactionFees = (numberOfTransactions: number) => {\n return AlgoAmount.MicroAlgo(numberOfTransactions * algosdk.ALGORAND_MIN_TX_FEE)\n}\n"],"names":[],"mappings":";;;AAkCA,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,YAAA;AAC5B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,YAAA;AACvB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED;;AAEG;AACU,MAAA,KAAK,GAAG,CAAC,KAAsB,KAAI;AAC9C,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,IAAI,GAAG,CAAC,KAAsB,KAAI;AAC7C,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,UAAU,GAAG,CAAC,UAA2B,KAAI;AACxD,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,SAAS,GAAG,CAAC,UAA2B,KAAI;AACvD,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,eAAe,GAAG,CAAC,oBAA4B,KAAI;IAC9D,OAAO,UAAU,CAAC,SAAS,CAAC,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACjF;;;;"}
package/app-client.d.ts CHANGED
@@ -2,6 +2,11 @@ import algosdk from 'algosdk';
2
2
  import { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetailsById, ApplicationClient } from './types/app-client';
3
3
  import Algodv2 = algosdk.Algodv2;
4
4
  /**
5
+ * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
6
+ * `algorand.client.getAppClientByCreatorAndName`.
7
+ * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
8
+ * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
9
+ *
5
10
  * Create a new ApplicationClient instance
6
11
  * @param appDetails The details of the app
7
12
  * @param algod An algod instance
@@ -33,6 +38,11 @@ import Algodv2 = algosdk.Algodv2;
33
38
  */
34
39
  export declare function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2): ApplicationClient;
35
40
  /**
41
+ * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.
42
+ * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
43
+ * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
44
+ *
45
+ *
36
46
  * Create a new ApplicationClient instance by id
37
47
  * @param appDetails The details of the app
38
48
  * @param algod An algod instance
@@ -51,6 +61,11 @@ export declare function getAppClient(appDetails: AppSpecAppDetails, algod: Algod
51
61
  */
52
62
  export declare function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algodv2): ApplicationClient;
53
63
  /**
64
+ * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.
65
+ * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
66
+ * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
67
+ *
68
+ *
54
69
  * Create a new ApplicationClient instance by creator and name
55
70
  * @param appDetails The details of the app by creator and name
56
71
  * @param algod An algod instance
@@ -69,4 +84,3 @@ export declare function getAppClientById(appDetails: AppSpecAppDetailsById, algo
69
84
  * @returns The application client
70
85
  */
71
86
  export declare function getAppClientByCreatorAndName(appDetails: AppSpecAppDetailsByCreatorAndName, algod: Algodv2): ApplicationClient;
72
- //# sourceMappingURL=app-client.d.ts.map
package/app-client.js CHANGED
@@ -3,6 +3,11 @@
3
3
  var types_appClient = require('./types/app-client.js');
4
4
 
5
5
  /**
6
+ * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
7
+ * `algorand.client.getAppClientByCreatorAndName`.
8
+ * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
9
+ * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
10
+ *
6
11
  * Create a new ApplicationClient instance
7
12
  * @param appDetails The details of the app
8
13
  * @param algod An algod instance
@@ -36,6 +41,11 @@ function getAppClient(appDetails, algod) {
36
41
  return new types_appClient.ApplicationClient(appDetails, algod);
37
42
  }
38
43
  /**
44
+ * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.
45
+ * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
46
+ * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
47
+ *
48
+ *
39
49
  * Create a new ApplicationClient instance by id
40
50
  * @param appDetails The details of the app
41
51
  * @param algod An algod instance
@@ -56,6 +66,11 @@ function getAppClientById(appDetails, algod) {
56
66
  return new types_appClient.ApplicationClient({ ...appDetails, resolveBy: 'id' }, algod);
57
67
  }
58
68
  /**
69
+ * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.
70
+ * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
71
+ * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
72
+ *
73
+ *
59
74
  * Create a new ApplicationClient instance by creator and name
60
75
  * @param appDetails The details of the app by creator and name
61
76
  * @param algod An algod instance
package/app-client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app-client.js","sources":["../src/app-client.ts"],"sourcesContent":[null],"names":["ApplicationClient"],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACa,SAAA,YAAY,CAAC,UAA6B,EAAE,KAAc,EAAA;AACxE,IAAA,OAAO,IAAIA,iCAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;AAgBG;AACa,SAAA,gBAAgB,CAAC,UAAiC,EAAE,KAAc,EAAA;AAChF,IAAA,OAAO,IAAIA,iCAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;AACzE,CAAC;AAED;;;;;;;;;;;;;;;;;AAiBG;AACa,SAAA,4BAA4B,CAAC,UAA6C,EAAE,KAAc,EAAA;AACxG,IAAA,OAAO,IAAIA,iCAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,CAAA;AACrF;;;;;;"}
1
+ {"version":3,"file":"app-client.js","sources":["../src/app-client.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetailsById, ApplicationClient } from './types/app-client'\nimport Algodv2 = algosdk.Algodv2\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or\n * `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n * Create a new ApplicationClient instance\n * @param appDetails The details of the app\n * @param algod An algod instance\n *\n * @example Resolve by creator and name\n * const client = algokit.getAppClient(\n * {\n * resolveBy: 'creatorAndName',\n * app: {appSpec},\n * sender: {account},\n * creatorAddress: {creator},\n * findExistingUsing: indexerClient,\n * },\n * algodClient,\n * )\n *\n * @example Resolve by id:\n * const client = algokit.getAppClient(\n * {\n * resolveBy: 'id',\n * app: {appSpec},\n * sender: {account},\n * id: {id},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) {\n return new ApplicationClient(appDetails, algod)\n}\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n *\n * Create a new ApplicationClient instance by id\n * @param appDetails The details of the app\n * @param algod An algod instance\n *\n * @example\n * const client = algokit.getAppClientById(\n * {\n * app: {appSpec},\n * sender: {account},\n * id: {id},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algodv2) {\n return new ApplicationClient({ ...appDetails, resolveBy: 'id' }, algod)\n}\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n *\n * Create a new ApplicationClient instance by creator and name\n * @param appDetails The details of the app by creator and name\n * @param algod An algod instance\n *\n * @example\n * const client = algokit.getAppClientByCreatorAndName(\n * {\n * app: {appSpec},\n * sender: {account},\n * creatorAddress: {account.addr},\n * findExistingUsing: {indexerClient},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClientByCreatorAndName(appDetails: AppSpecAppDetailsByCreatorAndName, algod: Algodv2) {\n return new ApplicationClient({ ...appDetails, resolveBy: 'creatorAndName' }, algod)\n}\n"],"names":["ApplicationClient"],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACa,SAAA,YAAY,CAAC,UAA6B,EAAE,KAAc,EAAA;AACxE,IAAA,OAAO,IAAIA,iCAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;AAqBG;AACa,SAAA,gBAAgB,CAAC,UAAiC,EAAE,KAAc,EAAA;AAChF,IAAA,OAAO,IAAIA,iCAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;AACzE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACa,SAAA,4BAA4B,CAAC,UAA6C,EAAE,KAAc,EAAA;AACxG,IAAA,OAAO,IAAIA,iCAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,CAAA;AACrF;;;;;;"}
package/app-client.mjs CHANGED
@@ -1,6 +1,11 @@
1
1
  import { ApplicationClient } from './types/app-client.mjs';
2
2
 
3
3
  /**
4
+ * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
5
+ * `algorand.client.getAppClientByCreatorAndName`.
6
+ * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
7
+ * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
8
+ *
4
9
  * Create a new ApplicationClient instance
5
10
  * @param appDetails The details of the app
6
11
  * @param algod An algod instance
@@ -34,6 +39,11 @@ function getAppClient(appDetails, algod) {
34
39
  return new ApplicationClient(appDetails, algod);
35
40
  }
36
41
  /**
42
+ * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.
43
+ * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
44
+ * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
45
+ *
46
+ *
37
47
  * Create a new ApplicationClient instance by id
38
48
  * @param appDetails The details of the app
39
49
  * @param algod An algod instance
@@ -54,6 +64,11 @@ function getAppClientById(appDetails, algod) {
54
64
  return new ApplicationClient({ ...appDetails, resolveBy: 'id' }, algod);
55
65
  }
56
66
  /**
67
+ * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.
68
+ * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
69
+ * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
70
+ *
71
+ *
57
72
  * Create a new ApplicationClient instance by creator and name
58
73
  * @param appDetails The details of the app by creator and name
59
74
  * @param algod An algod instance
@@ -1 +1 @@
1
- {"version":3,"file":"app-client.mjs","sources":["../src/app-client.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACa,SAAA,YAAY,CAAC,UAA6B,EAAE,KAAc,EAAA;AACxE,IAAA,OAAO,IAAI,iBAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;AAgBG;AACa,SAAA,gBAAgB,CAAC,UAAiC,EAAE,KAAc,EAAA;AAChF,IAAA,OAAO,IAAI,iBAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;AACzE,CAAC;AAED;;;;;;;;;;;;;;;;;AAiBG;AACa,SAAA,4BAA4B,CAAC,UAA6C,EAAE,KAAc,EAAA;AACxG,IAAA,OAAO,IAAI,iBAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,CAAA;AACrF;;;;"}
1
+ {"version":3,"file":"app-client.mjs","sources":["../src/app-client.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetailsById, ApplicationClient } from './types/app-client'\nimport Algodv2 = algosdk.Algodv2\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or\n * `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n * Create a new ApplicationClient instance\n * @param appDetails The details of the app\n * @param algod An algod instance\n *\n * @example Resolve by creator and name\n * const client = algokit.getAppClient(\n * {\n * resolveBy: 'creatorAndName',\n * app: {appSpec},\n * sender: {account},\n * creatorAddress: {creator},\n * findExistingUsing: indexerClient,\n * },\n * algodClient,\n * )\n *\n * @example Resolve by id:\n * const client = algokit.getAppClient(\n * {\n * resolveBy: 'id',\n * app: {appSpec},\n * sender: {account},\n * id: {id},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) {\n return new ApplicationClient(appDetails, algod)\n}\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n *\n * Create a new ApplicationClient instance by id\n * @param appDetails The details of the app\n * @param algod An algod instance\n *\n * @example\n * const client = algokit.getAppClientById(\n * {\n * app: {appSpec},\n * sender: {account},\n * id: {id},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algodv2) {\n return new ApplicationClient({ ...appDetails, resolveBy: 'id' }, algod)\n}\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n *\n * Create a new ApplicationClient instance by creator and name\n * @param appDetails The details of the app by creator and name\n * @param algod An algod instance\n *\n * @example\n * const client = algokit.getAppClientByCreatorAndName(\n * {\n * app: {appSpec},\n * sender: {account},\n * creatorAddress: {account.addr},\n * findExistingUsing: {indexerClient},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClientByCreatorAndName(appDetails: AppSpecAppDetailsByCreatorAndName, algod: Algodv2) {\n return new ApplicationClient({ ...appDetails, resolveBy: 'creatorAndName' }, algod)\n}\n"],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACa,SAAA,YAAY,CAAC,UAA6B,EAAE,KAAc,EAAA;AACxE,IAAA,OAAO,IAAI,iBAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;AAqBG;AACa,SAAA,gBAAgB,CAAC,UAAiC,EAAE,KAAc,EAAA;AAChF,IAAA,OAAO,IAAI,iBAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;AACzE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACa,SAAA,4BAA4B,CAAC,UAA6C,EAAE,KAAc,EAAA;AACxG,IAAA,OAAO,IAAI,iBAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,CAAA;AACrF;;;;"}
package/app-deploy.d.ts CHANGED
@@ -118,4 +118,3 @@ export declare function performTemplateSubstitutionAndCompile(tealCode: string,
118
118
  * @returns The TEAL without comments
119
119
  */
120
120
  export declare function stripTealComments(tealCode: string): string;
121
- //# sourceMappingURL=app-deploy.d.ts.map