@algorandfoundation/algokit-utils 10.0.0-alpha.31 → 10.0.0-alpha.32

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 (318) hide show
  1. package/account-manager.d.ts +448 -0
  2. package/account-manager.js +623 -0
  3. package/account-manager.js.map +1 -0
  4. package/account-manager.mjs +620 -0
  5. package/account-manager.mjs.map +1 -0
  6. package/account.d.ts +156 -0
  7. package/account.js +10 -0
  8. package/account.js.map +1 -0
  9. package/account.mjs +9 -0
  10. package/account.mjs.map +1 -0
  11. package/algorand-client-transaction-creator.d.ts +1103 -0
  12. package/algorand-client-transaction-creator.js +735 -0
  13. package/algorand-client-transaction-creator.js.map +1 -0
  14. package/algorand-client-transaction-creator.mjs +734 -0
  15. package/algorand-client-transaction-creator.mjs.map +1 -0
  16. package/algorand-client-transaction-sender.d.ts +1317 -0
  17. package/algorand-client-transaction-sender.js +933 -0
  18. package/algorand-client-transaction-sender.js.map +1 -0
  19. package/algorand-client-transaction-sender.mjs +932 -0
  20. package/algorand-client-transaction-sender.mjs.map +1 -0
  21. package/algorand-client.d.ts +246 -0
  22. package/algorand-client.js +325 -0
  23. package/algorand-client.js.map +1 -0
  24. package/algorand-client.mjs +325 -0
  25. package/algorand-client.mjs.map +1 -0
  26. package/amount.d.ts +46 -3
  27. package/amount.js +92 -13
  28. package/amount.js.map +1 -1
  29. package/amount.mjs +80 -3
  30. package/amount.mjs.map +1 -1
  31. package/app-client.d.ts +2130 -0
  32. package/app-client.js +909 -0
  33. package/app-client.js.map +1 -0
  34. package/app-client.mjs +908 -0
  35. package/app-client.mjs.map +1 -0
  36. package/app-deployer.d.ts +166 -0
  37. package/app-deployer.js +353 -0
  38. package/app-deployer.js.map +1 -0
  39. package/app-deployer.mjs +353 -0
  40. package/app-deployer.mjs.map +1 -0
  41. package/app-factory.d.ts +965 -0
  42. package/app-factory.js +448 -0
  43. package/app-factory.js.map +1 -0
  44. package/app-factory.mjs +448 -0
  45. package/app-factory.mjs.map +1 -0
  46. package/app-manager.d.ts +323 -0
  47. package/app-manager.js +468 -0
  48. package/app-manager.js.map +1 -0
  49. package/app-manager.mjs +468 -0
  50. package/app-manager.mjs.map +1 -0
  51. package/app-spec.d.ts +203 -0
  52. package/app-spec.js +137 -0
  53. package/app-spec.js.map +1 -0
  54. package/app-spec.mjs +137 -0
  55. package/app-spec.mjs.map +1 -0
  56. package/app.d.ts +257 -0
  57. package/app.js +49 -0
  58. package/app.js.map +1 -0
  59. package/app.mjs +42 -0
  60. package/app.mjs.map +1 -0
  61. package/asset-manager.d.ts +212 -0
  62. package/asset-manager.js +166 -0
  63. package/asset-manager.js.map +1 -0
  64. package/asset-manager.mjs +166 -0
  65. package/asset-manager.mjs.map +1 -0
  66. package/async-event-emitter.d.ts +16 -0
  67. package/async-event-emitter.js +38 -0
  68. package/async-event-emitter.js.map +1 -0
  69. package/async-event-emitter.mjs +37 -0
  70. package/async-event-emitter.mjs.map +1 -0
  71. package/client-manager.d.ts +475 -0
  72. package/client-manager.js +616 -0
  73. package/client-manager.js.map +1 -0
  74. package/client-manager.mjs +616 -0
  75. package/client-manager.mjs.map +1 -0
  76. package/composer.d.ts +947 -0
  77. package/composer.js +1584 -0
  78. package/composer.js.map +1 -0
  79. package/composer.mjs +1583 -0
  80. package/composer.mjs.map +1 -0
  81. package/config.d.ts +1 -1
  82. package/config.js +2 -2
  83. package/config.js.map +1 -1
  84. package/config.mjs +1 -1
  85. package/config.mjs.map +1 -1
  86. package/debugging.d.ts +47 -0
  87. package/debugging.js +20 -0
  88. package/debugging.js.map +1 -0
  89. package/debugging.mjs +15 -0
  90. package/debugging.mjs.map +1 -0
  91. package/dispenser-client.d.ts +90 -0
  92. package/dispenser-client.js +127 -0
  93. package/dispenser-client.js.map +1 -0
  94. package/dispenser-client.mjs +127 -0
  95. package/dispenser-client.mjs.map +1 -0
  96. package/expand.d.ts +2 -0
  97. package/expand.js +0 -0
  98. package/expand.mjs +0 -0
  99. package/index.d.ts +6 -5
  100. package/index.js +4 -3
  101. package/index.mjs +5 -5
  102. package/indexer-client/indexer-lookup.d.ts +1 -1
  103. package/indexer-client/indexer-lookup.js.map +1 -1
  104. package/indexer-client/indexer-lookup.mjs.map +1 -1
  105. package/indexer.d.ts +40 -0
  106. package/indexer.js +38 -0
  107. package/indexer.js.map +1 -0
  108. package/indexer.mjs +35 -0
  109. package/indexer.mjs.map +1 -0
  110. package/instance-of.d.ts +8 -0
  111. package/kmd-account-manager.d.ts +74 -0
  112. package/kmd-account-manager.js +167 -0
  113. package/kmd-account-manager.js.map +1 -0
  114. package/kmd-account-manager.mjs +165 -0
  115. package/kmd-account-manager.mjs.map +1 -0
  116. package/lifecycle-events.d.ts +14 -0
  117. package/lifecycle-events.js +11 -0
  118. package/lifecycle-events.js.map +1 -0
  119. package/lifecycle-events.mjs +10 -0
  120. package/lifecycle-events.mjs.map +1 -0
  121. package/logging.d.ts +13 -0
  122. package/logging.js +47 -0
  123. package/logging.js.map +1 -0
  124. package/logging.mjs +42 -0
  125. package/logging.mjs.map +1 -0
  126. package/logic-error.d.ts +39 -0
  127. package/logic-error.js +54 -0
  128. package/logic-error.js.map +1 -0
  129. package/logic-error.mjs +53 -0
  130. package/logic-error.mjs.map +1 -0
  131. package/network-client.d.ts +43 -0
  132. package/network-client.js +14 -0
  133. package/network-client.js.map +1 -0
  134. package/network-client.mjs +13 -0
  135. package/network-client.mjs.map +1 -0
  136. package/package.json +11 -1
  137. package/testing/account.d.ts +2 -2
  138. package/testing/account.js +1 -1
  139. package/testing/account.js.map +1 -1
  140. package/testing/account.mjs +1 -1
  141. package/testing/account.mjs.map +1 -1
  142. package/testing/fixtures/algokit-log-capture-fixture.d.ts +1 -1
  143. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  144. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  145. package/testing/fixtures/algorand-fixture.d.ts +2 -2
  146. package/testing/fixtures/algorand-fixture.js +2 -2
  147. package/testing/fixtures/algorand-fixture.js.map +1 -1
  148. package/testing/fixtures/algorand-fixture.mjs +2 -2
  149. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  150. package/testing/index.d.ts +2 -1
  151. package/testing/test-logger.d.ts +1 -1
  152. package/testing/test-logger.js.map +1 -1
  153. package/testing/test-logger.mjs.map +1 -1
  154. package/testing/types.d.ts +156 -0
  155. package/transaction/index.d.ts +4 -0
  156. package/transaction/index.js +9 -0
  157. package/transaction/index.mjs +4 -0
  158. package/transaction/perform-transaction-composer-simulate.d.ts +1 -1
  159. package/transaction/perform-transaction-composer-simulate.js.map +1 -1
  160. package/transaction/perform-transaction-composer-simulate.mjs.map +1 -1
  161. package/transaction/transaction.d.ts +2 -2
  162. package/transaction/transaction.js.map +1 -1
  163. package/transaction/transaction.mjs.map +1 -1
  164. package/transaction/types.d.ts +133 -0
  165. package/transactions/app-call.d.ts +1 -1
  166. package/transactions/app-call.js +1 -1
  167. package/transactions/app-call.js.map +1 -1
  168. package/transactions/app-call.mjs +1 -1
  169. package/transactions/app-call.mjs.map +1 -1
  170. package/transactions/common.d.ts +1 -1
  171. package/transactions/common.js.map +1 -1
  172. package/transactions/common.mjs.map +1 -1
  173. package/transactions/method-call.d.ts +1 -1
  174. package/transactions/method-call.js +1 -1
  175. package/transactions/method-call.js.map +1 -1
  176. package/transactions/method-call.mjs +1 -1
  177. package/transactions/method-call.mjs.map +1 -1
  178. package/transactions/payment.d.ts +1 -1
  179. package/transactions/payment.js.map +1 -1
  180. package/transactions/payment.mjs.map +1 -1
  181. package/types/account-manager.d.ts +11 -442
  182. package/types/account-manager.js +5 -616
  183. package/types/account-manager.js.map +1 -1
  184. package/types/account-manager.mjs +5 -614
  185. package/types/account-manager.mjs.map +1 -1
  186. package/types/account.d.ts +8 -150
  187. package/types/account.js +3 -4
  188. package/types/account.js.map +1 -1
  189. package/types/account.mjs +4 -4
  190. package/types/account.mjs.map +1 -1
  191. package/types/algorand-client-transaction-creator.d.ts +5 -1098
  192. package/types/algorand-client-transaction-creator.js +3 -729
  193. package/types/algorand-client-transaction-creator.js.map +1 -1
  194. package/types/algorand-client-transaction-creator.mjs +4 -729
  195. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  196. package/types/algorand-client-transaction-sender.d.ts +5 -1312
  197. package/types/algorand-client-transaction-sender.js +3 -927
  198. package/types/algorand-client-transaction-sender.js.map +1 -1
  199. package/types/algorand-client-transaction-sender.mjs +3 -926
  200. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  201. package/types/algorand-client.d.ts +5 -241
  202. package/types/algorand-client.js +3 -319
  203. package/types/algorand-client.js.map +1 -1
  204. package/types/algorand-client.mjs +3 -319
  205. package/types/algorand-client.mjs.map +1 -1
  206. package/types/amount.d.ts +6 -45
  207. package/types/amount.js +3 -79
  208. package/types/amount.js.map +1 -1
  209. package/types/amount.mjs +4 -79
  210. package/types/amount.mjs.map +1 -1
  211. package/types/app-client.d.ts +75 -2125
  212. package/types/app-client.js +3 -903
  213. package/types/app-client.js.map +1 -1
  214. package/types/app-client.mjs +3 -902
  215. package/types/app-client.mjs.map +1 -1
  216. package/types/app-deployer.d.ts +21 -161
  217. package/types/app-deployer.js +3 -347
  218. package/types/app-deployer.js.map +1 -1
  219. package/types/app-deployer.mjs +3 -347
  220. package/types/app-deployer.mjs.map +1 -1
  221. package/types/app-factory.d.ts +21 -960
  222. package/types/app-factory.js +3 -442
  223. package/types/app-factory.js.map +1 -1
  224. package/types/app-factory.mjs +3 -442
  225. package/types/app-factory.mjs.map +1 -1
  226. package/types/app-manager.d.ts +15 -318
  227. package/types/app-manager.js +3 -462
  228. package/types/app-manager.js.map +1 -1
  229. package/types/app-manager.mjs +3 -462
  230. package/types/app-manager.mjs.map +1 -1
  231. package/types/app-spec.d.ts +39 -198
  232. package/types/app-spec.js +3 -131
  233. package/types/app-spec.js.map +1 -1
  234. package/types/app-spec.mjs +3 -131
  235. package/types/app-spec.mjs.map +1 -1
  236. package/types/app.d.ts +62 -247
  237. package/types/app.js +15 -37
  238. package/types/app.js.map +1 -1
  239. package/types/app.mjs +16 -37
  240. package/types/app.mjs.map +1 -1
  241. package/types/asset-manager.d.ts +9 -207
  242. package/types/asset-manager.js +3 -160
  243. package/types/asset-manager.js.map +1 -1
  244. package/types/asset-manager.mjs +3 -160
  245. package/types/asset-manager.mjs.map +1 -1
  246. package/types/async-event-emitter.d.ts +7 -11
  247. package/types/async-event-emitter.js +3 -32
  248. package/types/async-event-emitter.js.map +1 -1
  249. package/types/async-event-emitter.mjs +4 -32
  250. package/types/async-event-emitter.mjs.map +1 -1
  251. package/types/client-manager.d.ts +27 -470
  252. package/types/client-manager.js +3 -610
  253. package/types/client-manager.js.map +1 -1
  254. package/types/client-manager.mjs +3 -610
  255. package/types/client-manager.mjs.map +1 -1
  256. package/types/composer.d.ts +79 -943
  257. package/types/composer.js +3 -1578
  258. package/types/composer.js.map +1 -1
  259. package/types/composer.mjs +3 -1577
  260. package/types/composer.mjs.map +1 -1
  261. package/types/config.d.ts +7 -52
  262. package/types/config.js +3 -74
  263. package/types/config.js.map +1 -1
  264. package/types/config.mjs +3 -74
  265. package/types/config.mjs.map +1 -1
  266. package/types/debugging.d.ts +12 -37
  267. package/types/debugging.js +11 -10
  268. package/types/debugging.js.map +1 -1
  269. package/types/debugging.mjs +12 -10
  270. package/types/debugging.mjs.map +1 -1
  271. package/types/dispenser-client.d.ts +11 -85
  272. package/types/dispenser-client.js +3 -121
  273. package/types/dispenser-client.js.map +1 -1
  274. package/types/dispenser-client.mjs +3 -121
  275. package/types/dispenser-client.mjs.map +1 -1
  276. package/types/expand.d.ts +8 -2
  277. package/types/indexer.d.ts +16 -36
  278. package/types/indexer.js +7 -30
  279. package/types/indexer.js.map +1 -1
  280. package/types/indexer.mjs +8 -30
  281. package/types/indexer.mjs.map +1 -1
  282. package/types/instance-of.d.ts +4 -4
  283. package/types/kmd-account-manager.d.ts +5 -69
  284. package/types/kmd-account-manager.js +3 -161
  285. package/types/kmd-account-manager.js.map +1 -1
  286. package/types/kmd-account-manager.mjs +3 -159
  287. package/types/kmd-account-manager.mjs.map +1 -1
  288. package/types/lifecycle-events.d.ts +7 -9
  289. package/types/lifecycle-events.js +3 -5
  290. package/types/lifecycle-events.js.map +1 -1
  291. package/types/lifecycle-events.mjs +4 -5
  292. package/types/lifecycle-events.mjs.map +1 -1
  293. package/types/logging.d.ts +14 -9
  294. package/types/logging.js +11 -37
  295. package/types/logging.js.map +1 -1
  296. package/types/logging.mjs +12 -37
  297. package/types/logging.mjs.map +1 -1
  298. package/types/logic-error.d.ts +8 -35
  299. package/types/logic-error.js +3 -48
  300. package/types/logic-error.js.map +1 -1
  301. package/types/logic-error.mjs +4 -48
  302. package/types/logic-error.mjs.map +1 -1
  303. package/types/network-client.d.ts +10 -39
  304. package/types/network-client.js +3 -8
  305. package/types/network-client.js.map +1 -1
  306. package/types/network-client.mjs +4 -8
  307. package/types/network-client.mjs.map +1 -1
  308. package/types/testing.d.ts +13 -151
  309. package/types/transaction.d.ts +33 -128
  310. package/updatable-config.d.ts +57 -0
  311. package/updatable-config.js +80 -0
  312. package/updatable-config.js.map +1 -0
  313. package/updatable-config.mjs +80 -0
  314. package/updatable-config.mjs.map +1 -0
  315. package/util.js +1 -1
  316. package/util.js.map +1 -1
  317. package/util.mjs +1 -1
  318. package/util.mjs.map +1 -1
