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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
package/types/account.js CHANGED
@@ -1,94 +1,97 @@
1
- 'use strict';
2
-
3
- var algosdk = require('algosdk');
4
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../_virtual/_rolldown/runtime.js");
3
+ let algosdk = require("algosdk");
4
+ algosdk = require_runtime.__toESM(algosdk);
5
+ //#region src/types/account.ts
5
6
  /**
6
- * The account name identifier used for fund dispensing in test environments
7
- */
8
- const DISPENSER_ACCOUNT = 'DISPENSER';
7
+ * The account name identifier used for fund dispensing in test environments
8
+ */
9
+ const DISPENSER_ACCOUNT = "DISPENSER";
9
10
  /** Account wrapper that supports partial or full multisig signing. */
10
- class MultisigAccount {
11
- /** The parameters for the multisig account */
12
- get params() {
13
- return this._params;
14
- }
15
- /** The list of accounts that are present to sign */
16
- get signingAccounts() {
17
- return this._signingAccounts;
18
- }
19
- /** The address of the multisig account */
20
- get addr() {
21
- return this._addr;
22
- }
23
- /** The transaction signer for the multisig account */
24
- get signer() {
25
- return this._signer;
26
- }
27
- constructor(multisigParams, signingAccounts) {
28
- this._params = multisigParams;
29
- this._signingAccounts = signingAccounts;
30
- this._addr = algosdk.multisigAddress(multisigParams);
31
- this._signer = algosdk.makeMultiSigAccountTransactionSigner(multisigParams, signingAccounts.map((a) => a.sk));
32
- }
33
- /**
34
- * Sign the given transaction
35
- * @param transaction Either a transaction object or a raw, partially signed transaction
36
- * @returns The transaction signed by the present signers
37
- * @example
38
- * ```typescript
39
- * const signedTxn = multisigAccount.sign(myTransaction)
40
- * ```
41
- */
42
- sign(transaction) {
43
- let signedTxn = 'sender' in transaction ? undefined : transaction;
44
- for (const signer of this._signingAccounts) {
45
- if (signedTxn) {
46
- signedTxn = algosdk.appendSignMultisigTransaction(signedTxn, this._params, signer.sk).blob;
47
- }
48
- else {
49
- signedTxn = algosdk.signMultisigTransaction(transaction, this._params, signer.sk).blob;
50
- }
51
- }
52
- return signedTxn;
53
- }
54
- }
11
+ var MultisigAccount = class {
12
+ _params;
13
+ _signingAccounts;
14
+ _addr;
15
+ _signer;
16
+ /** The parameters for the multisig account */
17
+ get params() {
18
+ return this._params;
19
+ }
20
+ /** The list of accounts that are present to sign */
21
+ get signingAccounts() {
22
+ return this._signingAccounts;
23
+ }
24
+ /** The address of the multisig account */
25
+ get addr() {
26
+ return this._addr;
27
+ }
28
+ /** The transaction signer for the multisig account */
29
+ get signer() {
30
+ return this._signer;
31
+ }
32
+ constructor(multisigParams, signingAccounts) {
33
+ this._params = multisigParams;
34
+ this._signingAccounts = signingAccounts;
35
+ this._addr = algosdk.default.multisigAddress(multisigParams);
36
+ this._signer = algosdk.default.makeMultiSigAccountTransactionSigner(multisigParams, signingAccounts.map((a) => a.sk));
37
+ }
38
+ /**
39
+ * Sign the given transaction
40
+ * @param transaction Either a transaction object or a raw, partially signed transaction
41
+ * @returns The transaction signed by the present signers
42
+ * @example
43
+ * ```typescript
44
+ * const signedTxn = multisigAccount.sign(myTransaction)
45
+ * ```
46
+ */
47
+ sign(transaction) {
48
+ let signedTxn = "sender" in transaction ? void 0 : transaction;
49
+ for (const signer of this._signingAccounts) if (signedTxn) signedTxn = algosdk.default.appendSignMultisigTransaction(signedTxn, this._params, signer.sk).blob;
50
+ else signedTxn = algosdk.default.signMultisigTransaction(transaction, this._params, signer.sk).blob;
51
+ return signedTxn;
52
+ }
53
+ };
55
54
  /** Account wrapper that supports a rekeyed account */
56
- class SigningAccount {
57
- /**
58
- * Algorand address of the sender
59
- */
60
- get addr() {
61
- return this._sender;
62
- }
63
- /**
64
- * Secret key belonging to the signer
65
- */
66
- get sk() {
67
- return this._account.sk;
68
- }
69
- /**
70
- * Transaction signer for the underlying signing account
71
- */
72
- get signer() {
73
- return this._signer;
74
- }
75
- /**
76
- * Algorand account of the sender address and signer private key
77
- */
78
- get sender() {
79
- return {
80
- addr: this._sender,
81
- sk: this._account.sk,
82
- };
83
- }
84
- constructor(account, sender) {
85
- this._account = account;
86
- this._sender = typeof sender === 'string' ? algosdk.Address.fromString(sender) : (sender ?? account.addr);
87
- this._signer = algosdk.makeBasicAccountTransactionSigner(account);
88
- }
89
- }
90
-
55
+ var SigningAccount = class {
56
+ _account;
57
+ _signer;
58
+ _sender;
59
+ /**
60
+ * Algorand address of the sender
61
+ */
62
+ get addr() {
63
+ return this._sender;
64
+ }
65
+ /**
66
+ * Secret key belonging to the signer
67
+ */
68
+ get sk() {
69
+ return this._account.sk;
70
+ }
71
+ /**
72
+ * Transaction signer for the underlying signing account
73
+ */
74
+ get signer() {
75
+ return this._signer;
76
+ }
77
+ /**
78
+ * Algorand account of the sender address and signer private key
79
+ */
80
+ get sender() {
81
+ return {
82
+ addr: this._sender,
83
+ sk: this._account.sk
84
+ };
85
+ }
86
+ constructor(account, sender) {
87
+ this._account = account;
88
+ this._sender = typeof sender === "string" ? algosdk.Address.fromString(sender) : sender ?? account.addr;
89
+ this._signer = algosdk.default.makeBasicAccountTransactionSigner(account);
90
+ }
91
+ };
92
+ //#endregion
91
93
  exports.DISPENSER_ACCOUNT = DISPENSER_ACCOUNT;
92
94
  exports.MultisigAccount = MultisigAccount;
93
95
  exports.SigningAccount = SigningAccount;
