@algorandfoundation/algokit-utils 9.2.0 → 9.2.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/_virtual/_rolldown/runtime.js +33 -0
  2. package/_virtual/_rolldown/runtime.mjs +13 -0
  3. package/account/account.d.ts +25 -30
  4. package/account/account.js +151 -146
  5. package/account/account.js.map +1 -1
  6. package/account/account.mjs +149 -144
  7. package/account/account.mjs.map +1 -1
  8. package/account/get-account-config-from-environment.d.ts +7 -2
  9. package/account/get-account-config-from-environment.js +19 -21
  10. package/account/get-account-config-from-environment.js.map +1 -1
  11. package/account/get-account-config-from-environment.mjs +19 -19
  12. package/account/get-account-config-from-environment.mjs.map +1 -1
  13. package/account/get-account.d.ts +14 -12
  14. package/account/get-account.js +56 -59
  15. package/account/get-account.js.map +1 -1
  16. package/account/get-account.mjs +56 -57
  17. package/account/get-account.mjs.map +1 -1
  18. package/account/get-dispenser-account.d.ts +9 -5
  19. package/account/get-dispenser-account.js +20 -18
  20. package/account/get-dispenser-account.js.map +1 -1
  21. package/account/get-dispenser-account.mjs +20 -16
  22. package/account/get-dispenser-account.mjs.map +1 -1
  23. package/account/mnemonic-account.d.ts +7 -3
  24. package/account/mnemonic-account.js +17 -17
  25. package/account/mnemonic-account.js.map +1 -1
  26. package/account/mnemonic-account.mjs +15 -15
  27. package/account/mnemonic-account.mjs.map +1 -1
  28. package/amount.d.ts +40 -35
  29. package/amount.js +33 -34
  30. package/amount.js.map +1 -1
  31. package/amount.mjs +33 -32
  32. package/amount.mjs.map +1 -1
  33. package/app-client.d.ts +10 -6
  34. package/app-client.js +91 -86
  35. package/app-client.js.map +1 -1
  36. package/app-client.mjs +91 -84
  37. package/app-client.mjs.map +1 -1
  38. package/app-deploy.d.ts +26 -24
  39. package/app-deploy.js +235 -253
  40. package/app-deploy.js.map +1 -1
  41. package/app-deploy.mjs +233 -251
  42. package/app-deploy.mjs.map +1 -1
  43. package/app.d.ts +45 -46
  44. package/app.js +253 -271
  45. package/app.js.map +1 -1
  46. package/app.mjs +249 -267
  47. package/app.mjs.map +1 -1
  48. package/asset.d.ts +16 -12
  49. package/asset.js +116 -122
  50. package/asset.js.map +1 -1
  51. package/asset.mjs +116 -120
  52. package/asset.mjs.map +1 -1
  53. package/config.d.ts +7 -2
  54. package/config.js +5 -7
  55. package/config.js.map +1 -1
  56. package/config.mjs +5 -4
  57. package/config.mjs.map +1 -1
  58. package/debugging/debugging.d.ts +5 -1
  59. package/debugging/debugging.js +11 -11
  60. package/debugging/debugging.js.map +1 -1
  61. package/debugging/debugging.mjs +11 -9
  62. package/debugging/debugging.mjs.map +1 -1
  63. package/dispenser-client.d.ts +7 -2
  64. package/dispenser-client.js +23 -24
  65. package/dispenser-client.js.map +1 -1
  66. package/dispenser-client.mjs +23 -22
  67. package/dispenser-client.mjs.map +1 -1
  68. package/index.d.ts +27 -18
  69. package/index.js +140 -143
  70. package/index.mjs +27 -29
  71. package/indexer-lookup.d.ts +18 -11
  72. package/indexer-lookup.js +112 -120
  73. package/indexer-lookup.js.map +1 -1
  74. package/indexer-lookup.mjs +105 -118
  75. package/indexer-lookup.mjs.map +1 -1
  76. package/localnet/get-kmd-wallet-account.d.ts +9 -7
  77. package/localnet/get-kmd-wallet-account.js +28 -26
  78. package/localnet/get-kmd-wallet-account.js.map +1 -1
  79. package/localnet/get-kmd-wallet-account.mjs +28 -24
  80. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  81. package/localnet/get-localnet-dispenser-account.d.ts +7 -5
  82. package/localnet/get-localnet-dispenser-account.js +17 -15
  83. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  84. package/localnet/get-localnet-dispenser-account.mjs +17 -13
  85. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  86. package/localnet/get-or-create-kmd-wallet-account.d.ts +10 -8
  87. package/localnet/get-or-create-kmd-wallet-account.js +28 -26
  88. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  89. package/localnet/get-or-create-kmd-wallet-account.mjs +28 -24
  90. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  91. package/localnet/is-localnet.d.ts +7 -3
  92. package/localnet/is-localnet.js +9 -10
  93. package/localnet/is-localnet.js.map +1 -1
  94. package/localnet/is-localnet.mjs +9 -8
  95. package/localnet/is-localnet.mjs.map +1 -1
  96. package/network-client.d.ts +17 -15
  97. package/network-client.js +115 -116
  98. package/network-client.js.map +1 -1
  99. package/network-client.mjs +115 -114
  100. package/network-client.mjs.map +1 -1
  101. package/package.json +12 -3
  102. package/testing/account.d.ts +11 -9
  103. package/testing/account.js +31 -33
  104. package/testing/account.js.map +1 -1
  105. package/testing/account.mjs +29 -31
  106. package/testing/account.mjs.map +1 -1
  107. package/testing/fixtures/algokit-log-capture-fixture.d.ts +7 -2
  108. package/testing/fixtures/algokit-log-capture-fixture.js +36 -41
  109. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  110. package/testing/fixtures/algokit-log-capture-fixture.mjs +36 -39
  111. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  112. package/testing/fixtures/algorand-fixture.d.ts +9 -4
  113. package/testing/fixtures/algorand-fixture.js +67 -62
  114. package/testing/fixtures/algorand-fixture.js.map +1 -1
  115. package/testing/fixtures/algorand-fixture.mjs +66 -59
  116. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  117. package/testing/index.d.ts +7 -5
  118. package/testing/index.js +13 -18
  119. package/testing/index.mjs +7 -7
  120. package/testing/indexer.d.ts +5 -1
  121. package/testing/indexer.js +28 -37
  122. package/testing/indexer.js.map +1 -1
  123. package/testing/indexer.mjs +28 -35
  124. package/testing/indexer.mjs.map +1 -1
  125. package/testing/test-logger.d.ts +41 -36
  126. package/testing/test-logger.js +71 -76
  127. package/testing/test-logger.js.map +1 -1
  128. package/testing/test-logger.mjs +71 -74
  129. package/testing/test-logger.mjs.map +1 -1
  130. package/testing/transaction-logger.d.ts +30 -27
  131. package/testing/transaction-logger.js +77 -93
  132. package/testing/transaction-logger.js.map +1 -1
  133. package/testing/transaction-logger.mjs +74 -90
  134. package/testing/transaction-logger.mjs.map +1 -1
  135. package/transaction/legacy-bridge.js +100 -111
  136. package/transaction/legacy-bridge.js.map +1 -1
  137. package/transaction/legacy-bridge.mjs +97 -108
  138. package/transaction/legacy-bridge.mjs.map +1 -1
  139. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +7 -5
  140. package/transaction/perform-atomic-transaction-composer-simulate.js +31 -36
  141. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  142. package/transaction/perform-atomic-transaction-composer-simulate.mjs +28 -33
  143. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  144. package/transaction/transaction.d.ts +34 -35
  145. package/transaction/transaction.js +716 -914
  146. package/transaction/transaction.js.map +1 -1
  147. package/transaction/transaction.mjs +713 -911
  148. package/transaction/transaction.mjs.map +1 -1
  149. package/transfer/transfer-algos.d.ts +9 -5
  150. package/transfer/transfer-algos.js +26 -27
  151. package/transfer/transfer-algos.js.map +1 -1
  152. package/transfer/transfer-algos.mjs +26 -25
  153. package/transfer/transfer-algos.mjs.map +1 -1
  154. package/transfer/transfer.d.ts +11 -8
  155. package/transfer/transfer.js +94 -100
  156. package/transfer/transfer.js.map +1 -1
  157. package/transfer/transfer.mjs +94 -98
  158. package/transfer/transfer.mjs.map +1 -1
  159. package/types/account-manager.d.ts +432 -429
  160. package/types/account-manager.js +591 -602
  161. package/types/account-manager.js.map +1 -1
  162. package/types/account-manager.mjs +587 -599
  163. package/types/account-manager.mjs.map +1 -1
  164. package/types/account.d.ts +192 -202
  165. package/types/account.js +91 -88
  166. package/types/account.js.map +1 -1
  167. package/types/account.mjs +88 -86
  168. package/types/account.mjs.map +1 -1
  169. package/types/algo-http-client-with-retry.d.ts +15 -10
  170. package/types/algo-http-client-with-retry.js +70 -92
  171. package/types/algo-http-client-with-retry.js.map +1 -1
  172. package/types/algo-http-client-with-retry.mjs +69 -90
  173. package/types/algo-http-client-with-retry.mjs.map +1 -1
  174. package/types/algorand-client-transaction-creator.d.ts +778 -771
  175. package/types/algorand-client-transaction-creator.js +733 -732
  176. package/types/algorand-client-transaction-creator.js.map +1 -1
  177. package/types/algorand-client-transaction-creator.mjs +732 -730
  178. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  179. package/types/algorand-client-transaction-sender.d.ts +1090 -1360
  180. package/types/algorand-client-transaction-sender.js +930 -961
  181. package/types/algorand-client-transaction-sender.js.map +1 -1
  182. package/types/algorand-client-transaction-sender.mjs +927 -959
  183. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  184. package/types/algorand-client.d.ts +239 -236
  185. package/types/algorand-client.js +322 -320
  186. package/types/algorand-client.js.map +1 -1
  187. package/types/algorand-client.mjs +321 -318
  188. package/types/algorand-client.mjs.map +1 -1
  189. package/types/amount.d.ts +47 -43
  190. package/types/amount.js +66 -70
  191. package/types/amount.js.map +1 -1
  192. package/types/amount.mjs +63 -68
  193. package/types/amount.mjs.map +1 -1
  194. package/types/app-arc56.d.ts +235 -272
  195. package/types/app-arc56.js +124 -170
  196. package/types/app-arc56.js.map +1 -1
  197. package/types/app-arc56.mjs +121 -168
  198. package/types/app-arc56.mjs.map +1 -1
  199. package/types/app-client.d.ts +1128 -2009
  200. package/types/app-client.js +1633 -1791
  201. package/types/app-client.js.map +1 -1
  202. package/types/app-client.mjs +1624 -1783
  203. package/types/app-client.mjs.map +1 -1
  204. package/types/app-deployer.d.ts +139 -141
  205. package/types/app-deployer.js +344 -384
  206. package/types/app-deployer.js.map +1 -1
  207. package/types/app-deployer.mjs +341 -382
  208. package/types/app-deployer.mjs.map +1 -1
  209. package/types/app-factory.d.ts +762 -932
  210. package/types/app-factory.js +496 -488
  211. package/types/app-factory.js.map +1 -1
  212. package/types/app-factory.mjs +491 -484
  213. package/types/app-factory.mjs.map +1 -1
  214. package/types/app-manager.d.ts +304 -310
  215. package/types/app-manager.js +422 -475
  216. package/types/app-manager.js.map +1 -1
  217. package/types/app-manager.mjs +419 -473
  218. package/types/app-manager.mjs.map +1 -1
  219. package/types/app-spec.d.ts +118 -117
  220. package/types/app-spec.js +125 -135
  221. package/types/app-spec.js.map +1 -1
  222. package/types/app-spec.mjs +121 -132
  223. package/types/app-spec.mjs.map +1 -1
  224. package/types/app.d.ts +229 -241
  225. package/types/app.js +36 -28
  226. package/types/app.js.map +1 -1
  227. package/types/app.mjs +33 -26
  228. package/types/app.mjs.map +1 -1
  229. package/types/asset-manager.d.ts +204 -199
  230. package/types/asset-manager.js +165 -174
  231. package/types/asset-manager.js.map +1 -1
  232. package/types/asset-manager.mjs +164 -172
  233. package/types/asset-manager.mjs.map +1 -1
  234. package/types/asset.d.ts +95 -91
  235. package/types/asset.js +0 -3
  236. package/types/asset.mjs +0 -2
  237. package/types/async-event-emitter.d.ts +18 -13
  238. package/types/async-event-emitter.js +37 -49
  239. package/types/async-event-emitter.js.map +1 -1
  240. package/types/async-event-emitter.mjs +36 -47
  241. package/types/async-event-emitter.mjs.map +1 -1
  242. package/types/client-manager.d.ts +453 -451
  243. package/types/client-manager.js +602 -598
  244. package/types/client-manager.js.map +1 -1
  245. package/types/client-manager.mjs +597 -594
  246. package/types/client-manager.mjs.map +1 -1
  247. package/types/composer.d.ts +1211 -1258
  248. package/types/composer.js +1436 -1498
  249. package/types/composer.js.map +1 -1
  250. package/types/composer.mjs +1430 -1493
  251. package/types/composer.mjs.map +1 -1
  252. package/types/config.d.ts +53 -48
  253. package/types/config.js +78 -77
  254. package/types/config.js.map +1 -1
  255. package/types/config.mjs +77 -75
  256. package/types/config.mjs.map +1 -1
  257. package/types/debugging.d.ts +25 -23
  258. package/types/debugging.js +9 -11
  259. package/types/debugging.js.map +1 -1
  260. package/types/debugging.mjs +8 -9
  261. package/types/debugging.mjs.map +1 -1
  262. package/types/dispenser-client.d.ts +57 -52
  263. package/types/dispenser-client.js +120 -141
  264. package/types/dispenser-client.js.map +1 -1
  265. package/types/dispenser-client.mjs +119 -139
  266. package/types/dispenser-client.mjs.map +1 -1
  267. package/types/expand.d.ts +5 -3
  268. package/types/expand.js +0 -3
  269. package/types/expand.mjs +0 -2
  270. package/types/indexer.d.ts +104 -100
  271. package/types/indexer.js +36 -31
  272. package/types/indexer.js.map +1 -1
  273. package/types/indexer.mjs +32 -30
  274. package/types/indexer.mjs.map +1 -1
  275. package/types/instance-of.d.ts +5 -3
  276. package/types/instance-of.js +0 -3
  277. package/types/instance-of.mjs +0 -2
  278. package/types/kmd-account-manager.d.ts +75 -70
  279. package/types/kmd-account-manager.js +150 -184
  280. package/types/kmd-account-manager.js.map +1 -1
  281. package/types/kmd-account-manager.mjs +147 -182
  282. package/types/kmd-account-manager.mjs.map +1 -1
  283. package/types/lifecycle-events.d.ts +13 -8
  284. package/types/lifecycle-events.js +10 -7
  285. package/types/lifecycle-events.js.map +1 -1
  286. package/types/lifecycle-events.mjs +9 -7
  287. package/types/lifecycle-events.mjs.map +1 -1
  288. package/types/logging.d.ts +15 -11
  289. package/types/logging.js +30 -31
  290. package/types/logging.js.map +1 -1
  291. package/types/logging.mjs +29 -29
  292. package/types/logging.mjs.map +1 -1
  293. package/types/logic-error.d.ts +33 -29
  294. package/types/logic-error.js +50 -49
  295. package/types/logic-error.js.map +1 -1
  296. package/types/logic-error.mjs +49 -47
  297. package/types/logic-error.mjs.map +1 -1
  298. package/types/network-client.d.ts +32 -27
  299. package/types/network-client.js +10 -9
  300. package/types/network-client.js.map +1 -1
  301. package/types/network-client.mjs +9 -7
  302. package/types/network-client.mjs.map +1 -1
  303. package/types/testing.d.ts +131 -132
  304. package/types/testing.js +0 -3
  305. package/types/testing.mjs +0 -2
  306. package/types/transaction.d.ts +110 -110
  307. package/types/transaction.js +0 -3
  308. package/types/transaction.mjs +0 -2
  309. package/types/transfer.d.ts +70 -66
  310. package/types/transfer.js +0 -3
  311. package/types/transfer.mjs +0 -2
  312. package/util.js +73 -118
  313. package/util.js.map +1 -1
  314. package/util.mjs +73 -116
  315. package/util.mjs.map +1 -1
  316. package/account/index.d.ts +0 -5
  317. package/debugging/index.d.ts +0 -1
  318. package/index.js.map +0 -1
  319. package/index.mjs.map +0 -1
  320. package/localnet/index.d.ts +0 -4
  321. package/testing/_asset.d.ts +0 -3
  322. package/testing/fixtures/index.d.ts +0 -2
  323. package/testing/index.js.map +0 -1
  324. package/testing/index.mjs.map +0 -1
  325. package/transaction/index.d.ts +0 -2
  326. package/transaction/legacy-bridge.d.ts +0 -35
  327. package/transfer/index.d.ts +0 -2
  328. package/types/asset.js.map +0 -1
  329. package/types/asset.mjs.map +0 -1
  330. package/types/expand.js.map +0 -1
  331. package/types/expand.mjs.map +0 -1
  332. package/types/instance-of.js.map +0 -1
  333. package/types/instance-of.mjs.map +0 -1
  334. package/types/testing.js.map +0 -1
  335. package/types/testing.mjs.map +0 -1
  336. package/types/transaction.js.map +0 -1
  337. package/types/transaction.mjs.map +0 -1
  338. package/types/transfer.js.map +0 -1
  339. package/types/transfer.mjs.map +0 -1
  340. package/util.d.ts +0 -48