@@ -1,212 +1,14 @@
1
- import { Address } from "../packages/common/src/address.js";
2
- import { AlgodClient } from "../packages/algod_client/src/client.js";
3
- import { CommonTransactionParams } from "../transactions/common.js";
4
- import { SendParams } from "./transaction.js";
5
- import { TransactionComposer, TransactionComposerConfig } from "./composer.js";
6
- import { AccountAssetInformation } from "./account.js";
1
+ import { AssetInformation as AssetInformation$1, AssetManager as AssetManager$1, BulkAssetOptInOutResult as BulkAssetOptInOutResult$1 } from "../asset-manager.js";
7
2
 
8
3
  //#region src/types/asset-manager.d.ts
9
- /** Individual result from performing a bulk opt-in or bulk opt-out for an account against a series of assets. */
10
- interface BulkAssetOptInOutResult {
11
- /** The ID of the asset opted into / out of */
12
- assetId: bigint;
13
- /** The transaction ID of the resulting opt in / out */
14
- transactionId: string;
15
- }
16
- /** Information about an asset. */
17
- interface AssetInformation {
18
- /** The ID of the asset. */
19
- assetId: bigint;
20
- /** The address of the account that created the asset.
21
- *
22
- * This is the address where the parameters for this asset can be found,
23
- * and also the address where unwanted asset units can be sent when
24
- * closing out an asset position and opting-out of the asset.
25
- */
26
- creator: string;
27
- /** The total amount of the smallest divisible (decimal) units that were created of the asset.
28
- *
29
- * For example, if `decimals` is, say, 2, then for every 100 `total` there is 1 whole unit.
30
- */
31
- total: bigint;
32
- /** The amount of decimal places the asset was created with.
33
- *
34
- * * If 0, the asset is not divisible;
35
- * * If 1, the base unit of the asset is in tenths;
36
- * * If 2, the base unit of the asset is in hundredths;
37
- * * If 3, the base unit of the asset is in thousandths;
38
- * * and so on up to 19 decimal places.
39
- */
40
- decimals: number;
41
- /** Whether the asset was frozen by default for all accounts.
42
- *
43
- * If `true` then for anyone apart from the creator to hold the
44
- * asset it needs to be unfrozen per account using an asset freeze
45
- * transaction from the `freeze` account.
46
- */
47
- defaultFrozen?: boolean;
48
- /** The address of the optional account that can manage the configuration of the asset and destroy it.
49
- *
50
- * If not set the asset is permanently immutable.
51
- */
52
- manager?: string;
53
- /**
54
- * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
55
- *
56
- * This address has no specific authority in the protocol itself and is informational only.
57
- *
58
- * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
59
- * rely on this field to hold meaningful data.
60
- *
61
- * It can be used in the case where you want to signal to holders of your asset that the uncirculated units
62
- * of the asset reside in an account that is different from the default creator account.
63
- *
64
- * If not set the field is permanently empty.
65
- */
66
- reserve?: string;
67
- /**
68
- * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
69
- *
70
- * If empty, freezing is not permitted.
71
- *
72
- * If not set the field is permanently empty.
73
- */
74
- freeze?: string;
75
- /**
76
- * The address of the optional account that can clawback holdings of this asset from any account.
77
- *
78
- * The clawback account has the ability to **unconditionally take assets from any account**.
79
- *
80
- * If empty, clawback is not permitted.
81
- *
82
- * If not set the field is permanently empty.
83
- */
84
- clawback?: string;
85
- /** The optional name of the unit of this asset (e.g. ticker name).
86
- *
87
- * Max size is 8 bytes.
88
- */
89
- unitName?: string;
90
- /** The optional name of the unit of this asset (e.g. ticker name).
91
- *
92
- * Max size is 8 bytes.
93
- */
94
- unitNameAsBytes?: Uint8Array;
95
- /** The optional name of the asset.
96
- *
97
- * Max size is 32 bytes.
98
- */
99
- assetName?: string;
100
- /** The optional name of the asset.
101
- *
102
- * Max size is 32 bytes.
103
- */
104
- assetNameAsBytes?: Uint8Array;
105
- /** Optional URL where more information about the asset can be retrieved (e.g. metadata).
106
- *
107
- * Max size is 96 bytes.
108
- */
109
- url?: string;
110
- /** Optional URL where more information about the asset can be retrieved (e.g. metadata).
111
- *
112
- * Max size is 96 bytes.
113
- */
114
- urlAsBytes?: Uint8Array;
115
- /** 32-byte hash of some metadata that is relevant to the asset and/or asset holders.
116
- *
117
- * The format of this metadata is up to the application.
118
- */
119
- metadataHash?: Uint8Array;
120
- }
121
- /** Allows management of asset information. */
122
- declare class AssetManager {
123
- private _algod;
124
- private _newGroup;
125
- /**
126
- * Create a new asset manager.
127
- * @param algod An algod client
128
- * @param newGroup A function that creates a new `TransactionComposer` transaction group
129
- * @example Create a new asset manager
130
- * ```typescript
131
- * const assetManager = new AssetManager(algod, () => new TransactionComposer({algod, () => signer, () => suggestedParams}))
132
- * ```
133
- */
134
- constructor(algod: AlgodClient, newGroup: (config?: TransactionComposerConfig) => TransactionComposer);
135
- /**
136
- * Returns the current asset information for the asset with the given ID.
137
- *
138
- * @example
139
- * ```typescript
140
- * const assetInfo = await assetManager.getById(12353n);
141
- * ```
142
- *
143
- * @param assetId The ID of the asset
144
- * @returns The asset information
145
- */
146
- getById(assetId: bigint): Promise<AssetInformation>;
147
- /**
148
- * Returns the given sender account's asset holding for a given asset.
149
- *
150
- * @example
151
- * ```typescript
152
- * const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
153
- * const assetId = 123345n;
154
- * const accountInfo = await assetManager.getAccountInformation(address, assetId);
155
- * ```
156
- *
157
- * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)
158
- * @param sender The address of the sender/account to look up
159
- * @param assetId The ID of the asset to return a holding for
160
- * @returns The account asset holding information
161
- */
162
- getAccountInformation(sender: string | Address, assetId: bigint): Promise<AccountAssetInformation>;
163
- /**
164
- * Opt an account in to a list of Algorand Standard Assets.
165
- *
166
- * Transactions will be sent in batches of 16 as transaction groups.
167
- *
168
- * @param account The account to opt-in
169
- * @param assetIds The list of asset IDs to opt-in to
170
- * @param options Any parameters to control the transaction or execution of the transaction
171
- * @example Example using AlgorandClient
172
- * ```typescript
173
- * // Basic example
174
- * assetManager.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n])
175
- * // With configuration
176
- * assetManager.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n], { maxFee: (1000).microAlgo(), suppressLog: true })
177
- * ```
178
- * @returns An array of records matching asset ID to transaction ID of the opt in
179
- */
180
- bulkOptIn(account: string | Address, assetIds: bigint[], options?: Omit<CommonTransactionParams, 'sender'> & SendParams): Promise<BulkAssetOptInOutResult[]>;
181
- /**
182
- * Opt an account out of a list of Algorand Standard Assets.
183
- *
184
- * Transactions will be sent in batches of 16 as transaction groups.
185
- *
186
- * @param account The account to opt-in
187
- * @param assetIds The list of asset IDs to opt-out of
188
- * @param options Any parameters to control the transaction or execution of the transaction
189
- * @example Example using AlgorandClient
190
- * ```typescript
191
- * // Basic example
192
- * assetManager.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n])
193
- * // With configuration
194
- * assetManager.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n], { ensureZeroBalance: true, maxFee: (1000).microAlgo(), suppressLog: true })
195
- * ```
196
- * @returns An array of records matching asset ID to transaction ID of the opt in
197
- */
198
- bulkOptOut(account: string | Address, assetIds: bigint[], options?: Omit<CommonTransactionParams, 'sender'> & SendParams & {
199
- /** Whether or not to check if the account has a zero balance for each asset first or not.
200
- *
201
- * Defaults to `true`.
202
- *
203
- * If this is set to `true` and the account has an asset balance it will throw an error.
204
- *
205
- * If this is set to `false` and the account has an asset balance it will lose those assets to the asset creator.
206
- */
207
- ensureZeroBalance?: boolean;
208
- }): Promise<BulkAssetOptInOutResult[]>;
209
- }
4
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */
5
+ type BulkAssetOptInOutResult = BulkAssetOptInOutResult$1;
6
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */
7
+ type AssetInformation = AssetInformation$1;
8
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */
9
+ declare const AssetManager: typeof AssetManager$1;
10
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */
11
+ type AssetManager = AssetManager$1;
210
12
  //#endregion