94
- //# sourceMappingURL=account.js.map
96
+
97
+ //# sourceMappingURL=account.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sources":["../../src/types/account.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { AlgoAmount } from './amount'\nimport ApplicationLocalState = algosdk.modelsv2.ApplicationLocalState\nimport ApplicationStateSchema = algosdk.modelsv2.ApplicationStateSchema\nimport AssetHolding = algosdk.modelsv2.AssetHolding\nimport Application = algosdk.modelsv2.Application\nimport Asset = algosdk.modelsv2.Asset\nimport AccountParticipation = algosdk.modelsv2.AccountParticipation\nimport Account = algosdk.Account\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport Transaction = algosdk.Transaction\nimport TransactionSigner = algosdk.TransactionSigner\n\n/**\n * The account name identifier used for fund dispensing in test environments\n */\nexport const DISPENSER_ACCOUNT = 'DISPENSER'\n\n/** Account wrapper that supports partial or full multisig signing. */\nexport class MultisigAccount {\n _params: algosdk.MultisigMetadata\n _signingAccounts: (algosdk.Account | SigningAccount)[]\n _addr: Address\n _signer: TransactionSigner\n\n /** The parameters for the multisig account */\n get params(): Readonly<algosdk.MultisigMetadata> {\n return this._params\n }\n\n /** The list of accounts that are present to sign */\n get signingAccounts(): Readonly<(algosdk.Account | SigningAccount)[]> {\n return this._signingAccounts\n }\n\n /** The address of the multisig account */\n get addr(): Readonly<Address> {\n return this._addr\n }\n\n /** The transaction signer for the multisig account */\n get signer(): TransactionSigner {\n return this._signer\n }\n\n constructor(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n this._params = multisigParams\n this._signingAccounts = signingAccounts\n this._addr = algosdk.multisigAddress(multisigParams)\n this._signer = algosdk.makeMultiSigAccountTransactionSigner(\n multisigParams,\n signingAccounts.map((a) => a.sk),\n )\n }\n\n /**\n * Sign the given transaction\n * @param transaction Either a transaction object or a raw, partially signed transaction\n * @returns The transaction signed by the present signers\n * @example\n * ```typescript\n * const signedTxn = multisigAccount.sign(myTransaction)\n * ```\n */\n public sign(transaction: Transaction | Uint8Array): Uint8Array {\n let signedTxn = 'sender' in transaction ? undefined : transaction\n for (const signer of this._signingAccounts) {\n if (signedTxn) {\n signedTxn = algosdk.appendSignMultisigTransaction(signedTxn, this._params, signer.sk).blob\n } else {\n signedTxn = algosdk.signMultisigTransaction(transaction as Transaction, this._params, signer.sk).blob\n }\n }\n return signedTxn!\n }\n}\n\n/** Account wrapper that supports a rekeyed account */\nexport class SigningAccount implements Account {\n private _account: Account\n private _signer: TransactionSigner\n private _sender: Address\n\n /**\n * Algorand address of the sender\n */\n get addr(): Readonly<Address> {\n return this._sender\n }\n\n /**\n * Secret key belonging to the signer\n */\n get sk(): Readonly<Uint8Array> {\n return this._account.sk\n }\n\n /**\n * Transaction signer for the underlying signing account\n */\n get signer(): TransactionSigner {\n return this._signer\n }\n\n /**\n * Algorand account of the sender address and signer private key\n */\n get sender(): Account {\n return {\n addr: this._sender,\n sk: this._account.sk,\n }\n }\n\n constructor(account: Account, sender: string | Address | undefined) {\n this._account = account\n this._sender = typeof sender === 'string' ? Address.fromString(sender) : (sender ?? account.addr)\n this._signer = algosdk.makeBasicAccountTransactionSigner(account)\n }\n}\n\n/** A wrapper around `TransactionSigner` that also has the sender address. */\nexport interface TransactionSignerAccount {\n addr: Readonly<Address>\n signer: TransactionSigner\n}\n\n/** Account information at a given round. */\nexport type AccountInformation = {\n /**\n * The account public key\n */\n address: Address\n\n /** The balance of Algo currently held by the account. */\n balance: AlgoAmount\n\n /**\n * The amount of Algo in the account, without the pending rewards.\n */\n amountWithoutPendingRewards: AlgoAmount\n\n /**\n * Algo balance required to be held by the account.\n *\n * The requirement grows based on asset and application usage.\n */\n minBalance: AlgoAmount\n /**\n * Amount of Algo of pending rewards in this account.\n */\n pendingRewards: AlgoAmount\n\n /**\n * Total rewards of Algo the account has received, including pending\n * rewards.\n */\n rewards: AlgoAmount\n\n /**\n * The round number for which this information is relevant.\n */\n validAsOfRound: bigint\n\n /**\n * Delegation status of the account's Algo:\n * * Offline - indicates that the associated account is delegated.\n * * Online - indicates that the associated account used as part of the delegation pool.\n * * NotParticipating - indicates that the associated account is neither a delegator nor a delegate.\n */\n status: string\n\n /**\n * The count of all applications that have been opted in, equivalent to the count\n * of application local data (AppLocalState objects) stored in this account.\n */\n totalAppsOptedIn: number\n\n /**\n * The count of all assets that have been opted in, equivalent to the count of\n * AssetHolding objects held by this account.\n */\n totalAssetsOptedIn: number\n\n /**\n * The count of all apps (AppParams objects) created by this account.\n */\n totalCreatedApps: number\n\n /**\n * The count of all assets (AssetParams objects) created by this account.\n */\n totalCreatedAssets: number\n\n /**\n * Applications local data stored in this account.\n */\n appsLocalState?: ApplicationLocalState[]\n\n /**\n * The sum of all extra application program pages for this account.\n */\n appsTotalExtraPages?: number\n /**\n * (tsch) stores the sum of all of the local schemas and global schemas in this\n * account.\n * Note: the raw account uses `StateSchema` for this type.\n */\n appsTotalSchema?: ApplicationStateSchema\n\n /**\n * Assets held by this account.\n */\n assets?: AssetHolding[]\n\n /**\n * The address against which signing should be checked. If empty, the\n * address of the current account is used. This field can be updated in any\n * transaction by setting the `RekeyTo` field.\n */\n authAddr?: Address\n\n /**\n * Parameters of applications created by this account including app global data.\n */\n createdApps?: Application[]\n\n /**\n * (apar) parameters of assets created by this account.\n * Note: the raw account uses `map[int] -> Asset` for this type.\n */\n createdAssets?: Asset[]\n\n /**\n * AccountParticipation describes the parameters used by this account in consensus\n * protocol.\n */\n participation?: AccountParticipation\n\n /**\n * Used as part of the rewards computation. Only applicable to accounts\n * which are participating.\n */\n rewardBase?: number\n\n /**\n * Indicates what type of signature is used by this account, must be one of:\n * * sig\n * * msig\n * * lsig\n */\n sigType?: string\n\n /**\n * The total number of bytes used by this account's app's box keys and\n * values.\n */\n totalBoxBytes?: number\n\n /**\n * The number of existing boxes created by this account's app.\n */\n totalBoxes?: number\n\n /**\n * The round in which this account last went online, or explicitly renewed their\n * online status.\n */\n lastHeartbeatRound?: bigint\n\n /**\n * The round in which this account last proposed the block.\n */\n lastProposedRound?: bigint\n}\n\n/** Account asset holding information at a given round. */\nexport type AccountAssetInformation = {\n /** The ID of the asset held. */\n assetId: bigint\n /** The current balance of that asset holding. */\n balance: bigint\n /** Whether or not the asset is frozen for the account. */\n frozen: boolean\n /** The round as at which the holding was correct. */\n round: bigint\n}\n\n/**\n * @deprecated The methods that use this can be achieved using `AccountManager` instead.\n * Config for an account config */\nexport interface AccountConfig {\n /** Mnemonic for an account */\n accountMnemonic: string\n /** Address of a rekeyed account */\n senderAddress?: string\n /** Account name used to retrieve config */\n accountName: string\n\n /** @deprecated Renamed to senderAddress in 2.3.1 */\n senderMnemonic?: string\n}\n"],"names":["Address"],"mappings":";;;;AAaA;;AAEG;AACI,MAAM,iBAAiB,GAAG;AAEjC;MACa,eAAe,CAAA;;AAO1B,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;;;AAIrB,IAAA,IAAI,eAAe,GAAA;QACjB,OAAO,IAAI,CAAC,gBAAgB;;;AAI9B,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,KAAK;;;AAInB,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;;IAGrB,WAAY,CAAA,cAAgC,EAAE,eAA6C,EAAA;AACzF,QAAA,IAAI,CAAC,OAAO,GAAG,cAAc;AAC7B,QAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe;QACvC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,oCAAoC,CACzD,cAAc,EACd,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CACjC;;AAGH;;;;;;;;AAQG;AACI,IAAA,IAAI,CAAC,WAAqC,EAAA;AAC/C,QAAA,IAAI,SAAS,GAAG,QAAQ,IAAI,WAAW,GAAG,SAAS,GAAG,WAAW;AACjE,QAAA,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,gBAAgB,EAAE;YAC1C,IAAI,SAAS,EAAE;AACb,gBAAA,SAAS,GAAG,OAAO,CAAC,6BAA6B,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI;;iBACrF;AACL,gBAAA,SAAS,GAAG,OAAO,CAAC,uBAAuB,CAAC,WAA0B,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI;;;AAGzG,QAAA,OAAO,SAAU;;AAEpB;AAED;MACa,cAAc,CAAA;AAKzB;;AAEG;AACH,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,OAAO;;AAGrB;;AAEG;AACH,IAAA,IAAI,EAAE,GAAA;AACJ,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE;;AAGzB;;AAEG;AACH,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;;AAGrB;;AAEG;AACH,IAAA,IAAI,MAAM,GAAA;QACR,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,OAAO;AAClB,YAAA,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;SACrB;;IAGH,WAAY,CAAA,OAAgB,EAAE,MAAoC,EAAA;AAChE,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,MAAM,KAAK,QAAQ,GAAGA,eAAO,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;QACjG,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,iCAAiC,CAAC,OAAO,CAAC;;AAEpE;;;;;;"}
1
+ {"version":3,"file":"account.js","names":["Address"],"sources":["../../src/types/account.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { AlgoAmount } from './amount'\nimport ApplicationLocalState = algosdk.modelsv2.ApplicationLocalState\nimport ApplicationStateSchema = algosdk.modelsv2.ApplicationStateSchema\nimport AssetHolding = algosdk.modelsv2.AssetHolding\nimport Application = algosdk.modelsv2.Application\nimport Asset = algosdk.modelsv2.Asset\nimport AccountParticipation = algosdk.modelsv2.AccountParticipation\nimport Account = algosdk.Account\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport Transaction = algosdk.Transaction\nimport TransactionSigner = algosdk.TransactionSigner\n\n/**\n * The account name identifier used for fund dispensing in test environments\n */\nexport const DISPENSER_ACCOUNT = 'DISPENSER'\n\n/** Account wrapper that supports partial or full multisig signing. */\nexport class MultisigAccount {\n _params: algosdk.MultisigMetadata\n _signingAccounts: (algosdk.Account | SigningAccount)[]\n _addr: Address\n _signer: TransactionSigner\n\n /** The parameters for the multisig account */\n get params(): Readonly<algosdk.MultisigMetadata> {\n return this._params\n }\n\n /** The list of accounts that are present to sign */\n get signingAccounts(): Readonly<(algosdk.Account | SigningAccount)[]> {\n return this._signingAccounts\n }\n\n /** The address of the multisig account */\n get addr(): Readonly<Address> {\n return this._addr\n }\n\n /** The transaction signer for the multisig account */\n get signer(): TransactionSigner {\n return this._signer\n }\n\n constructor(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n this._params = multisigParams\n this._signingAccounts = signingAccounts\n this._addr = algosdk.multisigAddress(multisigParams)\n this._signer = algosdk.makeMultiSigAccountTransactionSigner(\n multisigParams,\n signingAccounts.map((a) => a.sk),\n )\n }\n\n /**\n * Sign the given transaction\n * @param transaction Either a transaction object or a raw, partially signed transaction\n * @returns The transaction signed by the present signers\n * @example\n * ```typescript\n * const signedTxn = multisigAccount.sign(myTransaction)\n * ```\n */\n public sign(transaction: Transaction | Uint8Array): Uint8Array {\n let signedTxn = 'sender' in transaction ? undefined : transaction\n for (const signer of this._signingAccounts) {\n if (signedTxn) {\n signedTxn = algosdk.appendSignMultisigTransaction(signedTxn, this._params, signer.sk).blob\n } else {\n signedTxn = algosdk.signMultisigTransaction(transaction as Transaction, this._params, signer.sk).blob\n }\n }\n return signedTxn!\n }\n}\n\n/** Account wrapper that supports a rekeyed account */\nexport class SigningAccount implements Account {\n private _account: Account\n private _signer: TransactionSigner\n private _sender: Address\n\n /**\n * Algorand address of the sender\n */\n get addr(): Readonly<Address> {\n return this._sender\n }\n\n /**\n * Secret key belonging to the signer\n */\n get sk(): Readonly<Uint8Array> {\n return this._account.sk\n }\n\n /**\n * Transaction signer for the underlying signing account\n */\n get signer(): TransactionSigner {\n return this._signer\n }\n\n /**\n * Algorand account of the sender address and signer private key\n */\n get sender(): Account {\n return {\n addr: this._sender,\n sk: this._account.sk,\n }\n }\n\n constructor(account: Account, sender: string | Address | undefined) {\n this._account = account\n this._sender = typeof sender === 'string' ? Address.fromString(sender) : (sender ?? account.addr)\n this._signer = algosdk.makeBasicAccountTransactionSigner(account)\n }\n}\n\n/** A wrapper around `TransactionSigner` that also has the sender address. */\nexport interface TransactionSignerAccount {\n addr: Readonly<Address>\n signer: TransactionSigner\n}\n\n/** Account information at a given round. */\nexport type AccountInformation = {\n /**\n * The account public key\n */\n address: Address\n\n /** The balance of Algo currently held by the account. */\n balance: AlgoAmount\n\n /**\n * The amount of Algo in the account, without the pending rewards.\n */\n amountWithoutPendingRewards: AlgoAmount\n\n /**\n * Algo balance required to be held by the account.\n *\n * The requirement grows based on asset and application usage.\n */\n minBalance: AlgoAmount\n /**\n * Amount of Algo of pending rewards in this account.\n */\n pendingRewards: AlgoAmount\n\n /**\n * Total rewards of Algo the account has received, including pending\n * rewards.\n */\n rewards: AlgoAmount\n\n /**\n * The round number for which this information is relevant.\n */\n validAsOfRound: bigint\n\n /**\n * Delegation status of the account's Algo:\n * * Offline - indicates that the associated account is delegated.\n * * Online - indicates that the associated account used as part of the delegation pool.\n * * NotParticipating - indicates that the associated account is neither a delegator nor a delegate.\n */\n status: string\n\n /**\n * The count of all applications that have been opted in, equivalent to the count\n * of application local data (AppLocalState objects) stored in this account.\n */\n totalAppsOptedIn: number\n\n /**\n * The count of all assets that have been opted in, equivalent to the count of\n * AssetHolding objects held by this account.\n */\n totalAssetsOptedIn: number\n\n /**\n * The count of all apps (AppParams objects) created by this account.\n */\n totalCreatedApps: number\n\n /**\n * The count of all assets (AssetParams objects) created by this account.\n */\n totalCreatedAssets: number\n\n /**\n * Applications local data stored in this account.\n */\n appsLocalState?: ApplicationLocalState[]\n\n /**\n * The sum of all extra application program pages for this account.\n */\n appsTotalExtraPages?: number\n /**\n * (tsch) stores the sum of all of the local schemas and global schemas in this\n * account.\n * Note: the raw account uses `StateSchema` for this type.\n */\n appsTotalSchema?: ApplicationStateSchema\n\n /**\n * Assets held by this account.\n */\n assets?: AssetHolding[]\n\n /**\n * The address against which signing should be checked. If empty, the\n * address of the current account is used. This field can be updated in any\n * transaction by setting the `RekeyTo` field.\n */\n authAddr?: Address\n\n /**\n * Parameters of applications created by this account including app global data.\n */\n createdApps?: Application[]\n\n /**\n * (apar) parameters of assets created by this account.\n * Note: the raw account uses `map[int] -> Asset` for this type.\n */\n createdAssets?: Asset[]\n\n /**\n * AccountParticipation describes the parameters used by this account in consensus\n * protocol.\n */\n participation?: AccountParticipation\n\n /**\n * Used as part of the rewards computation. Only applicable to accounts\n * which are participating.\n */\n rewardBase?: number\n\n /**\n * Indicates what type of signature is used by this account, must be one of:\n * * sig\n * * msig\n * * lsig\n */\n sigType?: string\n\n /**\n * The total number of bytes used by this account's app's box keys and\n * values.\n */\n totalBoxBytes?: number\n\n /**\n * The number of existing boxes created by this account's app.\n */\n totalBoxes?: number\n\n /**\n * The round in which this account last went online, or explicitly renewed their\n * online status.\n */\n lastHeartbeatRound?: bigint\n\n /**\n * The round in which this account last proposed the block.\n */\n lastProposedRound?: bigint\n}\n\n/** Account asset holding information at a given round. */\nexport type AccountAssetInformation = {\n /** The ID of the asset held. */\n assetId: bigint\n /** The current balance of that asset holding. */\n balance: bigint\n /** Whether or not the asset is frozen for the account. */\n frozen: boolean\n /** The round as at which the holding was correct. */\n round: bigint\n}\n\n/**\n * @deprecated The methods that use this can be achieved using `AccountManager` instead.\n * Config for an account config */\nexport interface AccountConfig {\n /** Mnemonic for an account */\n accountMnemonic: string\n /** Address of a rekeyed account */\n senderAddress?: string\n /** Account name used to retrieve config */\n accountName: string\n\n /** @deprecated Renamed to senderAddress in 2.3.1 */\n senderMnemonic?: string\n}\n"],"mappings":";;;;;;;;AAgBA,MAAa,oBAAoB;;AAGjC,IAAa,kBAAb,MAA6B;CAC3B;CACA;CACA;CACA;;CAGA,IAAI,SAA6C;EAC/C,OAAO,KAAK;CACd;;CAGA,IAAI,kBAAkE;EACpE,OAAO,KAAK;CACd;;CAGA,IAAI,OAA0B;EAC5B,OAAO,KAAK;CACd;;CAGA,IAAI,SAA4B;EAC9B,OAAO,KAAK;CACd;CAEA,YAAY,gBAAkC,iBAA+C;EAC3F,KAAK,UAAU;EACf,KAAK,mBAAmB;EACxB,KAAK,QAAQ,QAAA,QAAQ,gBAAgB,cAAc;EACnD,KAAK,UAAU,QAAA,QAAQ,qCACrB,gBACA,gBAAgB,KAAK,MAAM,EAAE,EAAE,CACjC;CACF;;;;;;;;;;CAWA,KAAY,aAAmD;EAC7D,IAAI,YAAY,YAAY,cAAc,KAAA,IAAY;EACtD,KAAK,MAAM,UAAU,KAAK,kBACxB,IAAI,WACF,YAAY,QAAA,QAAQ,8BAA8B,WAAW,KAAK,SAAS,OAAO,EAAE,CAAC,CAAC;OAEtF,YAAY,QAAA,QAAQ,wBAAwB,aAA4B,KAAK,SAAS,OAAO,EAAE,CAAC,CAAC;EAGrG,OAAO;CACT;AACF;;AAGA,IAAa,iBAAb,MAA+C;CAC7C;CACA;CACA;;;;CAKA,IAAI,OAA0B;EAC5B,OAAO,KAAK;CACd;;;;CAKA,IAAI,KAA2B;EAC7B,OAAO,KAAK,SAAS;CACvB;;;;CAKA,IAAI,SAA4B;EAC9B,OAAO,KAAK;CACd;;;;CAKA,IAAI,SAAkB;EACpB,OAAO;GACL,MAAM,KAAK;GACX,IAAI,KAAK,SAAS;EACpB;CACF;CAEA,YAAY,SAAkB,QAAsC;EAClE,KAAK,WAAW;EAChB,KAAK,UAAU,OAAO,WAAW,WAAWA,QAAAA,QAAQ,WAAW,MAAM,IAAK,UAAU,QAAQ;EAC5F,KAAK,UAAU,QAAA,QAAQ,kCAAkC,OAAO;CAClE;AACF"}
package/types/account.mjs CHANGED
@@ -1,90 +1,92 @@
1
- import algosdk, { Address } from 'algosdk';
2
-
1
+ import algosdk, { Address } from "algosdk";
2
+ //#region src/types/account.ts
3
3
  /**
4
- * The account name identifier used for fund dispensing in test environments
5
- */
6
- const DISPENSER_ACCOUNT = 'DISPENSER';
4
+ * The account name identifier used for fund dispensing in test environments
5
+ */
6
+ const DISPENSER_ACCOUNT = "DISPENSER";
7
7
  /** Account wrapper that supports partial or full multisig signing. */