@@ -0,0 +1,33 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
+ return target;
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
19
+ key = keys[i];
20
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
21
+ get: ((k) => from[k]).bind(null, key),
22
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
23
+ });
24
+ }
25
+ return to;
26
+ };
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ //#endregion
32
+ exports.__exportAll = __exportAll;
33
+ exports.__toESM = __toESM;
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll };
@@ -1,13 +1,9 @@
1
- import algosdk from 'algosdk';
2
- import { AccountAssetInformation, MultisigAccount, SigningAccount, TransactionSignerAccount } from '../types/account';
3
- import { AlgoAmount } from '../types/amount';
4
- import { SendTransactionFrom } from '../types/transaction';
5
- import Account = algosdk.Account;
6
- import Algodv2 = algosdk.Algodv2;
7
- import Kmd = algosdk.Kmd;
8
- import MultisigMetadata = algosdk.MultisigMetadata;
9
- import TransactionSigner = algosdk.TransactionSigner;
10
- import AccountInformationModel = algosdk.modelsv2.Account;
1
+ import { AlgoAmount } from "../types/amount.js";
2
+ import { AccountAssetInformation, MultisigAccount, SigningAccount, TransactionSignerAccount } from "../types/account.js";
3
+ import { SendTransactionFrom } from "../types/transaction.js";
4
+ import algosdk from "algosdk";
5
+
6
+ //#region src/account/account.d.ts
11
7
  /**
12
8
  * @deprecated Use `algorand.account.multisig(multisigParams, signingAccounts)` or `new MultisigAccount(multisigParams, signingAccounts)` instead.
13
9
  *
@@ -16,7 +12,7 @@ import AccountInformationModel = algosdk.modelsv2.Account;
16
12
  * @param signingAccounts The signers that are currently present
17
13
  * @returns A multisig account wrapper
18
14
  */