211
13
  export { AssetInformation, AssetManager, BulkAssetOptInOutResult };
212
14
  //# sourceMappingURL=asset-manager.d.ts.map
@@ -1,165 +1,8 @@
1
- const require_constants = require('../packages/common/src/constants.js');
2
- const require_config = require('../config.js');
3
- const require_util = require('../util.js');
1
+ const require_asset_manager = require('../asset-manager.js');
4
2
 
5
3
  //#region src/types/asset-manager.ts
6
- /** Allows management of asset information. */
7
- var AssetManager = class {
8
- _algod;
9
- _newGroup;
10
- /**
11
- * Create a new asset manager.
12
- * @param algod An algod client
13
- * @param newGroup A function that creates a new `TransactionComposer` transaction group
14
- * @example Create a new asset manager
15
- * ```typescript
16
- * const assetManager = new AssetManager(algod, () => new TransactionComposer({algod, () => signer, () => suggestedParams}))
17
- * ```
18
- */
19
- constructor(algod, newGroup) {
20
- this._algod = algod;
21
- this._newGroup = newGroup;
22
- }
23
- /**
24
- * Returns the current asset information for the asset with the given ID.
25
- *
26
- * @example
27
- * ```typescript
28
- * const assetInfo = await assetManager.getById(12353n);
29
- * ```
30
- *
31
- * @param assetId The ID of the asset
32
- * @returns The asset information
33
- */
34
- async getById(assetId) {
35
- const asset = await this._algod.assetById(assetId);
36
- return {
37
- assetId: BigInt(asset.id),
38
- total: BigInt(asset.params.total),
39
- decimals: Number(asset.params.decimals),
40
- assetName: asset.params.name,
41
- assetNameAsBytes: asset.params.nameB64,
42
- unitName: asset.params.unitName,
43
- unitNameAsBytes: asset.params.unitNameB64,
44
- url: asset.params.url,
45
- urlAsBytes: asset.params.urlB64,
46
- creator: asset.params.creator,
47
- manager: asset.params.manager,
48
- clawback: asset.params.clawback,
49
- freeze: asset.params.freeze,
50
- reserve: asset.params.reserve,
51
- defaultFrozen: asset.params.defaultFrozen,
52
- metadataHash: asset.params.metadataHash
53
- };
54
- }
55
- /**
56
- * Returns the given sender account's asset holding for a given asset.
57
- *
58
- * @example
59
- * ```typescript
60
- * const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
61
- * const assetId = 123345n;
62
- * const accountInfo = await assetManager.getAccountInformation(address, assetId);
63
- * ```
64
- *
65
- * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)
66
- * @param sender The address of the sender/account to look up
67
- * @param assetId The ID of the asset to return a holding for
68
- * @returns The account asset holding information
69
- */
70
- async getAccountInformation(sender, assetId) {
71
- const info = await this._algod.accountAssetInformation(sender.toString(), assetId);
72
- return {
73
- assetId: BigInt(assetId),
74
- balance: BigInt(info.assetHolding?.amount ?? 0),
75
- frozen: info.assetHolding?.isFrozen === true,
76
- round: BigInt(info["round"])
77
- };
78
- }
79
- /**
80
- * Opt an account in to a list of Algorand Standard Assets.
81
- *
82
- * Transactions will be sent in batches of 16 as transaction groups.
83
- *
84
- * @param account The account to opt-in
85
- * @param assetIds The list of asset IDs to opt-in to
86
- * @param options Any parameters to control the transaction or execution of the transaction
87
- * @example Example using AlgorandClient
88
- * ```typescript
89
- * // Basic example
90
- * assetManager.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n])
91
- * // With configuration
92
- * assetManager.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n], { maxFee: (1000).microAlgo(), suppressLog: true })
93
- * ```
94
- * @returns An array of records matching asset ID to transaction ID of the opt in
95
- */
96
- async bulkOptIn(account, assetIds, options) {
97
- const results = [];
98
- for (const assetGroup of require_util.chunkArray(assetIds, require_constants.MAX_TRANSACTION_GROUP_SIZE)) {
99
- const composer = this._newGroup();
100
- for (const assetId of assetGroup) composer.addAssetOptIn({
101
- ...options,
102
- sender: account,
103
- assetId: BigInt(assetId)
104
- });
105
- const result = await composer.send(options);
106
- require_config.Config.getLogger(options?.suppressLog).info(`Successfully opted in ${account} for assets ${assetGroup.join(", ")} with transaction IDs ${result.txIds.join(", ")}\n Grouped under ${result.groupId} in round ${result.confirmations?.[0]?.confirmedRound}.`);
107
- assetGroup.forEach((assetId, index) => {
108
- results.push({
109
- assetId: BigInt(assetId),
110
- transactionId: result.txIds[index]
111
- });
112
- });
113
- }
114
- return results;
115
- }
116
- /**
117
- * Opt an account out of a list of Algorand Standard Assets.
118
- *
119
- * Transactions will be sent in batches of 16 as transaction groups.
120
- *
121
- * @param account The account to opt-in
122
- * @param assetIds The list of asset IDs to opt-out of
123
- * @param options Any parameters to control the transaction or execution of the transaction
124
- * @example Example using AlgorandClient
125
- * ```typescript
126
- * // Basic example
127
- * assetManager.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n])
128
- * // With configuration
129
- * assetManager.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n], { ensureZeroBalance: true, maxFee: (1000).microAlgo(), suppressLog: true })
130
- * ```
131
- * @returns An array of records matching asset ID to transaction ID of the opt in
132
- */
133
- async bulkOptOut(account, assetIds, options) {
134
- const results = [];
135
- for (const assetGroup of require_util.chunkArray(assetIds, require_constants.MAX_TRANSACTION_GROUP_SIZE)) {
136
- const composer = this._newGroup();
137
- const notOptedInAssetIds = [];
138
- const nonZeroBalanceAssetIds = [];
139
- for (const assetId of assetGroup) if (options?.ensureZeroBalance !== false) try {
140
- if ((await this.getAccountInformation(account, assetId)).balance !== 0n) nonZeroBalanceAssetIds.push(BigInt(assetId));
141
- } catch {
142
- notOptedInAssetIds.push(BigInt(assetId));
143
- }
144
- if (notOptedInAssetIds.length > 0 || nonZeroBalanceAssetIds.length > 0) throw new Error(`Account ${account}${notOptedInAssetIds.length > 0 ? ` is not opted-in to Asset${notOptedInAssetIds.length > 1 ? "s" : ""} ${notOptedInAssetIds.join(", ")}` : ""}${nonZeroBalanceAssetIds.length > 0 ? ` has non-zero balance for Asset${nonZeroBalanceAssetIds.length > 1 ? "s" : ""} ${nonZeroBalanceAssetIds.join(", ")}` : ""}; can't opt-out.`);
145
- for (const assetId of assetGroup) composer.addAssetOptOut({
146
- ...options,
147
- creator: (await this.getById(BigInt(assetId))).creator,
148
- sender: account,
149
- assetId: BigInt(assetId)
150
- });
151
- const result = await composer.send(options);
152
- require_config.Config.getLogger(options?.suppressLog).info(`Successfully opted ${account} out of assets ${assetGroup.join(", ")} with transaction IDs ${result.txIds.join(", ")}\n Grouped under ${result.groupId} in round ${result.confirmations?.[0]?.confirmedRound}.`);
153
- assetGroup.forEach((assetId, index) => {
154
- results.push({
155
- assetId: BigInt(assetId),
156
- transactionId: result.txIds[index]
157
- });
158
- });
159
- }
160
- return results;
161
- }
162
- };
4
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */
5
+ const AssetManager = require_asset_manager.AssetManager;
163
6
 