8
- class MultisigAccount {
9
- /** The parameters for the multisig account */
10
- get params() {
11
- return this._params;
12
- }
13
- /** The list of accounts that are present to sign */
14
- get signingAccounts() {
15
- return this._signingAccounts;
16
- }
17
- /** The address of the multisig account */
18
- get addr() {
19
- return this._addr;
20
- }
21
- /** The transaction signer for the multisig account */
22
- get signer() {
23
- return this._signer;
24
- }
25
- constructor(multisigParams, signingAccounts) {
26
- this._params = multisigParams;
27
- this._signingAccounts = signingAccounts;
28
- this._addr = algosdk.multisigAddress(multisigParams);
29
- this._signer = algosdk.makeMultiSigAccountTransactionSigner(multisigParams, signingAccounts.map((a) => a.sk));
30
- }
31
- /**
32
- * Sign the given transaction
33
- * @param transaction Either a transaction object or a raw, partially signed transaction
34
- * @returns The transaction signed by the present signers
35
- * @example
36
- * ```typescript
37
- * const signedTxn = multisigAccount.sign(myTransaction)
38
- * ```
39
- */
40
- sign(transaction) {
41
- let signedTxn = 'sender' in transaction ? undefined : transaction;
42
- for (const signer of this._signingAccounts) {
43
- if (signedTxn) {
44
- signedTxn = algosdk.appendSignMultisigTransaction(signedTxn, this._params, signer.sk).blob;
45
- }
46
- else {
47
- signedTxn = algosdk.signMultisigTransaction(transaction, this._params, signer.sk).blob;
48
- }
49
- }
50
- return signedTxn;
51
- }
52
- }
8
+ var MultisigAccount = class {
9
+ _params;
10
+ _signingAccounts;
11
+ _addr;
12
+ _signer;
13
+ /** The parameters for the multisig account */
14
+ get params() {
15
+ return this._params;
16
+ }
17
+ /** The list of accounts that are present to sign */
18
+ get signingAccounts() {
19
+ return this._signingAccounts;
20
+ }
21
+ /** The address of the multisig account */
22
+ get addr() {
23
+ return this._addr;
24
+ }
25
+ /** The transaction signer for the multisig account */
26
+ get signer() {
27
+ return this._signer;
28
+ }
29
+ constructor(multisigParams, signingAccounts) {
30
+ this._params = multisigParams;
31
+ this._signingAccounts = signingAccounts;
32
+ this._addr = algosdk.multisigAddress(multisigParams);
33
+ this._signer = algosdk.makeMultiSigAccountTransactionSigner(multisigParams, signingAccounts.map((a) => a.sk));
34
+ }
35
+ /**
36
+ * Sign the given transaction
37
+ * @param transaction Either a transaction object or a raw, partially signed transaction
38
+ * @returns The transaction signed by the present signers
39
+ * @example
40
+ * ```typescript
41
+ * const signedTxn = multisigAccount.sign(myTransaction)
42
+ * ```
43
+ */
44
+ sign(transaction) {
45
+ let signedTxn = "sender" in transaction ? void 0 : transaction;
46
+ for (const signer of this._signingAccounts) if (signedTxn) signedTxn = algosdk.appendSignMultisigTransaction(signedTxn, this._params, signer.sk).blob;
47
+ else signedTxn = algosdk.signMultisigTransaction(transaction, this._params, signer.sk).blob;
48
+ return signedTxn;
49
+ }
50
+ };
53
51
  /** Account wrapper that supports a rekeyed account */