19
- export declare function multisigAccount(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]): MultisigAccount;
15
+ declare function multisigAccount(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]): MultisigAccount;
20
16
  /**
21
17
  * @deprecated Use `algorand.account.rekeyed(sender, account)` or `new SigningAccount(account, sender)` instead.
22
18
  *
@@ -25,7 +21,7 @@ export declare function multisigAccount(multisigParams: MultisigMetadata, signin
25
21
  * @param sender The address of the rekeyed account that will act as a sender
26
22
  * @returns The SigningAccount wrapper
27
23
  */
28
- export declare function rekeyedAccount(signer: Account, sender: string): SigningAccount;
24
+ declare function rekeyedAccount(signer: Account, sender: string): SigningAccount;
29
25
  /**
30
26
  * @deprecated Use `algorand.account.getSigner(sender)` (after previously registering the signer with `setSigner`) or `{ addr: sender, signer }` instead.
31
27
  *
@@ -34,7 +30,7 @@ export declare function rekeyedAccount(signer: Account, sender: string): Signing
34
30
  * @param sender The address of sender account
35
31
  * @returns The SigningAccount wrapper
36
32
  */
37
- export declare function transactionSignerAccount(signer: TransactionSigner, sender: string): TransactionSignerAccount;
33
+ declare function transactionSignerAccount(signer: TransactionSigner, sender: string): TransactionSignerAccount;
38
34
  /**
39
35
  * @deprecated Use `algorand.account.random()` or `algosdk.generateAccount()` instead.
40
36
  *
@@ -43,7 +39,7 @@ export declare function transactionSignerAccount(signer: TransactionSigner, send
43
39
  * This is a wrapper around algosdk.generateAccount to provide a more friendly/obvious name.
44
40
  *
45
41
  */