164
7
  //#endregion
165
8
  exports.AssetManager = AssetManager;
@@ -1 +1 @@
1
- {"version":3,"file":"asset-manager.js","names":["results: BulkAssetOptInOutResult[]","chunkArray","MAX_TRANSACTION_GROUP_SIZE","notOptedInAssetIds: bigint[]","nonZeroBalanceAssetIds: bigint[]"],"sources":["../../src/types/asset-manager.ts"],"sourcesContent":["import { AlgodClient } from '@algorandfoundation/algokit-algod-client'\nimport { Address, MAX_TRANSACTION_GROUP_SIZE } from '@algorandfoundation/algokit-common'\nimport { Config } from '../config'\nimport { chunkArray } from '../util'\nimport { AccountAssetInformation } from './account'\nimport { CommonTransactionParams, TransactionComposer, TransactionComposerConfig } from './composer'\nimport { SendParams } from './transaction'\n\n/** Individual result from performing a bulk opt-in or bulk opt-out for an account against a series of assets. */\nexport interface BulkAssetOptInOutResult {\n /** The ID of the asset opted into / out of */\n assetId: bigint\n /** The transaction ID of the resulting opt in / out */\n transactionId: string\n}\n\n/** Information about an asset. */\nexport interface AssetInformation {\n /** The ID of the asset. */\n assetId: bigint\n\n /** The address of the account that created the asset.\n *\n * This is the address where the parameters for this asset can be found,\n * and also the address where unwanted asset units can be sent when\n * closing out an asset position and opting-out of the asset.\n */\n creator: string\n\n /** The total amount of the smallest divisible (decimal) units that were created of the asset.\n *\n * For example, if `decimals` is, say, 2, then for every 100 `total` there is 1 whole unit.\n */\n total: bigint\n\n /** The amount of decimal places the asset was created with.\n *\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n * * and so on up to 19 decimal places.\n */\n decimals: number\n\n /** Whether the asset was frozen by default for all accounts.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account.\n */\n defaultFrozen?: boolean\n\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * If not set the asset is permanently immutable.\n */\n manager?: string\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set the field is permanently empty.\n */\n reserve?: string\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set the field is permanently empty.\n */\n freeze?: string\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * The clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set the field is permanently empty.\n */\n clawback?: string\n\n /** The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n */\n unitName?: string\n\n /** The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n */\n unitNameAsBytes?: Uint8Array\n\n /** The optional name of the asset.\n *\n * Max size is 32 bytes.\n */\n assetName?: string\n\n /** The optional name of the asset.\n *\n * Max size is 32 bytes.\n */\n assetNameAsBytes?: Uint8Array\n\n /** Optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n */\n url?: string\n\n /** Optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n */\n urlAsBytes?: Uint8Array\n\n /** 32-byte hash of some metadata that is relevant to the asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n */\n metadataHash?: Uint8Array\n}\n\n/** Allows management of asset information. */\nexport class AssetManager {\n private _algod: AlgodClient\n private _newGroup: () => TransactionComposer\n\n /**\n * Create a new asset manager.\n * @param algod An algod client\n * @param newGroup A function that creates a new `TransactionComposer` transaction group\n * @example Create a new asset manager\n * ```typescript\n * const assetManager = new AssetManager(algod, () => new TransactionComposer({algod, () => signer, () => suggestedParams}))\n * ```\n */\n constructor(algod: AlgodClient, newGroup: (config?: TransactionComposerConfig) => TransactionComposer) {\n this._algod = algod\n this._newGroup = newGroup\n }\n\n /**\n * Returns the current asset information for the asset with the given ID.\n *\n * @example\n * ```typescript\n * const assetInfo = await assetManager.getById(12353n);\n * ```\n *\n * @param assetId The ID of the asset\n * @returns The asset information\n */\n public async getById(assetId: bigint): Promise<AssetInformation> {\n const asset = await this._algod.assetById(assetId)\n\n return {\n assetId: BigInt(asset.id),\n total: BigInt(asset.params.total),\n decimals: Number(asset.params.decimals),\n assetName: asset.params.name,\n assetNameAsBytes: asset.params.nameB64,\n unitName: asset.params.unitName,\n unitNameAsBytes: asset.params.unitNameB64,\n url: asset.params.url,\n urlAsBytes: asset.params.urlB64,\n creator: asset.params.creator,\n manager: asset.params.manager,\n clawback: asset.params.clawback,\n freeze: asset.params.freeze,\n reserve: asset.params.reserve,\n defaultFrozen: asset.params.defaultFrozen,\n metadataHash: asset.params.metadataHash,\n }\n }\n\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 = 123345n;\n * const accountInfo = await assetManager.getAccountInformation(address, assetId);\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 * @returns The account asset holding information\n */\n public async getAccountInformation(sender: string | Address, assetId: bigint): Promise<AccountAssetInformation> {\n const info = await this._algod.accountAssetInformation(sender.toString(), assetId)\n\n return {\n assetId: BigInt(assetId),\n balance: BigInt(info.assetHolding?.amount ?? 0),\n frozen: info.assetHolding?.isFrozen === true,\n round: BigInt(info['round']),\n }\n }\n\n /**\n * Opt an account in to a list of Algorand Standard Assets.\n *\n * Transactions will be sent in batches of 16 as transaction groups.\n *\n * @param account The account to opt-in\n * @param assetIds The list of asset IDs to opt-in to\n * @param options Any parameters to control the transaction or execution of the transaction\n * @example Example using AlgorandClient\n * ```typescript\n * // Basic example\n * assetManager.bulkOptIn(\"ACCOUNTADDRESS\", [12345n, 67890n])\n * // With configuration\n * assetManager.bulkOptIn(\"ACCOUNTADDRESS\", [12345n, 67890n], { maxFee: (1000).microAlgo(), suppressLog: true })\n * ```\n * @returns An array of records matching asset ID to transaction ID of the opt in\n */\n async bulkOptIn(\n account: string | Address,\n assetIds: bigint[],\n options?: Omit<CommonTransactionParams, 'sender'> & SendParams,\n ): Promise<BulkAssetOptInOutResult[]> {\n const results: BulkAssetOptInOutResult[] = []\n\n for (const assetGroup of chunkArray(assetIds, MAX_TRANSACTION_GROUP_SIZE)) {\n const composer = this._newGroup()\n\n for (const assetId of assetGroup) {\n composer.addAssetOptIn({\n ...options,\n sender: account,\n assetId: BigInt(assetId),\n })\n }\n\n const result = await composer.send(options)\n\n Config.getLogger(options?.suppressLog).info(\n `Successfully opted in ${account} for assets ${assetGroup.join(', ')} with transaction IDs ${result.txIds.join(', ')}` +\n `\\n Grouped under ${result.groupId} in round ${result.confirmations?.[0]?.confirmedRound}.`,\n )\n\n assetGroup.forEach((assetId, index) => {\n results.push({ assetId: BigInt(assetId), transactionId: result.txIds[index] })\n })\n }\n\n return results\n }\n\n /**\n * Opt an account out of a list of Algorand Standard Assets.\n *\n * Transactions will be sent in batches of 16 as transaction groups.\n *\n * @param account The account to opt-in\n * @param assetIds The list of asset IDs to opt-out of\n * @param options Any parameters to control the transaction or execution of the transaction\n * @example Example using AlgorandClient\n * ```typescript\n * // Basic example\n * assetManager.bulkOptOut(\"ACCOUNTADDRESS\", [12345n, 67890n])\n * // With configuration\n * assetManager.bulkOptOut(\"ACCOUNTADDRESS\", [12345n, 67890n], { ensureZeroBalance: true, maxFee: (1000).microAlgo(), suppressLog: true })\n * ```\n * @returns An array of records matching asset ID to transaction ID of the opt in\n */\n async bulkOptOut(\n account: string | Address,\n assetIds: bigint[],\n options?: Omit<CommonTransactionParams, 'sender'> &\n SendParams & {\n /** Whether or not to check if the account has a zero balance for each asset first or not.\n *\n * Defaults to `true`.\n *\n * If this is set to `true` and the account has an asset balance it will throw an error.\n *\n * If this is set to `false` and the account has an asset balance it will lose those assets to the asset creator.\n */\n ensureZeroBalance?: boolean\n },\n ): Promise<BulkAssetOptInOutResult[]> {\n const results: BulkAssetOptInOutResult[] = []\n\n for (const assetGroup of chunkArray(assetIds, MAX_TRANSACTION_GROUP_SIZE)) {\n const composer = this._newGroup()\n\n const notOptedInAssetIds: bigint[] = []\n const nonZeroBalanceAssetIds: bigint[] = []\n for (const assetId of assetGroup) {\n if (options?.ensureZeroBalance !== false) {\n try {\n const accountAssetInfo = await this.getAccountInformation(account, assetId)\n if (accountAssetInfo.balance !== 0n) {\n nonZeroBalanceAssetIds.push(BigInt(assetId))\n }\n } catch {\n notOptedInAssetIds.push(BigInt(assetId))\n }\n }\n }\n\n if (notOptedInAssetIds.length > 0 || nonZeroBalanceAssetIds.length > 0) {\n throw new Error(\n `Account ${account}${notOptedInAssetIds.length > 0 ? ` is not opted-in to Asset${notOptedInAssetIds.length > 1 ? 's' : ''} ${notOptedInAssetIds.join(', ')}` : ''}${\n nonZeroBalanceAssetIds.length > 0\n ? ` has non-zero balance for Asset${nonZeroBalanceAssetIds.length > 1 ? 's' : ''} ${nonZeroBalanceAssetIds.join(', ')}`\n : ''\n }; can't opt-out.`,\n )\n }\n\n for (const assetId of assetGroup) {\n composer.addAssetOptOut({\n ...options,\n creator: (await this.getById(BigInt(assetId))).creator,\n sender: account,\n assetId: BigInt(assetId),\n })\n }\n\n const result = await composer.send(options)\n\n Config.getLogger(options?.suppressLog).info(\n `Successfully opted ${account} out of assets ${assetGroup.join(', ')} with transaction IDs ${result.txIds.join(', ')}` +\n `\\n Grouped under ${result.groupId} in round ${result.confirmations?.[0]?.confirmedRound}.`,\n )\n\n assetGroup.forEach((assetId, index) => {\n results.push({ assetId: BigInt(assetId), transactionId: result.txIds[index] })\n })\n }\n\n return results\n }\n}\n"],"mappings":";;;;;;AA0IA,IAAa,eAAb,MAA0B;CACxB,AAAQ;CACR,AAAQ;;;;;;;;;;CAWR,YAAY,OAAoB,UAAuE;AACrG,OAAK,SAAS;AACd,OAAK,YAAY;;;;;;;;;;;;;CAcnB,MAAa,QAAQ,SAA4C;EAC/D,MAAM,QAAQ,MAAM,KAAK,OAAO,UAAU,QAAQ;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;AAED,cAAW,SAAS,SAAS,UAAU;AACrC,YAAQ,KAAK;KAAE,SAAS,OAAO,QAAQ;KAAE,eAAe,OAAO,MAAM;KAAQ,CAAC;KAC9E;;AAGJ,SAAO"}
1
+ {"version":3,"file":"asset-manager.js","names":["_AssetManager"],"sources":["../../src/types/asset-manager.ts"],"sourcesContent":["// Re-exports with deprecation notices for backwards compatibility\n// New imports should use '@algorandfoundation/algokit-utils/asset-manager'\n\nimport {\n type BulkAssetOptInOutResult as _BulkAssetOptInOutResult,\n type AssetInformation as _AssetInformation,\n AssetManager as _AssetManager,\n} from '../asset-manager'\n\n/** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */\nexport type BulkAssetOptInOutResult = _BulkAssetOptInOutResult\n\n/** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */\nexport type AssetInformation = _AssetInformation\n\n/** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */\nexport const AssetManager = _AssetManager\n/** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */\nexport type AssetManager = _AssetManager\n"],"mappings":";;;;AAgBA,MAAa,eAAeA"}
@@ -1,165 +1,8 @@
1
- import { MAX_TRANSACTION_GROUP_SIZE } from "../packages/common/src/constants.mjs";
2
- import { Config } from "../config.mjs";
3
- import { chunkArray } from "../util.mjs";
1
+ import { AssetManager as AssetManager$1 } from "../asset-manager.mjs";
4
2
 