54
- class SigningAccount {
55
- /**
56
- * Algorand address of the sender
57
- */
58
- get addr() {
59
- return this._sender;
60
- }
61
- /**
62
- * Secret key belonging to the signer
63
- */
64
- get sk() {
65
- return this._account.sk;
66
- }
67
- /**
68
- * Transaction signer for the underlying signing account
69
- */
70
- get signer() {
71
- return this._signer;
72
- }
73
- /**
74
- * Algorand account of the sender address and signer private key
75
- */
76
- get sender() {
77
- return {
78
- addr: this._sender,
79
- sk: this._account.sk,
80
- };
81
- }
82
- constructor(account, sender) {
83
- this._account = account;
84
- this._sender = typeof sender === 'string' ? Address.fromString(sender) : (sender ?? account.addr);
85
- this._signer = algosdk.makeBasicAccountTransactionSigner(account);
86
- }
87
- }
88
-
52
+ var SigningAccount = class {
53
+ _account;
54
+ _signer;
55
+ _sender;
56
+ /**
57
+ * Algorand address of the sender
58
+ */
59
+ get addr() {
60
+ return this._sender;
61
+ }
62
+ /**
63
+ * Secret key belonging to the signer
64
+ */
65
+ get sk() {
66
+ return this._account.sk;
67
+ }
68
+ /**
69
+ * Transaction signer for the underlying signing account
70
+ */
71
+ get signer() {
72
+ return this._signer;
73
+ }
74
+ /**
75
+ * Algorand account of the sender address and signer private key
76
+ */
77
+ get sender() {
78
+ return {
79
+ addr: this._sender,
80
+ sk: this._account.sk
81
+ };
82
+ }
83
+ constructor(account, sender) {
84
+ this._account = account;
85
+ this._sender = typeof sender === "string" ? Address.fromString(sender) : sender ?? account.addr;
86
+ this._signer = algosdk.makeBasicAccountTransactionSigner(account);
87
+ }
88
+ };
89
+ //#endregion
89
90
  export { DISPENSER_ACCOUNT, MultisigAccount, SigningAccount };