46
- export declare function randomAccount(): Account;
42
+ declare function randomAccount(): Account;
47
43
  /**
48
44
  * @deprecated Use `algorand.account.fromEnvironment(name, fundWith)` or `new AccountManager(clientManager).fromEnvironment()` instead.
49
45
  *
@@ -76,9 +72,9 @@ export declare function randomAccount(): Account;
76
72
  * @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
77
73
  * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)
78
74
  */
79
- export declare function mnemonicAccountFromEnvironment(account: string | {
80
- name: string;
81
- fundWith?: AlgoAmount;
75
+ declare function mnemonicAccountFromEnvironment(account: string | {
76
+ name: string;
77
+ fundWith?: AlgoAmount;
82
78
  }, algod: Algodv2, kmdClient?: Kmd): Promise<Account | SigningAccount>;
83
79
  /**
84
80
  * @deprecated Use `algosdk.decodeAddress` instead.
@@ -87,7 +83,7 @@ export declare function mnemonicAccountFromEnvironment(account: string | {
87
83
  *
88
84
  * @param account Either an account (with private key loaded) or the string address of an account
89
85
  */
90
- export declare function getAccountAddressAsUint8Array(account: SendTransactionFrom | string): Uint8Array;
86
+ declare function getAccountAddressAsUint8Array(account: SendTransactionFrom | string): Uint8Array<ArrayBufferLike>;
91
87
  /**
92
88
  * @deprecated Use `algosdk.encodeAddress` instead.
93
89
  *
@@ -95,15 +91,12 @@ export declare function getAccountAddressAsUint8Array(account: SendTransactionFr
95
91
  *
96
92
  * @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key
97
93
  */
98
- export declare function getAccountAddressAsString(addressEncodedInB64: string): string;
99
- export type NumberConverter<T extends AccountInformationModel> = {
100
- [key in keyof T]: ToNumberIfExtends<T[key], number | bigint>;
101
- };
94
+ declare function getAccountAddressAsString(addressEncodedInB64: string): string;
95
+ type NumberConverter<T extends AccountInformationModel> = { [key in keyof T]: ToNumberIfExtends<T[key], number | bigint> };
102
96
  type ToNumberIfExtends<K, E> = K extends E ? number : K;
103
97
  /** @deprecated Account information at a given round. */
104
- export type AccountInformation = Omit<NumberConverter<AccountInformationModel>, 'getEncodingSchema' | 'toEncodingData' | 'authAddr'> & {
105
- /** (spend) the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field. */
106
- authAddr?: string;
98
+ type AccountInformation = Omit<NumberConverter<AccountInformationModel>, 'getEncodingSchema' | 'toEncodingData' | 'authAddr'> & {
99
+ /** (spend) the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field. */authAddr?: string;
107
100
  };
108
101
  /**
109
102
  * @deprecated Use `algorand.account.getInformation(sender)` or `new AccountManager(clientManager).getInformation(sender)` instead.
@@ -116,12 +109,12 @@ export type AccountInformation = Omit<NumberConverter<AccountInformationModel>,
116
109
  * const accountInfo = await account.getInformation(address, algod);
117
110
  * ```
118
111
  *
119
- * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountinformation)
112
+ * [Response data schema details](https://dev.algorand.co/reference/rest-api/algod/operations/accountinformation/)
120
113
  * @param sender The address of the sender/account to look up
121
114
  * @param algod The algod instance
122
115
  * @returns The account information
123
116
  */
124
- export declare function getAccountInformation(sender: string | SendTransactionFrom, algod: Algodv2): Promise<AccountInformation>;
117
+ declare function getAccountInformation(sender: string | SendTransactionFrom, algod: Algodv2): Promise<AccountInformation>;
125
118
  /**
126
119
  * @deprecated Use `algorand.asset.getAccountInformation(sender, assetId)` or `new AssetManager(...).getAccountInformation(sender, assetId)` instead.
127
120
  *
@@ -134,11 +127,13 @@ export declare function getAccountInformation(sender: string | SendTransactionFr
134
127
  * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);
135
128
  * ```
136
129
  *
137
- * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)
130
+ * [Response data schema details](https://dev.algorand.co/reference/rest-api/algod/operations/accountassetinformation/)
138
131
  * @param sender The address of the sender/account to look up
139
132
  * @param assetId The ID of the asset to return a holding for
140
133
  * @param algod The algod instance
141
134
  * @returns The account asset holding information
142
135
  */
143
- export declare function getAccountAssetInformation(sender: string | SendTransactionFrom, assetId: number | bigint, algod: Algodv2): Promise<AccountAssetInformation>;
144
- export {};
136
+ declare function getAccountAssetInformation(sender: string | SendTransactionFrom, assetId: number | bigint, algod: Algodv2): Promise<AccountAssetInformation>;
137
+ //#endregion
138
+ export { AccountInformation, NumberConverter, getAccountAddressAsString, getAccountAddressAsUint8Array, getAccountAssetInformation, getAccountInformation, mnemonicAccountFromEnvironment, multisigAccount, randomAccount, rekeyedAccount, transactionSignerAccount };
139
+ //# sourceMappingURL=account.d.ts.map
@@ -1,175 +1,179 @@
1
- 'use strict';
2
-
3
- var algosdk = require('algosdk');
4
- var transaction = require('../transaction/transaction.js');
5
- var types_account = require('../types/account.js');
6
- var types_accountManager = require('../types/account-manager.js');
7
- var types_algorandClient = require('../types/algorand-client.js');
8
- var types_clientManager = require('../types/client-manager.js');
9
-
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.js");
2
+ const require_transaction = require("../transaction/transaction.js");
3
+ const require_account = require("../types/account.js");
4
+ const require_client_manager = require("../types/client-manager.js");
5
+ const require_account_manager = require("../types/account-manager.js");
6
+ const require_algorand_client = require("../types/algorand-client.js");
7
+ let algosdk = require("algosdk");
8
+ algosdk = require_runtime.__toESM(algosdk);
9
+ //#region src/account/account.ts
10
10
  /**
11
- * @deprecated Use `algorand.account.multisig(multisigParams, signingAccounts)` or `new MultisigAccount(multisigParams, signingAccounts)` instead.
12
- *
13
- * Returns an account wrapper that supports partial or full multisig signing.
14
- * @param multisigParams The parameters that define the multisig account
15
- * @param signingAccounts The signers that are currently present
16
- * @returns A multisig account wrapper
17
- */
11
+ * @deprecated Use `algorand.account.multisig(multisigParams, signingAccounts)` or `new MultisigAccount(multisigParams, signingAccounts)` instead.
12
+ *
13
+ * Returns an account wrapper that supports partial or full multisig signing.
14
+ * @param multisigParams The parameters that define the multisig account
15
+ * @param signingAccounts The signers that are currently present
16
+ * @returns A multisig account wrapper
17
+ */
18
18
  function multisigAccount(multisigParams, signingAccounts) {
19
- return new types_account.MultisigAccount(multisigParams, signingAccounts);
19
+ return new require_account.MultisigAccount(multisigParams, signingAccounts);
20
20
  }
21
21
  /**
22
- * @deprecated Use `algorand.account.rekeyed(sender, account)` or `new SigningAccount(account, sender)` instead.
23
- *
24
- * Returns an account wrapper that supports a rekeyed account.
25
- * @param signer The account, with private key loaded, that is signing
26
- * @param sender The address of the rekeyed account that will act as a sender
27
- * @returns The SigningAccount wrapper
28
- */
22
+ * @deprecated Use `algorand.account.rekeyed(sender, account)` or `new SigningAccount(account, sender)` instead.
23
+ *
24
+ * Returns an account wrapper that supports a rekeyed account.
25
+ * @param signer The account, with private key loaded, that is signing
26
+ * @param sender The address of the rekeyed account that will act as a sender
27
+ * @returns The SigningAccount wrapper
28
+ */
29
29
  function rekeyedAccount(signer, sender) {
30
- return new types_account.SigningAccount(signer, sender);
30
+ return new require_account.SigningAccount(signer, sender);
31
31
  }
32
32
  /**
33
- * @deprecated Use `algorand.account.getSigner(sender)` (after previously registering the signer with `setSigner`) or `{ addr: sender, signer }` instead.
34
- *
35
- * Returns an account wrapper that supports a transaction signer with associated sender address.
36
- * @param signer The transaction signer
37
- * @param sender The address of sender account
38
- * @returns The SigningAccount wrapper
39
- */
33
+ * @deprecated Use `algorand.account.getSigner(sender)` (after previously registering the signer with `setSigner`) or `{ addr: sender, signer }` instead.
34
+ *
35
+ * Returns an account wrapper that supports a transaction signer with associated sender address.
36
+ * @param signer The transaction signer
37
+ * @param sender The address of sender account
38
+ * @returns The SigningAccount wrapper
39
+ */
40
40
  function transactionSignerAccount(signer, sender) {
41
- return { addr: algosdk.Address.fromString(sender), signer };
41
+ return {
42
+ addr: algosdk.Address.fromString(sender),
43
+ signer
44
+ };
42
45
  }
43
46
  /**
44
- * @deprecated Use `algorand.account.random()` or `algosdk.generateAccount()` instead.
45
- *
46
- * Returns a new, random Algorand account with secret key loaded.
47
- *
48
- * This is a wrapper around algosdk.generateAccount to provide a more friendly/obvious name.
49
- *
50
- */
47
+ * @deprecated Use `algorand.account.random()` or `algosdk.generateAccount()` instead.
48
+ *
49
+ * Returns a new, random Algorand account with secret key loaded.
50
+ *
51
+ * This is a wrapper around algosdk.generateAccount to provide a more friendly/obvious name.
52
+ *
53
+ */
51
54
  function randomAccount() {
52
- // This method is confusingly named, so this function provides a more dev friendly "wrapper" name
53
- return algosdk.generateAccount();
55
+ return algosdk.default.generateAccount();
54
56
  }
55
57
  /**
56
- * @deprecated Use `algorand.account.fromEnvironment(name, fundWith)` or `new AccountManager(clientManager).fromEnvironment()` instead.
57
- *
58
- * Returns an Algorand account with private key loaded by convention from environment variables based on the given name identifier.
59
- *
60
- * Note: This function expects to run in a Node.js environment.
61
- *
62
- * ## Convention:
63
- * * **Non-LocalNet:** will load process.env['\{NAME\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,
64
- * never commit it into source control and ideally load it via a secret storage service rather than the file system.
65
- * If process.env['\{NAME\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)
66
- * * **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
67
- *
68
- * 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).
69
- *
70
- * @example Default
71
- *
72
- * 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:
73
- * ```typescript
74
- * const account = await mnemonicAccountFromEnvironment('MY_ACCOUNT', algod)
75
- * ```
76
- *
77
- * 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.
78
- * 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.
79
- *
80
- * @param account The details of the account to get, either the name identifier (string) or an object with:
81
- * * `name`: string: The name identifier of the account
82
- * * `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
83
- * @param algod An algod client
84
- * @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
85
- * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)
86
- */
58
+ * @deprecated Use `algorand.account.fromEnvironment(name, fundWith)` or `new AccountManager(clientManager).fromEnvironment()` instead.
59
+ *
60
+ * Returns an Algorand account with private key loaded by convention from environment variables based on the given name identifier.
61
+ *
62
+ * Note: This function expects to run in a Node.js environment.
63
+ *
64
+ * ## Convention:
65
+ * * **Non-LocalNet:** will load process.env['\{NAME\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,
66
+ * never commit it into source control and ideally load it via a secret storage service rather than the file system.
67
+ * If process.env['\{NAME\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)
68
+ * * **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
69
+ *
70
+ * 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).
71
+ *
72
+ * @example Default
73
+ *
74
+ * 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:
75
+ * ```typescript
76
+ * const account = await mnemonicAccountFromEnvironment('MY_ACCOUNT', algod)
77
+ * ```
78
+ *
79
+ * 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.
80
+ * 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.
81
+ *
82
+ * @param account The details of the account to get, either the name identifier (string) or an object with:
83
+ * * `name`: string: The name identifier of the account
84
+ * * `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
85
+ * @param algod An algod client
86
+ * @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
87
+ * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)
88
+ */
87
89
  async function mnemonicAccountFromEnvironment(account, algod, kmdClient) {
88
- return (await new types_accountManager.AccountManager(new types_clientManager.ClientManager({ algod, kmd: kmdClient })).fromEnvironment(typeof account === 'string' ? account : account.name, typeof account === 'string' ? undefined : account.fundWith)).account;
90
+ return (await new require_account_manager.AccountManager(new require_client_manager.ClientManager({
91
+ algod,
92
+ kmd: kmdClient
93
+ })).fromEnvironment(typeof account === "string" ? account : account.name, typeof account === "string" ? void 0 : account.fundWith)).account;
89
94
  }
90
95
  /**
91
- * @deprecated Use `algosdk.decodeAddress` instead.
92
- *
93
- * Returns an account's address as a byte array
94
- *
95
- * @param account Either an account (with private key loaded) or the string address of an account
96
- */
96
+ * @deprecated Use `algosdk.decodeAddress` instead.
97
+ *
98
+ * Returns an account's address as a byte array
99
+ *
100
+ * @param account Either an account (with private key loaded) or the string address of an account
101
+ */
97
102
  function getAccountAddressAsUint8Array(account) {
98
- return algosdk.decodeAddress(typeof account === 'string' ? account : transaction.getSenderAddress(account)).publicKey;
103
+ return algosdk.default.decodeAddress(typeof account === "string" ? account : require_transaction.getSenderAddress(account)).publicKey;
99
104
  }
100
105
  /**
101
- * @deprecated Use `algosdk.encodeAddress` instead.
102
- *
103
- * Returns the string address of an Algorand account from a base64 encoded version of the underlying byte array of the address public key
104
- *
105
- * @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key
106
- */
106
+ * @deprecated Use `algosdk.encodeAddress` instead.
107
+ *
108
+ * Returns the string address of an Algorand account from a base64 encoded version of the underlying byte array of the address public key
109
+ *
110
+ * @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key
111
+ */
107
112
  function getAccountAddressAsString(addressEncodedInB64) {
108
- return algosdk.encodeAddress(Buffer.from(addressEncodedInB64, 'base64'));
113
+ return algosdk.default.encodeAddress(Buffer.from(addressEncodedInB64, "base64"));
109
114
  }
110
115
  /**
111
- * @deprecated Use `algorand.account.getInformation(sender)` or `new AccountManager(clientManager).getInformation(sender)` instead.
112
- *
113
- * Returns the given sender account's current status, balance and spendable amounts.
114
- *
115
- * @example
116
- * ```typescript
117
- * const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
118
- * const accountInfo = await account.getInformation(address, algod);
119
- * ```
120
- *
121
- * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountinformation)
122
- * @param sender The address of the sender/account to look up
123
- * @param algod The algod instance
124
- * @returns The account information
125
- */
116
+ * @deprecated Use `algorand.account.getInformation(sender)` or `new AccountManager(clientManager).getInformation(sender)` instead.
117
+ *
118
+ * Returns the given sender account's current status, balance and spendable amounts.
119
+ *
120
+ * @example
121
+ * ```typescript
122
+ * const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
123
+ * const accountInfo = await account.getInformation(address, algod);
124
+ * ```
125
+ *
126
+ * [Response data schema details](https://dev.algorand.co/reference/rest-api/algod/operations/accountinformation/)
127
+ * @param sender The address of the sender/account to look up
128
+ * @param algod The algod instance
129
+ * @returns The account information
130
+ */
126
131
  async function getAccountInformation(sender, algod) {
127
- const account = await algod.accountInformation(transaction.getSenderAddress(sender)).do();
128
- return {
129
- ...account,
130
- address: account.address.toString(),
131
- authAddr: account.authAddr ? account.authAddr.toString() : undefined,
132
- // None of these can practically overflow 2^53
133
- amount: Number(account.amount),
134
- amountWithoutPendingRewards: Number(account.amountWithoutPendingRewards),
135
- minBalance: Number(account.minBalance),
136
- pendingRewards: Number(account.pendingRewards),
137
- rewards: Number(account.rewards),
138
- round: Number(account.round),
139
- totalAppsOptedIn: Number(account.totalAppsOptedIn),
140
- totalAssetsOptedIn: Number(account.totalAssetsOptedIn),
141
- totalCreatedApps: Number(account.totalCreatedApps),
142
- totalCreatedAssets: Number(account.totalCreatedAssets),
143
- appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,
144
- rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,
145
- totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,
146
- totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,
147
- lastHeartbeat: account.lastHeartbeat !== undefined ? Number(account.lastHeartbeat) : undefined,
148
- lastProposed: account.lastProposed !== undefined ? Number(account.lastProposed) : undefined,
149
- };
132
+ const account = await algod.accountInformation(require_transaction.getSenderAddress(sender)).do();
133
+ return {
134
+ ...account,
135
+ address: account.address.toString(),
136
+ authAddr: account.authAddr ? account.authAddr.toString() : void 0,
137
+ amount: Number(account.amount),
138
+ amountWithoutPendingRewards: Number(account.amountWithoutPendingRewards),
139
+ minBalance: Number(account.minBalance),
140
+ pendingRewards: Number(account.pendingRewards),
141
+ rewards: Number(account.rewards),
142
+ round: Number(account.round),
143
+ totalAppsOptedIn: Number(account.totalAppsOptedIn),
144
+ totalAssetsOptedIn: Number(account.totalAssetsOptedIn),
145
+ totalCreatedApps: Number(account.totalCreatedApps),
146
+ totalCreatedAssets: Number(account.totalCreatedAssets),
147
+ appsTotalExtraPages: account.appsTotalExtraPages !== void 0 ? Number(account.appsTotalExtraPages) : void 0,
148
+ rewardBase: account.rewardBase !== void 0 ? Number(account.rewardBase) : void 0,
149
+ totalBoxBytes: account.totalBoxBytes !== void 0 ? Number(account.totalBoxBytes) : void 0,
150
+ totalBoxes: account.totalBoxes !== void 0 ? Number(account.totalBoxes) : void 0,
151
+ lastHeartbeat: account.lastHeartbeat !== void 0 ? Number(account.lastHeartbeat) : void 0,
152
+ lastProposed: account.lastProposed !== void 0 ? Number(account.lastProposed) : void 0
153
+ };
150
154
  }
151
155
  /**
152
- * @deprecated Use `algorand.asset.getAccountInformation(sender, assetId)` or `new AssetManager(...).getAccountInformation(sender, assetId)` instead.
153
- *
154
- * Returns the given sender account's asset holding for a given asset.
155
- *
156
- * @example
157
- * ```typescript
158
- * const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
159
- * const assetId = 123345;
160
- * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);
161
- * ```
162
- *
163
- * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)
164
- * @param sender The address of the sender/account to look up
165
- * @param assetId The ID of the asset to return a holding for
166
- * @param algod The algod instance
167
- * @returns The account asset holding information
168
- */
156
+ * @deprecated Use `algorand.asset.getAccountInformation(sender, assetId)` or `new AssetManager(...).getAccountInformation(sender, assetId)` instead.
157
+ *
158
+ * Returns the given sender account's asset holding for a given asset.
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
163
+ * const assetId = 123345;
164
+ * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);
165
+ * ```
166
+ *
167
+ * [Response data schema details](https://dev.algorand.co/reference/rest-api/algod/operations/accountassetinformation/)
168
+ * @param sender The address of the sender/account to look up
169
+ * @param assetId The ID of the asset to return a holding for
170
+ * @param algod The algod instance
171
+ * @returns The account asset holding information
172
+ */
169
173
  async function getAccountAssetInformation(sender, assetId, algod) {
170
- return types_algorandClient.AlgorandClient.fromClients({ algod }).asset.getAccountInformation(transaction.getSenderAddress(sender), BigInt(assetId));
174
+ return require_algorand_client.AlgorandClient.fromClients({ algod }).asset.getAccountInformation(require_transaction.getSenderAddress(sender), BigInt(assetId));
171
175
  }
172
-
176
+ //#endregion
173
177
  exports.getAccountAddressAsString = getAccountAddressAsString;
174
178
  exports.getAccountAddressAsUint8Array = getAccountAddressAsUint8Array;
175
179
  exports.getAccountAssetInformation = getAccountAssetInformation;
@@ -179,4 +183,5 @@ exports.multisigAccount = multisigAccount;
179
183
  exports.randomAccount = randomAccount;
180
184
  exports.rekeyedAccount = rekeyedAccount;
181
185
  exports.transactionSignerAccount = transactionSignerAccount;
182
- //# sourceMappingURL=account.js.map
186
+
187
+ //# sourceMappingURL=account.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sources":["../../src/account/account.ts"],"sourcesContent":["import algosdk, { Address } 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: Address.fromString(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>, 'getEncodingSchema' | 'toEncodingData' | 'authAddr'> & {\n /** (spend) the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field. */\n authAddr?: string\n}\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://dev.algorand.co/reference/rest-apis/algod/#accountinformation)\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 = await algod.accountInformation(getSenderAddress(sender)).do()\n\n return {\n ...account,\n address: account.address.toString(),\n authAddr: account.authAddr ? account.authAddr.toString() : undefined,\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://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)\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","Address","AccountManager","ClientManager","getSenderAddress","AlgorandClient"],"mappings":";;;;;;;;;AAeA;;;;;;;AAOG;AACa,SAAA,eAAe,CAAC,cAAgC,EAAE,eAA6C,EAAA;AAC7G,IAAA,OAAO,IAAIA,6BAAe,CAAC,cAAc,EAAE,eAAe,CAAC;AAC7D;AAEA;;;;;;;AAOG;AACa,SAAA,cAAc,CAAC,MAAe,EAAE,MAAc,EAAA;AAC5D,IAAA,OAAO,IAAIC,4BAAc,CAAC,MAAM,EAAE,MAAM,CAAC;AAC3C;AAEA;;;;;;;AAOG;AACa,SAAA,wBAAwB,CAAC,MAAyB,EAAE,MAAc,EAAA;AAChF,IAAA,OAAO,EAAE,IAAI,EAAEC,eAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE;AACrD;AAEA;;;;;;;AAOG;SACa,aAAa,GAAA;;AAE3B,IAAA,OAAO,OAAO,CAAC,eAAe,EAAE;AAClC;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACI,eAAe,8BAA8B,CAClD,OAAyD,EACzD,KAAc,EACd,SAAe,EAAA;IAEf,OAAO,CACL,MAAM,IAAIC,mCAAc,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,CACpF,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,EACpD,OAAO,OAAO,KAAK,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC,QAAQ,CAC3D,EACD,OAAO;AACX;AAEA;;;;;;AAMG;AACG,SAAU,6BAA6B,CAAC,OAAqC,EAAA;IACjF,OAAO,OAAO,CAAC,aAAa,CAAC,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAGC,4BAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;AAC3G;AAEA;;;;;;AAMG;AACG,SAAU,yBAAyB,CAAC,mBAA2B,EAAA;AACnE,IAAA,OAAO,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;AAC1E;AAUA;;;;;;;;;;;;;;;AAeG;AACI,eAAe,qBAAqB,CAAC,MAAoC,EAAE,KAAc,EAAA;AAC9F,IAAA,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,kBAAkB,CAACA,4BAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;IAE7E,OAAO;AACL,QAAA,GAAG,OAAO;AACV,QAAA,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;AACnC,QAAA,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,SAAS;;AAEpE,QAAA,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;AAC9B,QAAA,2BAA2B,EAAE,MAAM,CAAC,OAAO,CAAC,2BAA2B,CAAC;AACxE,QAAA,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;AACtC,QAAA,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;AAC9C,QAAA,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;AAChC,QAAA,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;AAC5B,QAAA,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;AAClD,QAAA,kBAAkB,EAAE,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC;AACtD,QAAA,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;AAClD,QAAA,kBAAkB,EAAE,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC;AACtD,QAAA,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS;AAChH,QAAA,UAAU,EAAE,OAAO,CAAC,UAAU,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,SAAS;AACrF,QAAA,aAAa,EAAE,OAAO,CAAC,aAAa,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS;AAC9F,QAAA,UAAU,EAAE,OAAO,CAAC,UAAU,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,SAAS;AACrF,QAAA,aAAa,EAAE,OAAO,CAAC,aAAa,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS;AAC9F,QAAA,YAAY,EAAE,OAAO,CAAC,YAAY,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,SAAS;KAC5F;AACH;AAEA;;;;;;;;;;;;;;;;;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;AACrH;;;;;;;;;;;;"}
1
+ {"version":3,"file":"account.js","names":["MultisigAccount","SigningAccount","Address","AccountManager","ClientManager","getSenderAddress","AlgorandClient"],"sources":["../../src/account/account.ts"],"sourcesContent":["import algosdk, { Address } 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: Address.fromString(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>, 'getEncodingSchema' | 'toEncodingData' | 'authAddr'> & {\n /** (spend) the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field. */\n authAddr?: string\n}\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://dev.algorand.co/reference/rest-api/algod/operations/accountinformation/)\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 = await algod.accountInformation(getSenderAddress(sender)).do()\n\n return {\n ...account,\n address: account.address.toString(),\n authAddr: account.authAddr ? account.authAddr.toString() : undefined,\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://dev.algorand.co/reference/rest-api/algod/operations/accountassetinformation/)\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"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,SAAgB,gBAAgB,gBAAkC,iBAA+C;CAC/G,OAAO,IAAIA,gBAAAA,gBAAgB,gBAAgB,eAAe;AAC5D;;;;;;;;;AAUA,SAAgB,eAAe,QAAiB,QAAgB;CAC9D,OAAO,IAAIC,gBAAAA,eAAe,QAAQ,MAAM;AAC1C;;;;;;;;;AAUA,SAAgB,yBAAyB,QAA2B,QAA0C;CAC5G,OAAO;EAAE,MAAMC,QAAAA,QAAQ,WAAW,MAAM;EAAG;CAAO;AACpD;;;;;;;;;AAUA,SAAgB,gBAAyB;CAEvC,OAAO,QAAA,QAAQ,gBAAgB;AACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,eAAsB,+BACpB,SACA,OACA,WACmC;CACnC,QACE,MAAM,IAAIC,wBAAAA,eAAe,IAAIC,uBAAAA,cAAc;EAAE;EAAO,KAAK;CAAU,CAAC,CAAC,CAAC,CAAC,gBACrE,OAAO,YAAY,WAAW,UAAU,QAAQ,MAChD,OAAO,YAAY,WAAW,KAAA,IAAY,QAAQ,QACpD,EAAA,CACA;AACJ;;;;;;;;AASA,SAAgB,8BAA8B,SAAuC;CACnF,OAAO,QAAA,QAAQ,cAAc,OAAO,YAAY,WAAW,UAAUC,oBAAAA,iBAAiB,OAAO,CAAC,CAAC,CAAC;AAClG;;;;;;;;AASA,SAAgB,0BAA0B,qBAAqC;CAC7E,OAAO,QAAA,QAAQ,cAAc,OAAO,KAAK,qBAAqB,QAAQ,CAAC;AACzE;;;;;;;;;;;;;;;;;AA0BA,eAAsB,sBAAsB,QAAsC,OAA6C;CAC7H,MAAM,UAAU,MAAM,MAAM,mBAAmBA,oBAAAA,iBAAiB,MAAM,CAAC,CAAC,CAAC,GAAG;CAE5E,OAAO;EACL,GAAG;EACH,SAAS,QAAQ,QAAQ,SAAS;EAClC,UAAU,QAAQ,WAAW,QAAQ,SAAS,SAAS,IAAI,KAAA;EAE3D,QAAQ,OAAO,QAAQ,MAAM;EAC7B,6BAA6B,OAAO,QAAQ,2BAA2B;EACvE,YAAY,OAAO,QAAQ,UAAU;EACrC,gBAAgB,OAAO,QAAQ,cAAc;EAC7C,SAAS,OAAO,QAAQ,OAAO;EAC/B,OAAO,OAAO,QAAQ,KAAK;EAC3B,kBAAkB,OAAO,QAAQ,gBAAgB;EACjD,oBAAoB,OAAO,QAAQ,kBAAkB;EACrD,kBAAkB,OAAO,QAAQ,gBAAgB;EACjD,oBAAoB,OAAO,QAAQ,kBAAkB;EACrD,qBAAqB,QAAQ,wBAAwB,KAAA,IAAY,OAAO,QAAQ,mBAAmB,IAAI,KAAA;EACvG,YAAY,QAAQ,eAAe,KAAA,IAAY,OAAO,QAAQ,UAAU,IAAI,KAAA;EAC5E,eAAe,QAAQ,kBAAkB,KAAA,IAAY,OAAO,QAAQ,aAAa,IAAI,KAAA;EACrF,YAAY,QAAQ,eAAe,KAAA,IAAY,OAAO,QAAQ,UAAU,IAAI,KAAA;EAC5E,eAAe,QAAQ,kBAAkB,KAAA,IAAY,OAAO,QAAQ,aAAa,IAAI,KAAA;EACrF,cAAc,QAAQ,iBAAiB,KAAA,IAAY,OAAO,QAAQ,YAAY,IAAI,KAAA;CACpF;AACF;;;;;;;;;;;;;;;;;;;AAoBA,eAAsB,2BACpB,QACA,SACA,OACkC;CAClC,OAAOC,wBAAAA,eAAe,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,sBAAsBD,oBAAAA,iBAAiB,MAAM,GAAG,OAAO,OAAO,CAAC;AACpH"}