5
3
  //#region src/types/asset-manager.ts
6
- /** Allows management of asset information. */
7
- var AssetManager = class {
8
- _algod;
9
- _newGroup;
10
- /**
11
- * Create a new asset manager.
12
- * @param algod An algod client
13
- * @param newGroup A function that creates a new `TransactionComposer` transaction group
14
- * @example Create a new asset manager
15
- * ```typescript
16
- * const assetManager = new AssetManager(algod, () => new TransactionComposer({algod, () => signer, () => suggestedParams}))
17
- * ```
18
- */
19
- constructor(algod, newGroup) {
20
- this._algod = algod;
21
- this._newGroup = newGroup;
22
- }
23
- /**
24
- * Returns the current asset information for the asset with the given ID.
25
- *
26
- * @example
27
- * ```typescript
28
- * const assetInfo = await assetManager.getById(12353n);
29
- * ```
30
- *
31
- * @param assetId The ID of the asset
32
- * @returns The asset information
33
- */
34
- async getById(assetId) {
35
- const asset = await this._algod.assetById(assetId);
36
- return {
37
- assetId: BigInt(asset.id),
38
- total: BigInt(asset.params.total),
39
- decimals: Number(asset.params.decimals),
40
- assetName: asset.params.name,
41
- assetNameAsBytes: asset.params.nameB64,
42
- unitName: asset.params.unitName,
43
- unitNameAsBytes: asset.params.unitNameB64,
44
- url: asset.params.url,
45
- urlAsBytes: asset.params.urlB64,
46
- creator: asset.params.creator,
47
- manager: asset.params.manager,
48
- clawback: asset.params.clawback,
49
- freeze: asset.params.freeze,
50
- reserve: asset.params.reserve,
51
- defaultFrozen: asset.params.defaultFrozen,
52
- metadataHash: asset.params.metadataHash
53
- };
54
- }
55
- /**
56
- * Returns the given sender account's asset holding for a given asset.
57
- *
58
- * @example
59
- * ```typescript
60
- * const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
61
- * const assetId = 123345n;
62
- * const accountInfo = await assetManager.getAccountInformation(address, assetId);
63
- * ```
64
- *
65
- * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)
66
- * @param sender The address of the sender/account to look up
67
- * @param assetId The ID of the asset to return a holding for
68
- * @returns The account asset holding information
69
- */
70
- async getAccountInformation(sender, assetId) {
71
- const info = await this._algod.accountAssetInformation(sender.toString(), assetId);
72
- return {
73
- assetId: BigInt(assetId),
74
- balance: BigInt(info.assetHolding?.amount ?? 0),
75
- frozen: info.assetHolding?.isFrozen === true,
76
- round: BigInt(info["round"])
77
- };
78
- }
79
- /**
80
- * Opt an account in to a list of Algorand Standard Assets.
81
- *
82
- * Transactions will be sent in batches of 16 as transaction groups.
83
- *
84
- * @param account The account to opt-in
85
- * @param assetIds The list of asset IDs to opt-in to
86
- * @param options Any parameters to control the transaction or execution of the transaction
87
- * @example Example using AlgorandClient
88
- * ```typescript
89
- * // Basic example
90
- * assetManager.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n])
91
- * // With configuration
92
- * assetManager.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n], { maxFee: (1000).microAlgo(), suppressLog: true })
93
- * ```
94
- * @returns An array of records matching asset ID to transaction ID of the opt in
95
- */
96
- async bulkOptIn(account, assetIds, options) {
97
- const results = [];
98
- for (const assetGroup of chunkArray(assetIds, MAX_TRANSACTION_GROUP_SIZE)) {
99
- const composer = this._newGroup();
100
- for (const assetId of assetGroup) composer.addAssetOptIn({
101
- ...options,
102
- sender: account,
103
- assetId: BigInt(assetId)
104
- });
105
- const result = await composer.send(options);
106
- Config.getLogger(options?.suppressLog).info(`Successfully opted in ${account} for assets ${assetGroup.join(", ")} with transaction IDs ${result.txIds.join(", ")}\n Grouped under ${result.groupId} in round ${result.confirmations?.[0]?.confirmedRound}.`);
107
- assetGroup.forEach((assetId, index) => {
108
- results.push({
109
- assetId: BigInt(assetId),
110
- transactionId: result.txIds[index]
111
- });
112
- });
113
- }
114
- return results;
115
- }
116
- /**
117
- * Opt an account out of a list of Algorand Standard Assets.
118
- *
119
- * Transactions will be sent in batches of 16 as transaction groups.
120
- *
121
- * @param account The account to opt-in
122
- * @param assetIds The list of asset IDs to opt-out of
123
- * @param options Any parameters to control the transaction or execution of the transaction
124
- * @example Example using AlgorandClient
125
- * ```typescript
126
- * // Basic example
127
- * assetManager.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n])
128
- * // With configuration
129
- * assetManager.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n], { ensureZeroBalance: true, maxFee: (1000).microAlgo(), suppressLog: true })
130
- * ```
131
- * @returns An array of records matching asset ID to transaction ID of the opt in
132
- */
133
- async bulkOptOut(account, assetIds, options) {
134
- const results = [];
135
- for (const assetGroup of chunkArray(assetIds, MAX_TRANSACTION_GROUP_SIZE)) {
136
- const composer = this._newGroup();
137
- const notOptedInAssetIds = [];
138
- const nonZeroBalanceAssetIds = [];
139
- for (const assetId of assetGroup) if (options?.ensureZeroBalance !== false) try {
140
- if ((await this.getAccountInformation(account, assetId)).balance !== 0n) nonZeroBalanceAssetIds.push(BigInt(assetId));
141
- } catch {
142
- notOptedInAssetIds.push(BigInt(assetId));
143
- }
144
- if (notOptedInAssetIds.length > 0 || nonZeroBalanceAssetIds.length > 0) throw new Error(`Account ${account}${notOptedInAssetIds.length > 0 ? ` is not opted-in to Asset${notOptedInAssetIds.length > 1 ? "s" : ""} ${notOptedInAssetIds.join(", ")}` : ""}${nonZeroBalanceAssetIds.length > 0 ? ` has non-zero balance for Asset${nonZeroBalanceAssetIds.length > 1 ? "s" : ""} ${nonZeroBalanceAssetIds.join(", ")}` : ""}; can't opt-out.`);
145
- for (const assetId of assetGroup) composer.addAssetOptOut({
146
- ...options,
147
- creator: (await this.getById(BigInt(assetId))).creator,
148
- sender: account,
149
- assetId: BigInt(assetId)
150
- });
151
- const result = await composer.send(options);
152
- Config.getLogger(options?.suppressLog).info(`Successfully opted ${account} out of assets ${assetGroup.join(", ")} with transaction IDs ${result.txIds.join(", ")}\n Grouped under ${result.groupId} in round ${result.confirmations?.[0]?.confirmedRound}.`);
153
- assetGroup.forEach((assetId, index) => {
154
- results.push({
155
- assetId: BigInt(assetId),
156
- transactionId: result.txIds[index]
157
- });
158
- });
159
- }
160
- return results;
161
- }
162
- };
4
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */
5
+ const AssetManager = AssetManager$1;
163
6
 