90
- //# sourceMappingURL=account.mjs.map
91
+
92
+ //# sourceMappingURL=account.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"account.mjs","sources":["../../src/types/account.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { AlgoAmount } from './amount'\nimport ApplicationLocalState = algosdk.modelsv2.ApplicationLocalState\nimport ApplicationStateSchema = algosdk.modelsv2.ApplicationStateSchema\nimport AssetHolding = algosdk.modelsv2.AssetHolding\nimport Application = algosdk.modelsv2.Application\nimport Asset = algosdk.modelsv2.Asset\nimport AccountParticipation = algosdk.modelsv2.AccountParticipation\nimport Account = algosdk.Account\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport Transaction = algosdk.Transaction\nimport TransactionSigner = algosdk.TransactionSigner\n\n/**\n * The account name identifier used for fund dispensing in test environments\n */\nexport const DISPENSER_ACCOUNT = 'DISPENSER'\n\n/** Account wrapper that supports partial or full multisig signing. */\nexport class MultisigAccount {\n _params: algosdk.MultisigMetadata\n _signingAccounts: (algosdk.Account | SigningAccount)[]\n _addr: Address\n _signer: TransactionSigner\n\n /** The parameters for the multisig account */\n get params(): Readonly<algosdk.MultisigMetadata> {\n return this._params\n }\n\n /** The list of accounts that are present to sign */\n get signingAccounts(): Readonly<(algosdk.Account | SigningAccount)[]> {\n return this._signingAccounts\n }\n\n /** The address of the multisig account */\n get addr(): Readonly<Address> {\n return this._addr\n }\n\n /** The transaction signer for the multisig account */\n get signer(): TransactionSigner {\n return this._signer\n }\n\n constructor(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n this._params = multisigParams\n this._signingAccounts = signingAccounts\n this._addr = algosdk.multisigAddress(multisigParams)\n this._signer = algosdk.makeMultiSigAccountTransactionSigner(\n multisigParams,\n signingAccounts.map((a) => a.sk),\n )\n }\n\n /**\n * Sign the given transaction\n * @param transaction Either a transaction object or a raw, partially signed transaction\n * @returns The transaction signed by the present signers\n * @example\n * ```typescript\n * const signedTxn = multisigAccount.sign(myTransaction)\n * ```\n */\n public sign(transaction: Transaction | Uint8Array): Uint8Array {\n let signedTxn = 'sender' in transaction ? undefined : transaction\n for (const signer of this._signingAccounts) {\n if (signedTxn) {\n signedTxn = algosdk.appendSignMultisigTransaction(signedTxn, this._params, signer.sk).blob\n } else {\n signedTxn = algosdk.signMultisigTransaction(transaction as Transaction, this._params, signer.sk).blob\n }\n }\n return signedTxn!\n }\n}\n\n/** Account wrapper that supports a rekeyed account */\nexport class SigningAccount implements Account {\n private _account: Account\n private _signer: TransactionSigner\n private _sender: Address\n\n /**\n * Algorand address of the sender\n */\n get addr(): Readonly<Address> {\n return this._sender\n }\n\n /**\n * Secret key belonging to the signer\n */\n get sk(): Readonly<Uint8Array> {\n return this._account.sk\n }\n\n /**\n * Transaction signer for the underlying signing account\n */\n get signer(): TransactionSigner {\n return this._signer\n }\n\n /**\n * Algorand account of the sender address and signer private key\n */\n get sender(): Account {\n return {\n addr: this._sender,\n sk: this._account.sk,\n }\n }\n\n constructor(account: Account, sender: string | Address | undefined) {\n this._account = account\n this._sender = typeof sender === 'string' ? Address.fromString(sender) : (sender ?? account.addr)\n this._signer = algosdk.makeBasicAccountTransactionSigner(account)\n }\n}\n\n/** A wrapper around `TransactionSigner` that also has the sender address. */\nexport interface TransactionSignerAccount {\n addr: Readonly<Address>\n signer: TransactionSigner\n}\n\n/** Account information at a given round. */\nexport type AccountInformation = {\n /**\n * The account public key\n */\n address: Address\n\n /** The balance of Algo currently held by the account. */\n balance: AlgoAmount\n\n /**\n * The amount of Algo in the account, without the pending rewards.\n */\n amountWithoutPendingRewards: AlgoAmount\n\n /**\n * Algo balance required to be held by the account.\n *\n * The requirement grows based on asset and application usage.\n */\n minBalance: AlgoAmount\n /**\n * Amount of Algo of pending rewards in this account.\n */\n pendingRewards: AlgoAmount\n\n /**\n * Total rewards of Algo the account has received, including pending\n * rewards.\n */\n rewards: AlgoAmount\n\n /**\n * The round number for which this information is relevant.\n */\n validAsOfRound: bigint\n\n /**\n * Delegation status of the account's Algo:\n * * Offline - indicates that the associated account is delegated.\n * * Online - indicates that the associated account used as part of the delegation pool.\n * * NotParticipating - indicates that the associated account is neither a delegator nor a delegate.\n */\n status: string\n\n /**\n * The count of all applications that have been opted in, equivalent to the count\n * of application local data (AppLocalState objects) stored in this account.\n */\n totalAppsOptedIn: number\n\n /**\n * The count of all assets that have been opted in, equivalent to the count of\n * AssetHolding objects held by this account.\n */\n totalAssetsOptedIn: number\n\n /**\n * The count of all apps (AppParams objects) created by this account.\n */\n totalCreatedApps: number\n\n /**\n * The count of all assets (AssetParams objects) created by this account.\n */\n totalCreatedAssets: number\n\n /**\n * Applications local data stored in this account.\n */\n appsLocalState?: ApplicationLocalState[]\n\n /**\n * The sum of all extra application program pages for this account.\n */\n appsTotalExtraPages?: number\n /**\n * (tsch) stores the sum of all of the local schemas and global schemas in this\n * account.\n * Note: the raw account uses `StateSchema` for this type.\n */\n appsTotalSchema?: ApplicationStateSchema\n\n /**\n * Assets held by this account.\n */\n assets?: AssetHolding[]\n\n /**\n * The address against which signing should be checked. If empty, the\n * address of the current account is used. This field can be updated in any\n * transaction by setting the `RekeyTo` field.\n */\n authAddr?: Address\n\n /**\n * Parameters of applications created by this account including app global data.\n */\n createdApps?: Application[]\n\n /**\n * (apar) parameters of assets created by this account.\n * Note: the raw account uses `map[int] -> Asset` for this type.\n */\n createdAssets?: Asset[]\n\n /**\n * AccountParticipation describes the parameters used by this account in consensus\n * protocol.\n */\n participation?: AccountParticipation\n\n /**\n * Used as part of the rewards computation. Only applicable to accounts\n * which are participating.\n */\n rewardBase?: number\n\n /**\n * Indicates what type of signature is used by this account, must be one of:\n * * sig\n * * msig\n * * lsig\n */\n sigType?: string\n\n /**\n * The total number of bytes used by this account's app's box keys and\n * values.\n */\n totalBoxBytes?: number\n\n /**\n * The number of existing boxes created by this account's app.\n */\n totalBoxes?: number\n\n /**\n * The round in which this account last went online, or explicitly renewed their\n * online status.\n */\n lastHeartbeatRound?: bigint\n\n /**\n * The round in which this account last proposed the block.\n */\n lastProposedRound?: bigint\n}\n\n/** Account asset holding information at a given round. */\nexport type AccountAssetInformation = {\n /** The ID of the asset held. */\n assetId: bigint\n /** The current balance of that asset holding. */\n balance: bigint\n /** Whether or not the asset is frozen for the account. */\n frozen: boolean\n /** The round as at which the holding was correct. */\n round: bigint\n}\n\n/**\n * @deprecated The methods that use this can be achieved using `AccountManager` instead.\n * Config for an account config */\nexport interface AccountConfig {\n /** Mnemonic for an account */\n accountMnemonic: string\n /** Address of a rekeyed account */\n senderAddress?: string\n /** Account name used to retrieve config */\n accountName: string\n\n /** @deprecated Renamed to senderAddress in 2.3.1 */\n senderMnemonic?: string\n}\n"],"names":[],"mappings":";;AAaA;;AAEG;AACI,MAAM,iBAAiB,GAAG;AAEjC;MACa,eAAe,CAAA;;AAO1B,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;;;AAIrB,IAAA,IAAI,eAAe,GAAA;QACjB,OAAO,IAAI,CAAC,gBAAgB;;;AAI9B,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,KAAK;;;AAInB,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;;IAGrB,WAAY,CAAA,cAAgC,EAAE,eAA6C,EAAA;AACzF,QAAA,IAAI,CAAC,OAAO,GAAG,cAAc;AAC7B,QAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe;QACvC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,oCAAoC,CACzD,cAAc,EACd,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CACjC;;AAGH;;;;;;;;AAQG;AACI,IAAA,IAAI,CAAC,WAAqC,EAAA;AAC/C,QAAA,IAAI,SAAS,GAAG,QAAQ,IAAI,WAAW,GAAG,SAAS,GAAG,WAAW;AACjE,QAAA,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,gBAAgB,EAAE;YAC1C,IAAI,SAAS,EAAE;AACb,gBAAA,SAAS,GAAG,OAAO,CAAC,6BAA6B,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI;;iBACrF;AACL,gBAAA,SAAS,GAAG,OAAO,CAAC,uBAAuB,CAAC,WAA0B,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI;;;AAGzG,QAAA,OAAO,SAAU;;AAEpB;AAED;MACa,cAAc,CAAA;AAKzB;;AAEG;AACH,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,OAAO;;AAGrB;;AAEG;AACH,IAAA,IAAI,EAAE,GAAA;AACJ,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE;;AAGzB;;AAEG;AACH,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;;AAGrB;;AAEG;AACH,IAAA,IAAI,MAAM,GAAA;QACR,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,OAAO;AAClB,YAAA,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;SACrB;;IAGH,WAAY,CAAA,OAAgB,EAAE,MAAoC,EAAA;AAChE,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,MAAM,KAAK,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;QACjG,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,iCAAiC,CAAC,OAAO,CAAC;;AAEpE;;;;"}
1
+ {"version":3,"file":"account.mjs","names":[],"sources":["../../src/types/account.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { AlgoAmount } from './amount'\nimport ApplicationLocalState = algosdk.modelsv2.ApplicationLocalState\nimport ApplicationStateSchema = algosdk.modelsv2.ApplicationStateSchema\nimport AssetHolding = algosdk.modelsv2.AssetHolding\nimport Application = algosdk.modelsv2.Application\nimport Asset = algosdk.modelsv2.Asset\nimport AccountParticipation = algosdk.modelsv2.AccountParticipation\nimport Account = algosdk.Account\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport Transaction = algosdk.Transaction\nimport TransactionSigner = algosdk.TransactionSigner\n\n/**\n * The account name identifier used for fund dispensing in test environments\n */\nexport const DISPENSER_ACCOUNT = 'DISPENSER'\n\n/** Account wrapper that supports partial or full multisig signing. */\nexport class MultisigAccount {\n _params: algosdk.MultisigMetadata\n _signingAccounts: (algosdk.Account | SigningAccount)[]\n _addr: Address\n _signer: TransactionSigner\n\n /** The parameters for the multisig account */\n get params(): Readonly<algosdk.MultisigMetadata> {\n return this._params\n }\n\n /** The list of accounts that are present to sign */\n get signingAccounts(): Readonly<(algosdk.Account | SigningAccount)[]> {\n return this._signingAccounts\n }\n\n /** The address of the multisig account */\n get addr(): Readonly<Address> {\n return this._addr\n }\n\n /** The transaction signer for the multisig account */\n get signer(): TransactionSigner {\n return this._signer\n }\n\n constructor(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n this._params = multisigParams\n this._signingAccounts = signingAccounts\n this._addr = algosdk.multisigAddress(multisigParams)\n this._signer = algosdk.makeMultiSigAccountTransactionSigner(\n multisigParams,\n signingAccounts.map((a) => a.sk),\n )\n }\n\n /**\n * Sign the given transaction\n * @param transaction Either a transaction object or a raw, partially signed transaction\n * @returns The transaction signed by the present signers\n * @example\n * ```typescript\n * const signedTxn = multisigAccount.sign(myTransaction)\n * ```\n */\n public sign(transaction: Transaction | Uint8Array): Uint8Array {\n let signedTxn = 'sender' in transaction ? undefined : transaction\n for (const signer of this._signingAccounts) {\n if (signedTxn) {\n signedTxn = algosdk.appendSignMultisigTransaction(signedTxn, this._params, signer.sk).blob\n } else {\n signedTxn = algosdk.signMultisigTransaction(transaction as Transaction, this._params, signer.sk).blob\n }\n }\n return signedTxn!\n }\n}\n\n/** Account wrapper that supports a rekeyed account */\nexport class SigningAccount implements Account {\n private _account: Account\n private _signer: TransactionSigner\n private _sender: Address\n\n /**\n * Algorand address of the sender\n */\n get addr(): Readonly<Address> {\n return this._sender\n }\n\n /**\n * Secret key belonging to the signer\n */\n get sk(): Readonly<Uint8Array> {\n return this._account.sk\n }\n\n /**\n * Transaction signer for the underlying signing account\n */\n get signer(): TransactionSigner {\n return this._signer\n }\n\n /**\n * Algorand account of the sender address and signer private key\n */\n get sender(): Account {\n return {\n addr: this._sender,\n sk: this._account.sk,\n }\n }\n\n constructor(account: Account, sender: string | Address | undefined) {\n this._account = account\n this._sender = typeof sender === 'string' ? Address.fromString(sender) : (sender ?? account.addr)\n this._signer = algosdk.makeBasicAccountTransactionSigner(account)\n }\n}\n\n/** A wrapper around `TransactionSigner` that also has the sender address. */\nexport interface TransactionSignerAccount {\n addr: Readonly<Address>\n signer: TransactionSigner\n}\n\n/** Account information at a given round. */\nexport type AccountInformation = {\n /**\n * The account public key\n */\n address: Address\n\n /** The balance of Algo currently held by the account. */\n balance: AlgoAmount\n\n /**\n * The amount of Algo in the account, without the pending rewards.\n */\n amountWithoutPendingRewards: AlgoAmount\n\n /**\n * Algo balance required to be held by the account.\n *\n * The requirement grows based on asset and application usage.\n */\n minBalance: AlgoAmount\n /**\n * Amount of Algo of pending rewards in this account.\n */\n pendingRewards: AlgoAmount\n\n /**\n * Total rewards of Algo the account has received, including pending\n * rewards.\n */\n rewards: AlgoAmount\n\n /**\n * The round number for which this information is relevant.\n */\n validAsOfRound: bigint\n\n /**\n * Delegation status of the account's Algo:\n * * Offline - indicates that the associated account is delegated.\n * * Online - indicates that the associated account used as part of the delegation pool.\n * * NotParticipating - indicates that the associated account is neither a delegator nor a delegate.\n */\n status: string\n\n /**\n * The count of all applications that have been opted in, equivalent to the count\n * of application local data (AppLocalState objects) stored in this account.\n */\n totalAppsOptedIn: number\n\n /**\n * The count of all assets that have been opted in, equivalent to the count of\n * AssetHolding objects held by this account.\n */\n totalAssetsOptedIn: number\n\n /**\n * The count of all apps (AppParams objects) created by this account.\n */\n totalCreatedApps: number\n\n /**\n * The count of all assets (AssetParams objects) created by this account.\n */\n totalCreatedAssets: number\n\n /**\n * Applications local data stored in this account.\n */\n appsLocalState?: ApplicationLocalState[]\n\n /**\n * The sum of all extra application program pages for this account.\n */\n appsTotalExtraPages?: number\n /**\n * (tsch) stores the sum of all of the local schemas and global schemas in this\n * account.\n * Note: the raw account uses `StateSchema` for this type.\n */\n appsTotalSchema?: ApplicationStateSchema\n\n /**\n * Assets held by this account.\n */\n assets?: AssetHolding[]\n\n /**\n * The address against which signing should be checked. If empty, the\n * address of the current account is used. This field can be updated in any\n * transaction by setting the `RekeyTo` field.\n */\n authAddr?: Address\n\n /**\n * Parameters of applications created by this account including app global data.\n */\n createdApps?: Application[]\n\n /**\n * (apar) parameters of assets created by this account.\n * Note: the raw account uses `map[int] -> Asset` for this type.\n */\n createdAssets?: Asset[]\n\n /**\n * AccountParticipation describes the parameters used by this account in consensus\n * protocol.\n */\n participation?: AccountParticipation\n\n /**\n * Used as part of the rewards computation. Only applicable to accounts\n * which are participating.\n */\n rewardBase?: number\n\n /**\n * Indicates what type of signature is used by this account, must be one of:\n * * sig\n * * msig\n * * lsig\n */\n sigType?: string\n\n /**\n * The total number of bytes used by this account's app's box keys and\n * values.\n */\n totalBoxBytes?: number\n\n /**\n * The number of existing boxes created by this account's app.\n */\n totalBoxes?: number\n\n /**\n * The round in which this account last went online, or explicitly renewed their\n * online status.\n */\n lastHeartbeatRound?: bigint\n\n /**\n * The round in which this account last proposed the block.\n */\n lastProposedRound?: bigint\n}\n\n/** Account asset holding information at a given round. */\nexport type AccountAssetInformation = {\n /** The ID of the asset held. */\n assetId: bigint\n /** The current balance of that asset holding. */\n balance: bigint\n /** Whether or not the asset is frozen for the account. */\n frozen: boolean\n /** The round as at which the holding was correct. */\n round: bigint\n}\n\n/**\n * @deprecated The methods that use this can be achieved using `AccountManager` instead.\n * Config for an account config */\nexport interface AccountConfig {\n /** Mnemonic for an account */\n accountMnemonic: string\n /** Address of a rekeyed account */\n senderAddress?: string\n /** Account name used to retrieve config */\n accountName: string\n\n /** @deprecated Renamed to senderAddress in 2.3.1 */\n senderMnemonic?: string\n}\n"],"mappings":";;;;;AAgBA,MAAa,oBAAoB;;AAGjC,IAAa,kBAAb,MAA6B;CAC3B;CACA;CACA;CACA;;CAGA,IAAI,SAA6C;EAC/C,OAAO,KAAK;CACd;;CAGA,IAAI,kBAAkE;EACpE,OAAO,KAAK;CACd;;CAGA,IAAI,OAA0B;EAC5B,OAAO,KAAK;CACd;;CAGA,IAAI,SAA4B;EAC9B,OAAO,KAAK;CACd;CAEA,YAAY,gBAAkC,iBAA+C;EAC3F,KAAK,UAAU;EACf,KAAK,mBAAmB;EACxB,KAAK,QAAQ,QAAQ,gBAAgB,cAAc;EACnD,KAAK,UAAU,QAAQ,qCACrB,gBACA,gBAAgB,KAAK,MAAM,EAAE,EAAE,CACjC;CACF;;;;;;;;;;CAWA,KAAY,aAAmD;EAC7D,IAAI,YAAY,YAAY,cAAc,KAAA,IAAY;EACtD,KAAK,MAAM,UAAU,KAAK,kBACxB,IAAI,WACF,YAAY,QAAQ,8BAA8B,WAAW,KAAK,SAAS,OAAO,EAAE,CAAC,CAAC;OAEtF,YAAY,QAAQ,wBAAwB,aAA4B,KAAK,SAAS,OAAO,EAAE,CAAC,CAAC;EAGrG,OAAO;CACT;AACF;;AAGA,IAAa,iBAAb,MAA+C;CAC7C;CACA;CACA;;;;CAKA,IAAI,OAA0B;EAC5B,OAAO,KAAK;CACd;;;;CAKA,IAAI,KAA2B;EAC7B,OAAO,KAAK,SAAS;CACvB;;;;CAKA,IAAI,SAA4B;EAC9B,OAAO,KAAK;CACd;;;;CAKA,IAAI,SAAkB;EACpB,OAAO;GACL,MAAM,KAAK;GACX,IAAI,KAAK,SAAS;EACpB;CACF;CAEA,YAAY,SAAkB,QAAsC;EAClE,KAAK,WAAW;EAChB,KAAK,UAAU,OAAO,WAAW,WAAW,QAAQ,WAAW,MAAM,IAAK,UAAU,QAAQ;EAC5F,KAAK,UAAU,QAAQ,kCAAkC,OAAO;CAClE;AACF"}
@@ -1,12 +1,17 @@
1
- import { BaseHTTPClientResponse, Query, URLTokenBaseHTTPClient } from 'algosdk/client';
1
+ import { BaseHTTPClientResponse, Query, URLTokenBaseHTTPClient } from "algosdk/client";
2
+
3
+ //#region src/types/algo-http-client-with-retry.d.ts
2
4
  /** A HTTP Client that wraps the Algorand SDK HTTP Client with retries */
3
- export declare class AlgoHttpClientWithRetry extends URLTokenBaseHTTPClient {
4
- private static readonly MAX_TRIES;
5
- private static readonly MAX_BACKOFF_MS;
6
- private static readonly RETRY_STATUS_CODES;
7
- private static readonly RETRY_ERROR_CODES;
8
- private callWithRetry;
9
- get(relativePath: string, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
10
- post(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
11
- delete(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
5
+ declare class AlgoHttpClientWithRetry extends URLTokenBaseHTTPClient {
6
+ private static readonly MAX_TRIES;
7
+ private static readonly MAX_BACKOFF_MS;
8
+ private static readonly RETRY_STATUS_CODES;
9
+ private static readonly RETRY_ERROR_CODES;
10
+ private callWithRetry;
11
+ get(relativePath: string, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
12
+ post(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
13
+ delete(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
12
14
  }
15
+ //#endregion
16
+ export { AlgoHttpClientWithRetry };
17
+ //# sourceMappingURL=algo-http-client-with-retry.d.ts.map