164
7
  //#endregion
165
8
  export { AssetManager };
@@ -1 +1 @@
1
- {"version":3,"file":"asset-manager.mjs","names":["results: BulkAssetOptInOutResult[]","notOptedInAssetIds: bigint[]","nonZeroBalanceAssetIds: bigint[]"],"sources":["../../src/types/asset-manager.ts"],"sourcesContent":["import { AlgodClient } from '@algorandfoundation/algokit-algod-client'\nimport { Address, MAX_TRANSACTION_GROUP_SIZE } from '@algorandfoundation/algokit-common'\nimport { Config } from '../config'\nimport { chunkArray } from '../util'\nimport { AccountAssetInformation } from './account'\nimport { CommonTransactionParams, TransactionComposer, TransactionComposerConfig } from './composer'\nimport { SendParams } from './transaction'\n\n/** Individual result from performing a bulk opt-in or bulk opt-out for an account against a series of assets. */\nexport interface BulkAssetOptInOutResult {\n /** The ID of the asset opted into / out of */\n assetId: bigint\n /** The transaction ID of the resulting opt in / out */\n transactionId: string\n}\n\n/** Information about an asset. */\nexport interface AssetInformation {\n /** The ID of the asset. */\n assetId: bigint\n\n /** The address of the account that created the asset.\n *\n * This is the address where the parameters for this asset can be found,\n * and also the address where unwanted asset units can be sent when\n * closing out an asset position and opting-out of the asset.\n */\n creator: string\n\n /** The total amount of the smallest divisible (decimal) units that were created of the asset.\n *\n * For example, if `decimals` is, say, 2, then for every 100 `total` there is 1 whole unit.\n */\n total: bigint\n\n /** The amount of decimal places the asset was created with.\n *\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n * * and so on up to 19 decimal places.\n */\n decimals: number\n\n /** Whether the asset was frozen by default for all accounts.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account.\n */\n defaultFrozen?: boolean\n\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * If not set the asset is permanently immutable.\n */\n manager?: string\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set the field is permanently empty.\n */\n reserve?: string\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set the field is permanently empty.\n */\n freeze?: string\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * The clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set the field is permanently empty.\n */\n clawback?: string\n\n /** The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n */\n unitName?: string\n\n /** The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n */\n unitNameAsBytes?: Uint8Array\n\n /** The optional name of the asset.\n *\n * Max size is 32 bytes.\n */\n assetName?: string\n\n /** The optional name of the asset.\n *\n * Max size is 32 bytes.\n */\n assetNameAsBytes?: Uint8Array\n\n /** Optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n */\n url?: string\n\n /** Optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n */\n urlAsBytes?: Uint8Array\n\n /** 32-byte hash of some metadata that is relevant to the asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n */\n metadataHash?: Uint8Array\n}\n\n/** Allows management of asset information. */\nexport class AssetManager {\n private _algod: AlgodClient\n private _newGroup: () => TransactionComposer\n\n /**\n * Create a new asset manager.\n * @param algod An algod client\n * @param newGroup A function that creates a new `TransactionComposer` transaction group\n * @example Create a new asset manager\n * ```typescript\n * const assetManager = new AssetManager(algod, () => new TransactionComposer({algod, () => signer, () => suggestedParams}))\n * ```\n */\n constructor(algod: AlgodClient, newGroup: (config?: TransactionComposerConfig) => TransactionComposer) {\n this._algod = algod\n this._newGroup = newGroup\n }\n\n /**\n * Returns the current asset information for the asset with the given ID.\n *\n * @example\n * ```typescript\n * const assetInfo = await assetManager.getById(12353n);\n * ```\n *\n * @param assetId The ID of the asset\n * @returns The asset information\n */\n public async getById(assetId: bigint): Promise<AssetInformation> {\n const asset = await this._algod.assetById(assetId)\n\n return {\n assetId: BigInt(asset.id),\n total: BigInt(asset.params.total),\n decimals: Number(asset.params.decimals),\n assetName: asset.params.name,\n assetNameAsBytes: asset.params.nameB64,\n unitName: asset.params.unitName,\n unitNameAsBytes: asset.params.unitNameB64,\n url: asset.params.url,\n urlAsBytes: asset.params.urlB64,\n creator: asset.params.creator,\n manager: asset.params.manager,\n clawback: asset.params.clawback,\n freeze: asset.params.freeze,\n reserve: asset.params.reserve,\n defaultFrozen: asset.params.defaultFrozen,\n metadataHash: asset.params.metadataHash,\n }\n }\n\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 = 123345n;\n * const accountInfo = await assetManager.getAccountInformation(address, assetId);\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 * @returns The account asset holding information\n */\n public async getAccountInformation(sender: string | Address, assetId: bigint): Promise<AccountAssetInformation> {\n const info = await this._algod.accountAssetInformation(sender.toString(), assetId)\n\n return {\n assetId: BigInt(assetId),\n balance: BigInt(info.assetHolding?.amount ?? 0),\n frozen: info.assetHolding?.isFrozen === true,\n round: BigInt(info['round']),\n }\n }\n\n /**\n * Opt an account in to a list of Algorand Standard Assets.\n *\n * Transactions will be sent in batches of 16 as transaction groups.\n *\n * @param account The account to opt-in\n * @param assetIds The list of asset IDs to opt-in to\n * @param options Any parameters to control the transaction or execution of the transaction\n * @example Example using AlgorandClient\n * ```typescript\n * // Basic example\n * assetManager.bulkOptIn(\"ACCOUNTADDRESS\", [12345n, 67890n])\n * // With configuration\n * assetManager.bulkOptIn(\"ACCOUNTADDRESS\", [12345n, 67890n], { maxFee: (1000).microAlgo(), suppressLog: true })\n * ```\n * @returns An array of records matching asset ID to transaction ID of the opt in\n */\n async bulkOptIn(\n account: string | Address,\n assetIds: bigint[],\n options?: Omit<CommonTransactionParams, 'sender'> & SendParams,\n ): Promise<BulkAssetOptInOutResult[]> {\n const results: BulkAssetOptInOutResult[] = []\n\n for (const assetGroup of chunkArray(assetIds, MAX_TRANSACTION_GROUP_SIZE)) {\n const composer = this._newGroup()\n\n for (const assetId of assetGroup) {\n composer.addAssetOptIn({\n ...options,\n sender: account,\n assetId: BigInt(assetId),\n })\n }\n\n const result = await composer.send(options)\n\n Config.getLogger(options?.suppressLog).info(\n `Successfully opted in ${account} for assets ${assetGroup.join(', ')} with transaction IDs ${result.txIds.join(', ')}` +\n `\\n Grouped under ${result.groupId} in round ${result.confirmations?.[0]?.confirmedRound}.`,\n )\n\n assetGroup.forEach((assetId, index) => {\n results.push({ assetId: BigInt(assetId), transactionId: result.txIds[index] })\n })\n }\n\n return results\n }\n\n /**\n * Opt an account out of a list of Algorand Standard Assets.\n *\n * Transactions will be sent in batches of 16 as transaction groups.\n *\n * @param account The account to opt-in\n * @param assetIds The list of asset IDs to opt-out of\n * @param options Any parameters to control the transaction or execution of the transaction\n * @example Example using AlgorandClient\n * ```typescript\n * // Basic example\n * assetManager.bulkOptOut(\"ACCOUNTADDRESS\", [12345n, 67890n])\n * // With configuration\n * assetManager.bulkOptOut(\"ACCOUNTADDRESS\", [12345n, 67890n], { ensureZeroBalance: true, maxFee: (1000).microAlgo(), suppressLog: true })\n * ```\n * @returns An array of records matching asset ID to transaction ID of the opt in\n */\n async bulkOptOut(\n account: string | Address,\n assetIds: bigint[],\n options?: Omit<CommonTransactionParams, 'sender'> &\n SendParams & {\n /** Whether or not to check if the account has a zero balance for each asset first or not.\n *\n * Defaults to `true`.\n *\n * If this is set to `true` and the account has an asset balance it will throw an error.\n *\n * If this is set to `false` and the account has an asset balance it will lose those assets to the asset creator.\n */\n ensureZeroBalance?: boolean\n },\n ): Promise<BulkAssetOptInOutResult[]> {\n const results: BulkAssetOptInOutResult[] = []\n\n for (const assetGroup of chunkArray(assetIds, MAX_TRANSACTION_GROUP_SIZE)) {\n const composer = this._newGroup()\n\n const notOptedInAssetIds: bigint[] = []\n const nonZeroBalanceAssetIds: bigint[] = []\n for (const assetId of assetGroup) {\n if (options?.ensureZeroBalance !== false) {\n try {\n const accountAssetInfo = await this.getAccountInformation(account, assetId)\n if (accountAssetInfo.balance !== 0n) {\n nonZeroBalanceAssetIds.push(BigInt(assetId))\n }\n } catch {\n notOptedInAssetIds.push(BigInt(assetId))\n }\n }\n }\n\n if (notOptedInAssetIds.length > 0 || nonZeroBalanceAssetIds.length > 0) {\n throw new Error(\n `Account ${account}${notOptedInAssetIds.length > 0 ? ` is not opted-in to Asset${notOptedInAssetIds.length > 1 ? 's' : ''} ${notOptedInAssetIds.join(', ')}` : ''}${\n nonZeroBalanceAssetIds.length > 0\n ? ` has non-zero balance for Asset${nonZeroBalanceAssetIds.length > 1 ? 's' : ''} ${nonZeroBalanceAssetIds.join(', ')}`\n : ''\n }; can't opt-out.`,\n )\n }\n\n for (const assetId of assetGroup) {\n composer.addAssetOptOut({\n ...options,\n creator: (await this.getById(BigInt(assetId))).creator,\n sender: account,\n assetId: BigInt(assetId),\n })\n }\n\n const result = await composer.send(options)\n\n Config.getLogger(options?.suppressLog).info(\n `Successfully opted ${account} out of assets ${assetGroup.join(', ')} with transaction IDs ${result.txIds.join(', ')}` +\n `\\n Grouped under ${result.groupId} in round ${result.confirmations?.[0]?.confirmedRound}.`,\n )\n\n assetGroup.forEach((assetId, index) => {\n results.push({ assetId: BigInt(assetId), transactionId: result.txIds[index] })\n })\n }\n\n return results\n }\n}\n"],"mappings":";;;;;;AA0IA,IAAa,eAAb,MAA0B;CACxB,AAAQ;CACR,AAAQ;;;;;;;;;;CAWR,YAAY,OAAoB,UAAuE;AACrG,OAAK,SAAS;AACd,OAAK,YAAY;;;;;;;;;;;;;CAcnB,MAAa,QAAQ,SAA4C;EAC/D,MAAM,QAAQ,MAAM,KAAK,OAAO,UAAU,QAAQ;AAElD,SAAO;GACL,SAAS,OAAO,MAAM,GAAG;GACzB,OAAO,OAAO,MAAM,OAAO,MAA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e,OAAO,MAAM;KAAQ,CAAC;KAC9E;;AAGJ,SAAO"}
1
+ {"version":3,"file":"asset-manager.mjs","names":["_AssetManager"],"sources":["../../src/types/asset-manager.ts"],"sourcesContent":["// Re-exports with deprecation notices for backwards compatibility\n// New imports should use '@algorandfoundation/algokit-utils/asset-manager'\n\nimport {\n type BulkAssetOptInOutResult as _BulkAssetOptInOutResult,\n type AssetInformation as _AssetInformation,\n AssetManager as _AssetManager,\n} from '../asset-manager'\n\n/** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */\nexport type BulkAssetOptInOutResult = _BulkAssetOptInOutResult\n\n/** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */\nexport type AssetInformation = _AssetInformation\n\n/** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */\nexport const AssetManager = _AssetManager\n/** @deprecated Import from `@algorandfoundation/algokit-utils/asset-manager` instead */\nexport type AssetManager = _AssetManager\n"],"mappings":";;;;AAgBA,MAAa,eAAeA"}
@@ -1,16 +1,12 @@
1
- import { EventDataMap, EventType } from "./lifecycle-events.js";
1
+ import { AsyncEventEmitter as AsyncEventEmitter$1, AsyncEventListener as AsyncEventListener$1 } from "../async-event-emitter.js";
2
2
 
3
3
  //#region src/types/async-event-emitter.d.ts
4
- type AsyncEventListener<T = unknown> = (event: T, eventName: string | symbol) => Promise<void> | void;
5
- declare class AsyncEventEmitter {
6
- private listenerWrapperMap;
7
- private listenerMap;
8
- emitAsync<K extends string | symbol>(eventName: K, event: K extends EventType ? EventDataMap[K] : unknown): Promise<void>;
9
- on<K extends string | symbol>(eventName: K, listener: AsyncEventListener<K extends EventType ? EventDataMap[K] : unknown>): AsyncEventEmitter;
10
- once<K extends string | symbol>(eventName: K, listener: AsyncEventListener<K extends EventType ? EventDataMap[K] : unknown>): AsyncEventEmitter;
11
- removeListener(eventName: string | symbol, listener: AsyncEventListener): AsyncEventEmitter;
12
- off: (eventName: string | symbol, listener: AsyncEventListener) => AsyncEventEmitter;
13
- }
4
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */
5
+ type AsyncEventListener<T = unknown> = AsyncEventListener$1<T>;
6
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */
7
+ declare const AsyncEventEmitter: typeof AsyncEventEmitter$1;
8
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/async-event-emitter` instead */
9
+ type AsyncEventEmitter = AsyncEventEmitter$1;
14
10
  //#endregion
15
11
  export { AsyncEventEmitter, AsyncEventListener };
16
12
  //# sourceMappingURL=async-event-emitter.d.ts.map