algosdk 2.9.0 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (805) hide show
  1. package/README.md +8 -4
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.LICENSE.txt +0 -9
  4. package/dist/browser/algosdk.min.js.map +1 -1
  5. package/dist/cjs/abi/abi_type.js +34 -27
  6. package/dist/cjs/abi/abi_type.js.map +1 -1
  7. package/dist/cjs/abi/contract.js +3 -3
  8. package/dist/cjs/abi/contract.js.map +1 -1
  9. package/dist/cjs/abi/index.js +6 -6
  10. package/dist/cjs/abi/index.js.map +1 -1
  11. package/dist/cjs/abi/interface.js +3 -3
  12. package/dist/cjs/abi/interface.js.map +1 -1
  13. package/dist/cjs/abi/method.js +10 -10
  14. package/dist/cjs/abi/method.js.map +1 -1
  15. package/dist/cjs/abi/reference.js +1 -1
  16. package/dist/cjs/abi/reference.js.map +1 -1
  17. package/dist/cjs/abi/transaction.js +2 -2
  18. package/dist/cjs/abi/transaction.js.map +1 -1
  19. package/dist/cjs/account.js +4 -4
  20. package/dist/cjs/account.js.map +1 -1
  21. package/dist/cjs/boxStorage.js +17 -17
  22. package/dist/cjs/boxStorage.js.map +1 -1
  23. package/dist/cjs/client/client.js +77 -41
  24. package/dist/cjs/client/client.js.map +1 -1
  25. package/dist/cjs/client/index.js +29 -0
  26. package/dist/cjs/client/index.js.map +1 -0
  27. package/dist/cjs/client/kmd.js +69 -86
  28. package/dist/cjs/client/kmd.js.map +1 -1
  29. package/dist/cjs/client/urlTokenBaseHTTPClient.js +16 -11
  30. package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
  31. package/dist/cjs/client/v2/algod/accountApplicationInformation.js +11 -7
  32. package/dist/cjs/client/v2/algod/accountApplicationInformation.js.map +1 -1
  33. package/dist/cjs/client/v2/algod/accountAssetInformation.js +11 -7
  34. package/dist/cjs/client/v2/algod/accountAssetInformation.js.map +1 -1
  35. package/dist/cjs/client/v2/algod/accountInformation.js +11 -6
  36. package/dist/cjs/client/v2/algod/accountInformation.js.map +1 -1
  37. package/dist/cjs/client/v2/algod/algod.js +85 -83
  38. package/dist/cjs/client/v2/algod/algod.js.map +1 -1
  39. package/dist/cjs/client/v2/algod/block.js +6 -33
  40. package/dist/cjs/client/v2/algod/block.js.map +1 -1
  41. package/dist/cjs/client/v2/algod/compile.js +17 -11
  42. package/dist/cjs/client/v2/algod/compile.js.map +1 -1
  43. package/dist/cjs/client/v2/algod/disassemble.js +17 -11
  44. package/dist/cjs/client/v2/algod/disassemble.js.map +1 -1
  45. package/dist/cjs/client/v2/algod/dryrun.js +18 -37
  46. package/dist/cjs/client/v2/algod/dryrun.js.map +1 -1
  47. package/dist/cjs/client/v2/algod/genesis.js +6 -2
  48. package/dist/cjs/client/v2/algod/genesis.js.map +1 -1
  49. package/dist/cjs/client/v2/algod/getApplicationBoxByName.js +10 -10
  50. package/dist/cjs/client/v2/algod/getApplicationBoxByName.js.map +1 -1
  51. package/dist/cjs/client/v2/algod/getApplicationBoxes.js +8 -8
  52. package/dist/cjs/client/v2/algod/getApplicationBoxes.js.map +1 -1
  53. package/dist/cjs/client/v2/algod/getApplicationByID.js +10 -5
  54. package/dist/cjs/client/v2/algod/getApplicationByID.js.map +1 -1
  55. package/dist/cjs/client/v2/algod/getAssetByID.js +10 -5
  56. package/dist/cjs/client/v2/algod/getAssetByID.js.map +1 -1
  57. package/dist/cjs/client/v2/algod/getBlockHash.js +10 -6
  58. package/dist/cjs/client/v2/algod/getBlockHash.js.map +1 -1
  59. package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js +6 -5
  60. package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -1
  61. package/dist/cjs/client/v2/algod/getBlockTxids.js +10 -4
  62. package/dist/cjs/client/v2/algod/getBlockTxids.js.map +1 -1
  63. package/dist/cjs/client/v2/algod/getLedgerStateDelta.js +11 -6
  64. package/dist/cjs/client/v2/algod/getLedgerStateDelta.js.map +1 -1
  65. package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +11 -6
  66. package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -1
  67. package/dist/cjs/client/v2/algod/getSyncRound.js +6 -5
  68. package/dist/cjs/client/v2/algod/getSyncRound.js.map +1 -1
  69. package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +9 -9
  70. package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -1
  71. package/dist/cjs/client/v2/algod/getTransactionProof.js +10 -6
  72. package/dist/cjs/client/v2/algod/getTransactionProof.js.map +1 -1
  73. package/dist/cjs/client/v2/algod/healthCheck.js +4 -9
  74. package/dist/cjs/client/v2/algod/healthCheck.js.map +1 -1
  75. package/dist/cjs/{types → client/v2/algod}/index.js +5 -3
  76. package/dist/cjs/client/v2/algod/index.js.map +1 -0
  77. package/dist/cjs/client/v2/algod/lightBlockHeaderProof.js +10 -5
  78. package/dist/cjs/client/v2/algod/lightBlockHeaderProof.js.map +1 -1
  79. package/dist/cjs/client/v2/algod/models/types.js +3701 -1828
  80. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  81. package/dist/cjs/client/v2/algod/pendingTransactionInformation.js +6 -32
  82. package/dist/cjs/client/v2/algod/pendingTransactionInformation.js.map +1 -1
  83. package/dist/cjs/client/v2/algod/pendingTransactions.js +6 -31
  84. package/dist/cjs/client/v2/algod/pendingTransactions.js.map +1 -1
  85. package/dist/cjs/client/v2/algod/pendingTransactionsByAddress.js +7 -33
  86. package/dist/cjs/client/v2/algod/pendingTransactionsByAddress.js.map +1 -1
  87. package/dist/cjs/client/v2/algod/ready.js +4 -2
  88. package/dist/cjs/client/v2/algod/ready.js.map +1 -1
  89. package/dist/cjs/client/v2/algod/sendRawTransaction.js +17 -8
  90. package/dist/cjs/client/v2/algod/sendRawTransaction.js.map +1 -1
  91. package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js +13 -8
  92. package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -1
  93. package/dist/cjs/client/v2/algod/setSyncRound.js +13 -8
  94. package/dist/cjs/client/v2/algod/setSyncRound.js.map +1 -1
  95. package/dist/cjs/client/v2/algod/simulateTransaction.js +15 -35
  96. package/dist/cjs/client/v2/algod/simulateTransaction.js.map +1 -1
  97. package/dist/cjs/client/v2/algod/stateproof.js +10 -5
  98. package/dist/cjs/client/v2/algod/stateproof.js.map +1 -1
  99. package/dist/cjs/client/v2/algod/status.js +8 -2
  100. package/dist/cjs/client/v2/algod/status.js.map +1 -1
  101. package/dist/cjs/client/v2/algod/statusAfterBlock.js +10 -5
  102. package/dist/cjs/client/v2/algod/statusAfterBlock.js.map +1 -1
  103. package/dist/cjs/client/v2/algod/suggestedParams.js +13 -9
  104. package/dist/cjs/client/v2/algod/suggestedParams.js.map +1 -1
  105. package/dist/cjs/client/v2/algod/supply.js +8 -2
  106. package/dist/cjs/client/v2/algod/supply.js.map +1 -1
  107. package/dist/cjs/client/v2/algod/unsetSyncRound.js +11 -5
  108. package/dist/cjs/client/v2/algod/unsetSyncRound.js.map +1 -1
  109. package/dist/cjs/client/v2/algod/versions.js +8 -2
  110. package/dist/cjs/client/v2/algod/versions.js.map +1 -1
  111. package/dist/cjs/client/v2/indexer/index.js +22 -0
  112. package/dist/cjs/client/v2/indexer/index.js.map +1 -0
  113. package/dist/cjs/client/v2/indexer/indexer.js +44 -43
  114. package/dist/cjs/client/v2/indexer/indexer.js.map +1 -1
  115. package/dist/cjs/client/v2/indexer/lookupAccountAppLocalStates.js +11 -6
  116. package/dist/cjs/client/v2/indexer/lookupAccountAppLocalStates.js.map +1 -1
  117. package/dist/cjs/client/v2/indexer/lookupAccountAssets.js +11 -6
  118. package/dist/cjs/client/v2/indexer/lookupAccountAssets.js.map +1 -1
  119. package/dist/cjs/client/v2/indexer/lookupAccountByID.js +11 -6
  120. package/dist/cjs/client/v2/indexer/lookupAccountByID.js.map +1 -1
  121. package/dist/cjs/client/v2/indexer/lookupAccountCreatedApplications.js +11 -6
  122. package/dist/cjs/client/v2/indexer/lookupAccountCreatedApplications.js.map +1 -1
  123. package/dist/cjs/client/v2/indexer/lookupAccountCreatedAssets.js +11 -6
  124. package/dist/cjs/client/v2/indexer/lookupAccountCreatedAssets.js.map +1 -1
  125. package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js +19 -12
  126. package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
  127. package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js +10 -10
  128. package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -1
  129. package/dist/cjs/client/v2/indexer/lookupApplicationLogs.js +10 -5
  130. package/dist/cjs/client/v2/indexer/lookupApplicationLogs.js.map +1 -1
  131. package/dist/cjs/client/v2/indexer/lookupApplications.js +10 -5
  132. package/dist/cjs/client/v2/indexer/lookupApplications.js.map +1 -1
  133. package/dist/cjs/client/v2/indexer/lookupAssetBalances.js +10 -5
  134. package/dist/cjs/client/v2/indexer/lookupAssetBalances.js.map +1 -1
  135. package/dist/cjs/client/v2/indexer/lookupAssetByID.js +10 -5
  136. package/dist/cjs/client/v2/indexer/lookupAssetByID.js.map +1 -1
  137. package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +19 -12
  138. package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
  139. package/dist/cjs/client/v2/indexer/lookupBlock.js +10 -5
  140. package/dist/cjs/client/v2/indexer/lookupBlock.js.map +1 -1
  141. package/dist/cjs/client/v2/indexer/lookupTransactionByID.js +10 -5
  142. package/dist/cjs/client/v2/indexer/lookupTransactionByID.js.map +1 -1
  143. package/dist/cjs/client/v2/indexer/makeHealthCheck.js +8 -2
  144. package/dist/cjs/client/v2/indexer/makeHealthCheck.js.map +1 -1
  145. package/dist/cjs/client/v2/indexer/models/types.js +3591 -1651
  146. package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
  147. package/dist/cjs/client/v2/indexer/searchAccounts.js +9 -3
  148. package/dist/cjs/client/v2/indexer/searchAccounts.js.map +1 -1
  149. package/dist/cjs/client/v2/indexer/searchForApplicationBoxes.js +8 -8
  150. package/dist/cjs/client/v2/indexer/searchForApplicationBoxes.js.map +1 -1
  151. package/dist/cjs/client/v2/indexer/searchForApplications.js +9 -3
  152. package/dist/cjs/client/v2/indexer/searchForApplications.js.map +1 -1
  153. package/dist/cjs/client/v2/indexer/searchForAssets.js +9 -3
  154. package/dist/cjs/client/v2/indexer/searchForAssets.js.map +1 -1
  155. package/dist/cjs/client/v2/indexer/searchForTransactions.js +17 -9
  156. package/dist/cjs/client/v2/indexer/searchForTransactions.js.map +1 -1
  157. package/dist/cjs/client/v2/jsonrequest.js +22 -54
  158. package/dist/cjs/client/v2/jsonrequest.js.map +1 -1
  159. package/dist/cjs/client/v2/serviceClient.js +5 -25
  160. package/dist/cjs/client/v2/serviceClient.js.map +1 -1
  161. package/dist/cjs/client/v2/untypedmodel.js +22 -0
  162. package/dist/cjs/client/v2/untypedmodel.js.map +1 -0
  163. package/dist/cjs/composer.js +64 -58
  164. package/dist/cjs/composer.js.map +1 -1
  165. package/dist/cjs/convert.js.map +1 -1
  166. package/dist/cjs/dryrun.js +107 -203
  167. package/dist/cjs/dryrun.js.map +1 -1
  168. package/dist/cjs/encoding/address.js +88 -104
  169. package/dist/cjs/encoding/address.js.map +1 -1
  170. package/dist/cjs/encoding/bigint.js +2 -3
  171. package/dist/cjs/encoding/bigint.js.map +1 -1
  172. package/dist/cjs/encoding/binarydata.js +82 -0
  173. package/dist/cjs/encoding/binarydata.js.map +1 -0
  174. package/dist/cjs/encoding/encoding.js +353 -38
  175. package/dist/cjs/encoding/encoding.js.map +1 -1
  176. package/dist/cjs/encoding/schema/address.js +41 -0
  177. package/dist/cjs/encoding/schema/address.js.map +1 -0
  178. package/dist/cjs/encoding/schema/array.js +43 -0
  179. package/dist/cjs/encoding/schema/array.js.map +1 -0
  180. package/dist/cjs/encoding/schema/binarystring.js +55 -0
  181. package/dist/cjs/encoding/schema/binarystring.js.map +1 -0
  182. package/dist/cjs/encoding/schema/blockhash.js +67 -0
  183. package/dist/cjs/encoding/schema/blockhash.js.map +1 -0
  184. package/dist/cjs/encoding/schema/boolean.js +42 -0
  185. package/dist/cjs/encoding/schema/boolean.js.map +1 -0
  186. package/dist/cjs/encoding/schema/bytearray.js +98 -0
  187. package/dist/cjs/encoding/schema/bytearray.js.map +1 -0
  188. package/dist/cjs/encoding/schema/index.js +34 -0
  189. package/dist/cjs/encoding/schema/index.js.map +1 -0
  190. package/dist/cjs/encoding/schema/map.js +528 -0
  191. package/dist/cjs/encoding/schema/map.js.map +1 -0
  192. package/dist/cjs/encoding/schema/optional.js +58 -0
  193. package/dist/cjs/encoding/schema/optional.js.map +1 -0
  194. package/dist/cjs/encoding/schema/string.js +43 -0
  195. package/dist/cjs/encoding/schema/string.js.map +1 -0
  196. package/dist/cjs/encoding/schema/uint64.js +36 -0
  197. package/dist/cjs/encoding/schema/uint64.js.map +1 -0
  198. package/dist/cjs/encoding/schema/untyped.js +33 -0
  199. package/dist/cjs/encoding/schema/untyped.js.map +1 -0
  200. package/dist/cjs/encoding/uint64.js +2 -2
  201. package/dist/cjs/encoding/uint64.js.map +1 -1
  202. package/dist/cjs/group.js +23 -60
  203. package/dist/cjs/group.js.map +1 -1
  204. package/dist/cjs/index.js +2 -2
  205. package/dist/cjs/index.js.map +1 -1
  206. package/dist/cjs/logic/sourcemap.js +56 -25
  207. package/dist/cjs/logic/sourcemap.js.map +1 -1
  208. package/dist/cjs/logicsig.js +113 -146
  209. package/dist/cjs/logicsig.js.map +1 -1
  210. package/dist/cjs/main.js +113 -122
  211. package/dist/cjs/main.js.map +1 -1
  212. package/dist/cjs/makeTxn.js +310 -570
  213. package/dist/cjs/makeTxn.js.map +1 -1
  214. package/dist/cjs/mnemonic/mnemonic.js +8 -8
  215. package/dist/cjs/mnemonic/mnemonic.js.map +1 -1
  216. package/dist/cjs/multisig.js +60 -312
  217. package/dist/cjs/multisig.js.map +1 -1
  218. package/dist/cjs/multisigSigning.js +285 -0
  219. package/dist/cjs/multisigSigning.js.map +1 -0
  220. package/dist/cjs/nacl/naclWrappers.js +2 -2
  221. package/dist/cjs/nacl/naclWrappers.js.map +1 -1
  222. package/dist/cjs/signedTransaction.js +106 -0
  223. package/dist/cjs/signedTransaction.js.map +1 -0
  224. package/dist/cjs/signer.js +7 -7
  225. package/dist/cjs/signer.js.map +1 -1
  226. package/dist/cjs/signing.js +105 -0
  227. package/dist/cjs/signing.js.map +1 -0
  228. package/dist/cjs/stateproof.js +421 -0
  229. package/dist/cjs/stateproof.js.map +1 -0
  230. package/dist/cjs/transaction.js +724 -1009
  231. package/dist/cjs/transaction.js.map +1 -1
  232. package/dist/cjs/types/block.js +813 -0
  233. package/dist/cjs/types/block.js.map +1 -0
  234. package/dist/cjs/types/intDecoding.js +1 -1
  235. package/dist/cjs/types/intDecoding.js.map +1 -1
  236. package/dist/cjs/types/statedelta.js +1155 -0
  237. package/dist/cjs/types/statedelta.js.map +1 -0
  238. package/dist/cjs/types/transactions/base.js +22 -5
  239. package/dist/cjs/types/transactions/base.js.map +1 -1
  240. package/dist/cjs/types/transactions/encoded.js +67 -0
  241. package/dist/cjs/types/transactions/encoded.js.map +1 -1
  242. package/dist/cjs/types/transactions/index.js +2 -5
  243. package/dist/cjs/types/transactions/index.js.map +1 -1
  244. package/dist/cjs/utils/utils.js +86 -22
  245. package/dist/cjs/utils/utils.js.map +1 -1
  246. package/dist/cjs/wait.js +4 -4
  247. package/dist/cjs/wait.js.map +1 -1
  248. package/dist/esm/abi/abi_type.js +22 -15
  249. package/dist/esm/abi/abi_type.js.map +1 -1
  250. package/dist/esm/abi/contract.js +1 -1
  251. package/dist/esm/abi/contract.js.map +1 -1
  252. package/dist/esm/abi/index.js +6 -6
  253. package/dist/esm/abi/index.js.map +1 -1
  254. package/dist/esm/abi/interface.js +1 -1
  255. package/dist/esm/abi/interface.js.map +1 -1
  256. package/dist/esm/abi/method.js +4 -4
  257. package/dist/esm/abi/method.js.map +1 -1
  258. package/dist/esm/abi/transaction.js +1 -1
  259. package/dist/esm/abi/transaction.js.map +1 -1
  260. package/dist/esm/account.js +4 -4
  261. package/dist/esm/account.js.map +1 -1
  262. package/dist/esm/boxStorage.js +15 -15
  263. package/dist/esm/boxStorage.js.map +1 -1
  264. package/dist/esm/client/client.js +74 -40
  265. package/dist/esm/client/client.js.map +1 -1
  266. package/dist/esm/client/index.js +7 -0
  267. package/dist/esm/client/index.js.map +1 -0
  268. package/dist/esm/client/kmd.js +67 -62
  269. package/dist/esm/client/kmd.js.map +1 -1
  270. package/dist/esm/client/urlTokenBaseHTTPClient.js +16 -11
  271. package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
  272. package/dist/esm/client/v2/algod/accountApplicationInformation.js +10 -6
  273. package/dist/esm/client/v2/algod/accountApplicationInformation.js.map +1 -1
  274. package/dist/esm/client/v2/algod/accountAssetInformation.js +10 -6
  275. package/dist/esm/client/v2/algod/accountAssetInformation.js.map +1 -1
  276. package/dist/esm/client/v2/algod/accountInformation.js +10 -5
  277. package/dist/esm/client/v2/algod/accountInformation.js.map +1 -1
  278. package/dist/esm/client/v2/algod/algod.js +71 -70
  279. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  280. package/dist/esm/client/v2/algod/block.js +5 -9
  281. package/dist/esm/client/v2/algod/block.js.map +1 -1
  282. package/dist/esm/client/v2/algod/compile.js +16 -10
  283. package/dist/esm/client/v2/algod/compile.js.map +1 -1
  284. package/dist/esm/client/v2/algod/disassemble.js +16 -10
  285. package/dist/esm/client/v2/algod/disassemble.js.map +1 -1
  286. package/dist/esm/client/v2/algod/dryrun.js +16 -12
  287. package/dist/esm/client/v2/algod/dryrun.js.map +1 -1
  288. package/dist/esm/client/v2/algod/genesis.js +5 -1
  289. package/dist/esm/client/v2/algod/genesis.js.map +1 -1
  290. package/dist/esm/client/v2/algod/getApplicationBoxByName.js +9 -9
  291. package/dist/esm/client/v2/algod/getApplicationBoxByName.js.map +1 -1
  292. package/dist/esm/client/v2/algod/getApplicationBoxes.js +7 -7
  293. package/dist/esm/client/v2/algod/getApplicationBoxes.js.map +1 -1
  294. package/dist/esm/client/v2/algod/getApplicationByID.js +9 -4
  295. package/dist/esm/client/v2/algod/getApplicationByID.js.map +1 -1
  296. package/dist/esm/client/v2/algod/getAssetByID.js +9 -4
  297. package/dist/esm/client/v2/algod/getAssetByID.js.map +1 -1
  298. package/dist/esm/client/v2/algod/getBlockHash.js +9 -5
  299. package/dist/esm/client/v2/algod/getBlockHash.js.map +1 -1
  300. package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js +5 -4
  301. package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -1
  302. package/dist/esm/client/v2/algod/getBlockTxids.js +9 -3
  303. package/dist/esm/client/v2/algod/getBlockTxids.js.map +1 -1
  304. package/dist/esm/client/v2/algod/getLedgerStateDelta.js +10 -5
  305. package/dist/esm/client/v2/algod/getLedgerStateDelta.js.map +1 -1
  306. package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +10 -5
  307. package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -1
  308. package/dist/esm/client/v2/algod/getSyncRound.js +5 -4
  309. package/dist/esm/client/v2/algod/getSyncRound.js.map +1 -1
  310. package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +8 -8
  311. package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -1
  312. package/dist/esm/client/v2/algod/getTransactionProof.js +9 -5
  313. package/dist/esm/client/v2/algod/getTransactionProof.js.map +1 -1
  314. package/dist/esm/client/v2/algod/healthCheck.js +3 -8
  315. package/dist/esm/client/v2/algod/healthCheck.js.map +1 -1
  316. package/dist/esm/client/v2/algod/index.js +4 -0
  317. package/dist/esm/client/v2/algod/index.js.map +1 -0
  318. package/dist/esm/client/v2/algod/lightBlockHeaderProof.js +9 -4
  319. package/dist/esm/client/v2/algod/lightBlockHeaderProof.js.map +1 -1
  320. package/dist/esm/client/v2/algod/models/types.js +3701 -1825
  321. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  322. package/dist/esm/client/v2/algod/pendingTransactionInformation.js +5 -8
  323. package/dist/esm/client/v2/algod/pendingTransactionInformation.js.map +1 -1
  324. package/dist/esm/client/v2/algod/pendingTransactions.js +5 -7
  325. package/dist/esm/client/v2/algod/pendingTransactions.js.map +1 -1
  326. package/dist/esm/client/v2/algod/pendingTransactionsByAddress.js +6 -9
  327. package/dist/esm/client/v2/algod/pendingTransactionsByAddress.js.map +1 -1
  328. package/dist/esm/client/v2/algod/ready.js +3 -1
  329. package/dist/esm/client/v2/algod/ready.js.map +1 -1
  330. package/dist/esm/client/v2/algod/sendRawTransaction.js +15 -6
  331. package/dist/esm/client/v2/algod/sendRawTransaction.js.map +1 -1
  332. package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js +12 -7
  333. package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -1
  334. package/dist/esm/client/v2/algod/setSyncRound.js +12 -7
  335. package/dist/esm/client/v2/algod/setSyncRound.js.map +1 -1
  336. package/dist/esm/client/v2/algod/simulateTransaction.js +14 -11
  337. package/dist/esm/client/v2/algod/simulateTransaction.js.map +1 -1
  338. package/dist/esm/client/v2/algod/stateproof.js +9 -4
  339. package/dist/esm/client/v2/algod/stateproof.js.map +1 -1
  340. package/dist/esm/client/v2/algod/status.js +7 -1
  341. package/dist/esm/client/v2/algod/status.js.map +1 -1
  342. package/dist/esm/client/v2/algod/statusAfterBlock.js +9 -4
  343. package/dist/esm/client/v2/algod/statusAfterBlock.js.map +1 -1
  344. package/dist/esm/client/v2/algod/suggestedParams.js +12 -8
  345. package/dist/esm/client/v2/algod/suggestedParams.js.map +1 -1
  346. package/dist/esm/client/v2/algod/supply.js +7 -1
  347. package/dist/esm/client/v2/algod/supply.js.map +1 -1
  348. package/dist/esm/client/v2/algod/unsetSyncRound.js +10 -4
  349. package/dist/esm/client/v2/algod/unsetSyncRound.js.map +1 -1
  350. package/dist/esm/client/v2/algod/versions.js +7 -1
  351. package/dist/esm/client/v2/algod/versions.js.map +1 -1
  352. package/dist/esm/client/v2/indexer/index.js +4 -0
  353. package/dist/esm/client/v2/indexer/index.js.map +1 -0
  354. package/dist/esm/client/v2/indexer/indexer.js +42 -42
  355. package/dist/esm/client/v2/indexer/indexer.js.map +1 -1
  356. package/dist/esm/client/v2/indexer/lookupAccountAppLocalStates.js +10 -5
  357. package/dist/esm/client/v2/indexer/lookupAccountAppLocalStates.js.map +1 -1
  358. package/dist/esm/client/v2/indexer/lookupAccountAssets.js +10 -5
  359. package/dist/esm/client/v2/indexer/lookupAccountAssets.js.map +1 -1
  360. package/dist/esm/client/v2/indexer/lookupAccountByID.js +10 -5
  361. package/dist/esm/client/v2/indexer/lookupAccountByID.js.map +1 -1
  362. package/dist/esm/client/v2/indexer/lookupAccountCreatedApplications.js +10 -5
  363. package/dist/esm/client/v2/indexer/lookupAccountCreatedApplications.js.map +1 -1
  364. package/dist/esm/client/v2/indexer/lookupAccountCreatedAssets.js +10 -5
  365. package/dist/esm/client/v2/indexer/lookupAccountCreatedAssets.js.map +1 -1
  366. package/dist/esm/client/v2/indexer/lookupAccountTransactions.js +18 -11
  367. package/dist/esm/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
  368. package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js +9 -9
  369. package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -1
  370. package/dist/esm/client/v2/indexer/lookupApplicationLogs.js +9 -4
  371. package/dist/esm/client/v2/indexer/lookupApplicationLogs.js.map +1 -1
  372. package/dist/esm/client/v2/indexer/lookupApplications.js +9 -4
  373. package/dist/esm/client/v2/indexer/lookupApplications.js.map +1 -1
  374. package/dist/esm/client/v2/indexer/lookupAssetBalances.js +9 -4
  375. package/dist/esm/client/v2/indexer/lookupAssetBalances.js.map +1 -1
  376. package/dist/esm/client/v2/indexer/lookupAssetByID.js +9 -4
  377. package/dist/esm/client/v2/indexer/lookupAssetByID.js.map +1 -1
  378. package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +17 -10
  379. package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
  380. package/dist/esm/client/v2/indexer/lookupBlock.js +9 -4
  381. package/dist/esm/client/v2/indexer/lookupBlock.js.map +1 -1
  382. package/dist/esm/client/v2/indexer/lookupTransactionByID.js +9 -4
  383. package/dist/esm/client/v2/indexer/lookupTransactionByID.js.map +1 -1
  384. package/dist/esm/client/v2/indexer/makeHealthCheck.js +7 -1
  385. package/dist/esm/client/v2/indexer/makeHealthCheck.js.map +1 -1
  386. package/dist/esm/client/v2/indexer/models/types.js +3591 -1648
  387. package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
  388. package/dist/esm/client/v2/indexer/searchAccounts.js +8 -2
  389. package/dist/esm/client/v2/indexer/searchAccounts.js.map +1 -1
  390. package/dist/esm/client/v2/indexer/searchForApplicationBoxes.js +7 -7
  391. package/dist/esm/client/v2/indexer/searchForApplicationBoxes.js.map +1 -1
  392. package/dist/esm/client/v2/indexer/searchForApplications.js +8 -2
  393. package/dist/esm/client/v2/indexer/searchForApplications.js.map +1 -1
  394. package/dist/esm/client/v2/indexer/searchForAssets.js +8 -2
  395. package/dist/esm/client/v2/indexer/searchForAssets.js.map +1 -1
  396. package/dist/esm/client/v2/indexer/searchForTransactions.js +15 -7
  397. package/dist/esm/client/v2/indexer/searchForTransactions.js.map +1 -1
  398. package/dist/esm/client/v2/jsonrequest.js +22 -51
  399. package/dist/esm/client/v2/jsonrequest.js.map +1 -1
  400. package/dist/esm/client/v2/serviceClient.js +3 -20
  401. package/dist/esm/client/v2/serviceClient.js.map +1 -1
  402. package/dist/esm/client/v2/untypedmodel.js +18 -0
  403. package/dist/esm/client/v2/untypedmodel.js.map +1 -0
  404. package/dist/esm/composer.js +43 -37
  405. package/dist/esm/composer.js.map +1 -1
  406. package/dist/esm/convert.js.map +1 -1
  407. package/dist/esm/dryrun.js +98 -195
  408. package/dist/esm/dryrun.js.map +1 -1
  409. package/dist/esm/encoding/address.js +85 -100
  410. package/dist/esm/encoding/address.js.map +1 -1
  411. package/dist/esm/encoding/bigint.js +2 -3
  412. package/dist/esm/encoding/bigint.js.map +1 -1
  413. package/dist/esm/encoding/binarydata.js +73 -0
  414. package/dist/esm/encoding/binarydata.js.map +1 -0
  415. package/dist/esm/encoding/encoding.js +337 -12
  416. package/dist/esm/encoding/encoding.js.map +1 -1
  417. package/dist/esm/encoding/schema/address.js +37 -0
  418. package/dist/esm/encoding/schema/address.js.map +1 -0
  419. package/dist/esm/encoding/schema/array.js +39 -0
  420. package/dist/esm/encoding/schema/array.js.map +1 -0
  421. package/dist/esm/encoding/schema/binarystring.js +51 -0
  422. package/dist/esm/encoding/schema/binarystring.js.map +1 -0
  423. package/dist/esm/encoding/schema/blockhash.js +60 -0
  424. package/dist/esm/encoding/schema/blockhash.js.map +1 -0
  425. package/dist/esm/encoding/schema/boolean.js +38 -0
  426. package/dist/esm/encoding/schema/boolean.js.map +1 -0
  427. package/dist/esm/encoding/schema/bytearray.js +93 -0
  428. package/dist/esm/encoding/schema/bytearray.js.map +1 -0
  429. package/dist/esm/encoding/schema/index.js +12 -0
  430. package/dist/esm/encoding/schema/index.js.map +1 -0
  431. package/dist/esm/encoding/schema/map.js +517 -0
  432. package/dist/esm/encoding/schema/map.js.map +1 -0
  433. package/dist/esm/encoding/schema/optional.js +54 -0
  434. package/dist/esm/encoding/schema/optional.js.map +1 -0
  435. package/dist/esm/encoding/schema/string.js +39 -0
  436. package/dist/esm/encoding/schema/string.js.map +1 -0
  437. package/dist/esm/encoding/schema/uint64.js +32 -0
  438. package/dist/esm/encoding/schema/uint64.js.map +1 -0
  439. package/dist/esm/encoding/schema/untyped.js +29 -0
  440. package/dist/esm/encoding/schema/untyped.js.map +1 -0
  441. package/dist/esm/encoding/uint64.js +1 -1
  442. package/dist/esm/encoding/uint64.js.map +1 -1
  443. package/dist/esm/group.js +22 -58
  444. package/dist/esm/group.js.map +1 -1
  445. package/dist/esm/index.js +2 -2
  446. package/dist/esm/index.js.map +1 -1
  447. package/dist/esm/logic/sourcemap.js +54 -23
  448. package/dist/esm/logic/sourcemap.js.map +1 -1
  449. package/dist/esm/logicsig.js +110 -141
  450. package/dist/esm/logicsig.js.map +1 -1
  451. package/dist/esm/main.js +47 -76
  452. package/dist/esm/main.js.map +1 -1
  453. package/dist/esm/makeTxn.js +304 -529
  454. package/dist/esm/makeTxn.js.map +1 -1
  455. package/dist/esm/mnemonic/mnemonic.js +5 -5
  456. package/dist/esm/mnemonic/mnemonic.js.map +1 -1
  457. package/dist/esm/multisig.js +56 -305
  458. package/dist/esm/multisig.js.map +1 -1
  459. package/dist/esm/multisigSigning.js +254 -0
  460. package/dist/esm/multisigSigning.js.map +1 -0
  461. package/dist/esm/nacl/naclWrappers.js +1 -1
  462. package/dist/esm/nacl/naclWrappers.js.map +1 -1
  463. package/dist/esm/package.json +1 -0
  464. package/dist/esm/signedTransaction.js +100 -0
  465. package/dist/esm/signedTransaction.js.map +1 -0
  466. package/dist/esm/signer.js +3 -3
  467. package/dist/esm/signer.js.map +1 -1
  468. package/dist/esm/signing.js +77 -0
  469. package/dist/esm/signing.js.map +1 -0
  470. package/dist/esm/stateproof.js +408 -0
  471. package/dist/esm/stateproof.js.map +1 -0
  472. package/dist/esm/transaction.js +723 -1005
  473. package/dist/esm/transaction.js.map +1 -1
  474. package/dist/esm/types/block.js +797 -0
  475. package/dist/esm/types/block.js.map +1 -0
  476. package/dist/esm/types/intDecoding.js +1 -1
  477. package/dist/esm/types/intDecoding.js.map +1 -1
  478. package/dist/esm/types/statedelta.js +1129 -0
  479. package/dist/esm/types/statedelta.js.map +1 -0
  480. package/dist/esm/types/transactions/base.js +18 -2
  481. package/dist/esm/types/transactions/base.js.map +1 -1
  482. package/dist/esm/types/transactions/encoded.js +62 -1
  483. package/dist/esm/types/transactions/encoded.js.map +1 -1
  484. package/dist/esm/types/transactions/index.js +2 -3
  485. package/dist/esm/types/transactions/index.js.map +1 -1
  486. package/dist/esm/utils/utils.js +80 -21
  487. package/dist/esm/utils/utils.js.map +1 -1
  488. package/dist/esm/wait.js +4 -4
  489. package/dist/esm/wait.js.map +1 -1
  490. package/dist/types/abi/abi_type.d.ts +1 -1
  491. package/dist/types/abi/contract.d.ts +2 -2
  492. package/dist/types/abi/index.d.ts +6 -6
  493. package/dist/types/abi/interface.d.ts +1 -1
  494. package/dist/types/abi/method.d.ts +6 -6
  495. package/dist/types/abi/transaction.d.ts +1 -1
  496. package/dist/types/account.d.ts +1 -1
  497. package/dist/types/boxStorage.d.ts +4 -5
  498. package/dist/types/client/baseHTTPClient.d.ts +9 -6
  499. package/dist/types/client/client.d.ts +59 -18
  500. package/dist/types/client/index.d.ts +5 -0
  501. package/dist/types/client/kmd.d.ts +12 -10
  502. package/dist/types/client/urlTokenBaseHTTPClient.d.ts +8 -5
  503. package/dist/types/client/v2/algod/accountApplicationInformation.d.ts +8 -6
  504. package/dist/types/client/v2/algod/accountAssetInformation.d.ts +8 -6
  505. package/dist/types/client/v2/algod/accountInformation.d.ts +7 -5
  506. package/dist/types/client/v2/algod/algod.d.ts +53 -52
  507. package/dist/types/client/v2/algod/block.d.ts +5 -4
  508. package/dist/types/client/v2/algod/compile.d.ts +7 -9
  509. package/dist/types/client/v2/algod/disassemble.d.ts +7 -9
  510. package/dist/types/client/v2/algod/dryrun.d.ts +7 -9
  511. package/dist/types/client/v2/algod/genesis.d.ts +4 -2
  512. package/dist/types/client/v2/algod/getApplicationBoxByName.d.ts +6 -7
  513. package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +6 -7
  514. package/dist/types/client/v2/algod/getApplicationByID.d.ts +6 -5
  515. package/dist/types/client/v2/algod/getAssetByID.d.ts +6 -5
  516. package/dist/types/client/v2/algod/getBlockHash.d.ts +7 -6
  517. package/dist/types/client/v2/algod/getBlockOffsetTimestamp.d.ts +5 -4
  518. package/dist/types/client/v2/algod/getBlockTxids.d.ts +6 -5
  519. package/dist/types/client/v2/algod/getLedgerStateDelta.d.ts +6 -5
  520. package/dist/types/client/v2/algod/getLedgerStateDeltaForTransactionGroup.d.ts +6 -5
  521. package/dist/types/client/v2/algod/getSyncRound.d.ts +5 -4
  522. package/dist/types/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.d.ts +6 -7
  523. package/dist/types/client/v2/algod/getTransactionProof.d.ts +6 -5
  524. package/dist/types/client/v2/algod/healthCheck.d.ts +4 -3
  525. package/dist/types/client/v2/algod/index.d.ts +2 -0
  526. package/dist/types/client/v2/algod/lightBlockHeaderProof.d.ts +6 -5
  527. package/dist/types/client/v2/algod/models/types.d.ts +604 -317
  528. package/dist/types/client/v2/algod/pendingTransactionInformation.d.ts +5 -4
  529. package/dist/types/client/v2/algod/pendingTransactions.d.ts +5 -4
  530. package/dist/types/client/v2/algod/pendingTransactionsByAddress.d.ts +7 -5
  531. package/dist/types/client/v2/algod/ready.d.ts +4 -2
  532. package/dist/types/client/v2/algod/sendRawTransaction.d.ts +7 -5
  533. package/dist/types/client/v2/algod/setBlockOffsetTimestamp.d.ts +6 -6
  534. package/dist/types/client/v2/algod/setSyncRound.d.ts +6 -6
  535. package/dist/types/client/v2/algod/simulateTransaction.d.ts +7 -7
  536. package/dist/types/client/v2/algod/stateproof.d.ts +6 -5
  537. package/dist/types/client/v2/algod/status.d.ts +5 -2
  538. package/dist/types/client/v2/algod/statusAfterBlock.d.ts +6 -5
  539. package/dist/types/client/v2/algod/suggestedParams.d.ts +25 -4
  540. package/dist/types/client/v2/algod/supply.d.ts +5 -2
  541. package/dist/types/client/v2/algod/unsetSyncRound.d.ts +5 -3
  542. package/dist/types/client/v2/algod/versions.d.ts +5 -2
  543. package/dist/types/client/v2/indexer/index.d.ts +2 -0
  544. package/dist/types/client/v2/indexer/indexer.d.ts +31 -30
  545. package/dist/types/client/v2/indexer/lookupAccountAppLocalStates.d.ts +7 -5
  546. package/dist/types/client/v2/indexer/lookupAccountAssets.d.ts +7 -5
  547. package/dist/types/client/v2/indexer/lookupAccountByID.d.ts +7 -5
  548. package/dist/types/client/v2/indexer/lookupAccountCreatedApplications.d.ts +7 -5
  549. package/dist/types/client/v2/indexer/lookupAccountCreatedAssets.d.ts +7 -5
  550. package/dist/types/client/v2/indexer/lookupAccountTransactions.d.ts +11 -9
  551. package/dist/types/client/v2/indexer/lookupApplicationBoxByIDandName.d.ts +6 -7
  552. package/dist/types/client/v2/indexer/lookupApplicationLogs.d.ts +6 -5
  553. package/dist/types/client/v2/indexer/lookupApplications.d.ts +6 -5
  554. package/dist/types/client/v2/indexer/lookupAssetBalances.d.ts +6 -5
  555. package/dist/types/client/v2/indexer/lookupAssetByID.d.ts +6 -5
  556. package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +12 -10
  557. package/dist/types/client/v2/indexer/lookupBlock.d.ts +6 -5
  558. package/dist/types/client/v2/indexer/lookupTransactionByID.d.ts +6 -5
  559. package/dist/types/client/v2/indexer/makeHealthCheck.d.ts +5 -2
  560. package/dist/types/client/v2/indexer/models/types.d.ts +513 -267
  561. package/dist/types/client/v2/indexer/searchAccounts.d.ts +7 -3
  562. package/dist/types/client/v2/indexer/searchForApplicationBoxes.d.ts +6 -7
  563. package/dist/types/client/v2/indexer/searchForApplications.d.ts +7 -3
  564. package/dist/types/client/v2/indexer/searchForAssets.d.ts +7 -3
  565. package/dist/types/client/v2/indexer/searchForTransactions.d.ts +11 -7
  566. package/dist/types/client/v2/jsonrequest.d.ts +20 -33
  567. package/dist/types/client/v2/serviceClient.d.ts +4 -18
  568. package/dist/types/client/v2/untypedmodel.d.ts +10 -0
  569. package/dist/types/composer.d.ts +18 -17
  570. package/dist/types/dryrun.d.ts +8 -80
  571. package/dist/types/encoding/address.d.ts +40 -31
  572. package/dist/types/encoding/binarydata.d.ts +30 -0
  573. package/dist/types/encoding/encoding.d.ts +219 -7
  574. package/dist/types/encoding/schema/address.d.ts +10 -0
  575. package/dist/types/encoding/schema/array.d.ts +11 -0
  576. package/dist/types/encoding/schema/binarystring.d.ts +18 -0
  577. package/dist/types/encoding/schema/blockhash.d.ts +16 -0
  578. package/dist/types/encoding/schema/boolean.d.ts +10 -0
  579. package/dist/types/encoding/schema/bytearray.d.ts +19 -0
  580. package/dist/types/encoding/schema/index.d.ts +11 -0
  581. package/dist/types/encoding/schema/map.d.ts +125 -0
  582. package/dist/types/encoding/schema/optional.d.ts +24 -0
  583. package/dist/types/encoding/schema/string.d.ts +9 -0
  584. package/dist/types/encoding/schema/uint64.d.ts +9 -0
  585. package/dist/types/encoding/schema/untyped.d.ts +9 -0
  586. package/dist/types/encoding/uint64.d.ts +1 -0
  587. package/dist/types/group.d.ts +6 -25
  588. package/dist/types/index.d.ts +2 -2
  589. package/dist/types/logic/sourcemap.d.ts +39 -13
  590. package/dist/types/logicsig.d.ts +27 -57
  591. package/dist/types/main.d.ts +43 -54
  592. package/dist/types/makeTxn.d.ts +117 -404
  593. package/dist/types/mnemonic/mnemonic.d.ts +1 -1
  594. package/dist/types/multisig.d.ts +28 -99
  595. package/dist/types/multisigSigning.d.ts +72 -0
  596. package/dist/types/signedTransaction.d.ts +55 -0
  597. package/dist/types/signer.d.ts +5 -5
  598. package/dist/types/signing.d.ts +29 -0
  599. package/dist/types/stateproof.d.ts +194 -0
  600. package/dist/types/transaction.d.ts +103 -182
  601. package/dist/types/types/account.d.ts +2 -1
  602. package/dist/types/types/block.d.ts +407 -0
  603. package/dist/types/types/intDecoding.d.ts +1 -1
  604. package/dist/types/types/statedelta.d.ts +575 -0
  605. package/dist/types/types/transactions/base.d.ts +206 -118
  606. package/dist/types/types/transactions/encoded.d.ts +7 -301
  607. package/dist/types/types/transactions/index.d.ts +2 -15
  608. package/dist/types/types/utils.d.ts +7 -7
  609. package/dist/types/utils/utils.d.ts +21 -16
  610. package/dist/types/wait.d.ts +3 -2
  611. package/package.json +48 -20
  612. package/src/abi/abi_type.ts +28 -18
  613. package/src/abi/contract.ts +2 -2
  614. package/src/abi/index.ts +6 -6
  615. package/src/abi/interface.ts +1 -1
  616. package/src/abi/method.ts +11 -9
  617. package/src/abi/transaction.ts +2 -2
  618. package/src/account.ts +5 -5
  619. package/src/boxStorage.ts +25 -23
  620. package/src/client/baseHTTPClient.ts +12 -6
  621. package/src/client/client.ts +147 -75
  622. package/src/client/index.ts +6 -0
  623. package/src/client/kmd.ts +79 -72
  624. package/src/client/urlTokenBaseHTTPClient.ts +25 -14
  625. package/src/client/v2/algod/accountApplicationInformation.ts +16 -9
  626. package/src/client/v2/algod/accountAssetInformation.ts +16 -9
  627. package/src/client/v2/algod/accountInformation.ts +16 -11
  628. package/src/client/v2/algod/algod.ts +83 -105
  629. package/src/client/v2/algod/block.ts +7 -11
  630. package/src/client/v2/algod/compile.ts +27 -19
  631. package/src/client/v2/algod/disassemble.ts +27 -19
  632. package/src/client/v2/algod/dryrun.ts +23 -19
  633. package/src/client/v2/algod/genesis.ts +8 -2
  634. package/src/client/v2/algod/getApplicationBoxByName.ts +10 -15
  635. package/src/client/v2/algod/getApplicationBoxes.ts +12 -13
  636. package/src/client/v2/algod/getApplicationByID.ts +15 -7
  637. package/src/client/v2/algod/getAssetByID.ts +15 -7
  638. package/src/client/v2/algod/getBlockHash.ts +13 -9
  639. package/src/client/v2/algod/getBlockOffsetTimestamp.ts +7 -8
  640. package/src/client/v2/algod/getBlockTxids.ts +12 -6
  641. package/src/client/v2/algod/getLedgerStateDelta.ts +16 -8
  642. package/src/client/v2/algod/getLedgerStateDeltaForTransactionGroup.ts +16 -8
  643. package/src/client/v2/algod/getSyncRound.ts +7 -8
  644. package/src/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.ts +15 -15
  645. package/src/client/v2/algod/getTransactionProof.ts +11 -9
  646. package/src/client/v2/algod/healthCheck.ts +5 -9
  647. package/src/client/v2/algod/index.ts +3 -0
  648. package/src/client/v2/algod/lightBlockHeaderProof.ts +15 -8
  649. package/src/client/v2/algod/models/types.ts +4699 -2263
  650. package/src/client/v2/algod/pendingTransactionInformation.ts +11 -11
  651. package/src/client/v2/algod/pendingTransactions.ts +7 -9
  652. package/src/client/v2/algod/pendingTransactionsByAddress.ts +12 -11
  653. package/src/client/v2/algod/ready.ts +6 -2
  654. package/src/client/v2/algod/sendRawTransaction.ts +24 -13
  655. package/src/client/v2/algod/setBlockOffsetTimestamp.ts +21 -11
  656. package/src/client/v2/algod/setSyncRound.ts +21 -11
  657. package/src/client/v2/algod/simulateTransaction.ts +22 -23
  658. package/src/client/v2/algod/stateproof.ts +15 -8
  659. package/src/client/v2/algod/status.ts +10 -2
  660. package/src/client/v2/algod/statusAfterBlock.ts +15 -7
  661. package/src/client/v2/algod/suggestedParams.ts +40 -10
  662. package/src/client/v2/algod/supply.ts +10 -2
  663. package/src/client/v2/algod/unsetSyncRound.ts +16 -5
  664. package/src/client/v2/algod/versions.ts +10 -2
  665. package/src/client/v2/indexer/index.ts +3 -0
  666. package/src/client/v2/indexer/indexer.ts +51 -59
  667. package/src/client/v2/indexer/lookupAccountAppLocalStates.ts +16 -11
  668. package/src/client/v2/indexer/lookupAccountAssets.ts +16 -11
  669. package/src/client/v2/indexer/lookupAccountByID.ts +16 -11
  670. package/src/client/v2/indexer/lookupAccountCreatedApplications.ts +16 -11
  671. package/src/client/v2/indexer/lookupAccountCreatedAssets.ts +16 -11
  672. package/src/client/v2/indexer/lookupAccountTransactions.ts +26 -19
  673. package/src/client/v2/indexer/lookupApplicationBoxByIDandName.ts +10 -15
  674. package/src/client/v2/indexer/lookupApplicationLogs.ts +15 -7
  675. package/src/client/v2/indexer/lookupApplications.ts +15 -7
  676. package/src/client/v2/indexer/lookupAssetBalances.ts +15 -7
  677. package/src/client/v2/indexer/lookupAssetByID.ts +15 -7
  678. package/src/client/v2/indexer/lookupAssetTransactions.ts +27 -16
  679. package/src/client/v2/indexer/lookupBlock.ts +15 -7
  680. package/src/client/v2/indexer/lookupTransactionByID.ts +15 -7
  681. package/src/client/v2/indexer/makeHealthCheck.ts +10 -2
  682. package/src/client/v2/indexer/models/types.ts +4454 -1988
  683. package/src/client/v2/indexer/searchAccounts.ts +13 -4
  684. package/src/client/v2/indexer/searchForApplicationBoxes.ts +12 -13
  685. package/src/client/v2/indexer/searchForApplications.ts +13 -4
  686. package/src/client/v2/indexer/searchForAssets.ts +13 -4
  687. package/src/client/v2/indexer/searchForTransactions.ts +22 -11
  688. package/src/client/v2/jsonrequest.ts +39 -57
  689. package/src/client/v2/serviceClient.ts +9 -31
  690. package/src/client/v2/untypedmodel.ts +25 -0
  691. package/src/composer.ts +83 -60
  692. package/src/dryrun.ts +129 -306
  693. package/src/encoding/address.ts +134 -146
  694. package/src/encoding/bigint.ts +2 -4
  695. package/src/encoding/binarydata.ts +80 -0
  696. package/src/encoding/encoding.ts +558 -13
  697. package/src/encoding/schema/address.ts +53 -0
  698. package/src/encoding/schema/array.ts +66 -0
  699. package/src/encoding/schema/binarystring.ts +73 -0
  700. package/src/encoding/schema/blockhash.ts +84 -0
  701. package/src/encoding/schema/boolean.ts +54 -0
  702. package/src/encoding/schema/bytearray.ts +127 -0
  703. package/src/encoding/schema/index.ts +26 -0
  704. package/src/encoding/schema/map.ts +713 -0
  705. package/src/encoding/schema/optional.ts +72 -0
  706. package/src/encoding/schema/string.ts +55 -0
  707. package/src/encoding/schema/uint64.ts +46 -0
  708. package/src/encoding/schema/untyped.ts +47 -0
  709. package/src/encoding/uint64.ts +2 -1
  710. package/src/group.ts +27 -75
  711. package/src/index.ts +2 -2
  712. package/src/logic/sourcemap.ts +94 -29
  713. package/src/logicsig.ts +154 -202
  714. package/src/main.ts +91 -94
  715. package/src/makeTxn.ts +660 -1338
  716. package/src/mnemonic/mnemonic.ts +14 -14
  717. package/src/multisig.ts +89 -403
  718. package/src/multisigSigning.ts +359 -0
  719. package/src/nacl/naclWrappers.ts +1 -1
  720. package/src/signedTransaction.ts +163 -0
  721. package/src/signer.ts +10 -5
  722. package/src/signing.ts +95 -0
  723. package/src/stateproof.ts +595 -0
  724. package/src/transaction.ts +986 -1242
  725. package/src/types/account.ts +3 -1
  726. package/src/types/block.ts +1278 -0
  727. package/src/types/intDecoding.ts +1 -1
  728. package/src/types/statedelta.ts +1717 -0
  729. package/src/types/transactions/base.ts +230 -122
  730. package/src/types/transactions/encoded.ts +81 -371
  731. package/src/types/transactions/index.ts +2 -72
  732. package/src/types/utils.ts +3 -3
  733. package/src/utils/utils.ts +96 -25
  734. package/src/wait.ts +8 -7
  735. package/dist/cjs/bid.js +0 -83
  736. package/dist/cjs/bid.js.map +0 -1
  737. package/dist/cjs/client/v2/basemodel.js +0 -67
  738. package/dist/cjs/client/v2/basemodel.js.map +0 -1
  739. package/dist/cjs/types/address.js +0 -3
  740. package/dist/cjs/types/address.js.map +0 -1
  741. package/dist/cjs/types/blockHeader.js +0 -3
  742. package/dist/cjs/types/blockHeader.js.map +0 -1
  743. package/dist/cjs/types/index.js.map +0 -1
  744. package/dist/cjs/types/multisig.js +0 -3
  745. package/dist/cjs/types/multisig.js.map +0 -1
  746. package/dist/cjs/types/transactions/application.js +0 -3
  747. package/dist/cjs/types/transactions/application.js.map +0 -1
  748. package/dist/cjs/types/transactions/asset.js +0 -3
  749. package/dist/cjs/types/transactions/asset.js.map +0 -1
  750. package/dist/cjs/types/transactions/builder.js +0 -3
  751. package/dist/cjs/types/transactions/builder.js.map +0 -1
  752. package/dist/cjs/types/transactions/keyreg.js +0 -3
  753. package/dist/cjs/types/transactions/keyreg.js.map +0 -1
  754. package/dist/cjs/types/transactions/payment.js +0 -3
  755. package/dist/cjs/types/transactions/payment.js.map +0 -1
  756. package/dist/cjs/types/transactions/stateproof.js +0 -3
  757. package/dist/cjs/types/transactions/stateproof.js.map +0 -1
  758. package/dist/esm/bid.js +0 -57
  759. package/dist/esm/bid.js.map +0 -1
  760. package/dist/esm/client/v2/basemodel.js +0 -64
  761. package/dist/esm/client/v2/basemodel.js.map +0 -1
  762. package/dist/esm/types/address.js +0 -2
  763. package/dist/esm/types/address.js.map +0 -1
  764. package/dist/esm/types/blockHeader.js +0 -2
  765. package/dist/esm/types/blockHeader.js.map +0 -1
  766. package/dist/esm/types/index.js +0 -4
  767. package/dist/esm/types/index.js.map +0 -1
  768. package/dist/esm/types/multisig.js +0 -2
  769. package/dist/esm/types/multisig.js.map +0 -1
  770. package/dist/esm/types/transactions/application.js +0 -2
  771. package/dist/esm/types/transactions/application.js.map +0 -1
  772. package/dist/esm/types/transactions/asset.js +0 -2
  773. package/dist/esm/types/transactions/asset.js.map +0 -1
  774. package/dist/esm/types/transactions/builder.js +0 -2
  775. package/dist/esm/types/transactions/builder.js.map +0 -1
  776. package/dist/esm/types/transactions/keyreg.js +0 -2
  777. package/dist/esm/types/transactions/keyreg.js.map +0 -1
  778. package/dist/esm/types/transactions/payment.js +0 -2
  779. package/dist/esm/types/transactions/payment.js.map +0 -1
  780. package/dist/esm/types/transactions/stateproof.js +0 -2
  781. package/dist/esm/types/transactions/stateproof.js.map +0 -1
  782. package/dist/types/bid.d.ts +0 -38
  783. package/dist/types/client/v2/basemodel.d.ts +0 -11
  784. package/dist/types/types/address.d.ts +0 -7
  785. package/dist/types/types/blockHeader.d.ts +0 -67
  786. package/dist/types/types/index.d.ts +0 -3
  787. package/dist/types/types/multisig.d.ts +0 -20
  788. package/dist/types/types/transactions/application.d.ts +0 -22
  789. package/dist/types/types/transactions/asset.d.ts +0 -28
  790. package/dist/types/types/transactions/builder.d.ts +0 -36
  791. package/dist/types/types/transactions/keyreg.d.ts +0 -8
  792. package/dist/types/types/transactions/payment.d.ts +0 -8
  793. package/dist/types/types/transactions/stateproof.d.ts +0 -8
  794. package/src/bid.ts +0 -96
  795. package/src/client/v2/basemodel.ts +0 -81
  796. package/src/types/address.ts +0 -7
  797. package/src/types/blockHeader.ts +0 -81
  798. package/src/types/index.ts +0 -3
  799. package/src/types/multisig.ts +0 -22
  800. package/src/types/transactions/application.ts +0 -111
  801. package/src/types/transactions/asset.ts +0 -108
  802. package/src/types/transactions/builder.ts +0 -69
  803. package/src/types/transactions/keyreg.ts +0 -23
  804. package/src/types/transactions/payment.ts +0 -14
  805. package/src/types/transactions/stateproof.ts +0 -17
@@ -1,642 +1,417 @@
1
- import * as txnBuilder from './transaction';
2
- import { OnApplicationComplete } from './types/transactions/base';
3
- import {
4
- // Utilities
5
- TransactionType, } from './types/transactions';
1
+ import { Transaction } from './transaction.js';
2
+ import { OnApplicationComplete, TransactionType, } from './types/transactions/base.js';
6
3
  /**
7
- * makePaymentTxnWithSuggestedParams takes payment arguments and returns a Transaction object
8
- * @param from - string representation of Algorand address of sender
9
- * @param to - string representation of Algorand address of recipient
10
- * @param amount - integer amount to send, in microAlgos
11
- * @param closeRemainderTo - optionally close out remaining account balance to this account, represented as string rep of Algorand address
12
- * @param note - uint8array of arbitrary data for sender to store
13
- * @param suggestedParams - a dict holding common-to-all-txns args:
14
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
15
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
16
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
17
- * firstRound - integer first protocol round on which this txn is valid
18
- * lastRound - integer last protocol round on which this txn is valid
19
- * genesisHash - string specifies hash genesis block of network in use
20
- * genesisID - string specifies genesis ID of network in use
21
- * @param rekeyTo - rekeyTo address, optional
4
+ * Create a new payment transaction
22
5
  *
23
- * @deprecated This function will be removed in v3 in favor of {@link makePaymentTxnWithSuggestedParamsFromObject}
6
+ * @param options - Payment transaction parameters
24
7
  */
25
- export function makePaymentTxnWithSuggestedParams(from, to, amount, closeRemainderTo, note, suggestedParams, rekeyTo) {
26
- const o = {
27
- from,
28
- to,
29
- amount,
30
- closeRemainderTo,
8
+ export function makePaymentTxnWithSuggestedParamsFromObject({ sender, receiver, amount, closeRemainderTo, suggestedParams, note, lease, rekeyTo, }) {
9
+ return new Transaction({
10
+ type: TransactionType.pay,
11
+ sender,
31
12
  note,
13
+ lease,
14
+ rekeyTo,
32
15
  suggestedParams,
33
- type: TransactionType.pay,
34
- reKeyTo: rekeyTo,
35
- };
36
- return new txnBuilder.Transaction(o);
37
- }
38
- // helper for above makePaymentTxnWithSuggestedParams, instead accepting an arguments object
39
- export function makePaymentTxnWithSuggestedParamsFromObject(o) {
40
- return makePaymentTxnWithSuggestedParams(o.from, o.to, o.amount, o.closeRemainderTo, o.note, o.suggestedParams, o.rekeyTo);
16
+ paymentParams: {
17
+ receiver,
18
+ amount,
19
+ closeRemainderTo,
20
+ },
21
+ });
41
22
  }
42
- export function makeKeyRegistrationTxnWithSuggestedParams(from, note, voteKey, selectionKey, voteFirst, voteLast, voteKeyDilution, suggestedParams, rekeyTo, nonParticipation = false, stateProofKey = undefined) {
43
- const o = {
44
- from,
23
+ /**
24
+ * Create a new key registration transaction
25
+ *
26
+ * @param options - Key registration transaction parameters
27
+ */
28
+ export function makeKeyRegistrationTxnWithSuggestedParamsFromObject({ sender, voteKey, selectionKey, stateProofKey, voteFirst, voteLast, voteKeyDilution, nonParticipation, suggestedParams, note, lease, rekeyTo, }) {
29
+ return new Transaction({
30
+ type: TransactionType.keyreg,
31
+ sender,
45
32
  note,
46
- voteKey,
47
- selectionKey,
48
- voteFirst,
49
- voteLast,
50
- voteKeyDilution,
33
+ lease,
34
+ rekeyTo,
51
35
  suggestedParams,
52
- type: TransactionType.keyreg,
53
- reKeyTo: rekeyTo,
54
- nonParticipation,
55
- stateProofKey,
56
- };
57
- return new txnBuilder.Transaction(o);
36
+ keyregParams: {
37
+ voteKey,
38
+ selectionKey,
39
+ stateProofKey,
40
+ voteFirst,
41
+ voteLast,
42
+ voteKeyDilution,
43
+ nonParticipation,
44
+ },
45
+ });
58
46
  }
59
- export function makeKeyRegistrationTxnWithSuggestedParamsFromObject(o) {
60
- return makeKeyRegistrationTxnWithSuggestedParams(o.from, o.note, o.voteKey, o.selectionKey, o.voteFirst, o.voteLast, o.voteKeyDilution, o.suggestedParams, o.rekeyTo, o.nonParticipation, o.stateProofKey);
61
- }
62
- /** makeAssetCreateTxnWithSuggestedParams takes asset creation arguments and returns a Transaction object
63
- * for creating that asset
64
- *
65
- * @param from - string representation of Algorand address of sender
66
- * @param note - uint8array of arbitrary data for sender to store
67
- * @param total - integer total supply of the asset
68
- * @param decimals - integer number of decimals for asset unit calculation
69
- * @param defaultFrozen - boolean whether asset accounts should default to being frozen
70
- * @param manager - string representation of Algorand address in charge of reserve, freeze, clawback, destruction, etc
71
- * @param reserve - string representation of Algorand address representing asset reserve
72
- * @param freeze - string representation of Algorand address with power to freeze/unfreeze asset holdings
73
- * @param clawback - string representation of Algorand address with power to revoke asset holdings
74
- * @param unitName - string units name for this asset
75
- * @param assetName - string name for this asset
76
- * @param assetURL - string URL relating to this asset
77
- * @param assetMetadataHash - Uint8Array or UTF-8 string representation of a hash commitment with respect to the asset. Must be exactly 32 bytes long.
78
- * @param suggestedParams - a dict holding common-to-all-txns args:
79
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
80
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
81
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
82
- * firstRound - integer first protocol round on which this txn is valid
83
- * lastRound - integer last protocol round on which this txn is valid
84
- * genesisHash - string specifies hash genesis block of network in use
85
- * genesisID - string specifies genesis ID of network in use
86
- * @param rekeyTo - rekeyTo address, optional
47
+ /**
48
+ * Base function for creating any type of asset config transaction.
87
49
  *
88
- * @deprecated This function will be removed in v3 in favor of {@link makeAssetCreateTxnWithSuggestedParamsFromObject}
50
+ * @param options - Asset config transaction parameters
89
51
  */
90
- export function makeAssetCreateTxnWithSuggestedParams(from, note, total, decimals, defaultFrozen, manager, reserve, freeze, clawback, unitName, assetName, assetURL, assetMetadataHash, suggestedParams, rekeyTo) {
91
- const o = {
92
- from,
52
+ export function makeBaseAssetConfigTxn({ sender, assetIndex, total, decimals, defaultFrozen, manager, reserve, freeze, clawback, unitName, assetName, assetURL, assetMetadataHash, note, lease, rekeyTo, suggestedParams, }) {
53
+ return new Transaction({
54
+ type: TransactionType.acfg,
55
+ sender,
93
56
  note,
57
+ lease,
58
+ rekeyTo,
94
59
  suggestedParams,
95
- assetTotal: total,
96
- assetDecimals: decimals,
97
- assetDefaultFrozen: defaultFrozen,
98
- assetUnitName: unitName,
60
+ assetConfigParams: {
61
+ assetIndex,
62
+ total,
63
+ decimals,
64
+ defaultFrozen,
65
+ manager,
66
+ reserve,
67
+ freeze,
68
+ clawback,
69
+ unitName,
70
+ assetName,
71
+ assetURL,
72
+ assetMetadataHash,
73
+ },
74
+ });
75
+ }
76
+ /**
77
+ * Create a new asset creation transaction
78
+ *
79
+ * @param options - Asset creation transaction parameters
80
+ */
81
+ export function makeAssetCreateTxnWithSuggestedParamsFromObject({ sender, total, decimals, defaultFrozen, manager, reserve, freeze, clawback, unitName, assetName, assetURL, assetMetadataHash, note, lease, rekeyTo, suggestedParams, }) {
82
+ return makeBaseAssetConfigTxn({
83
+ sender,
84
+ total,
85
+ decimals,
86
+ defaultFrozen,
87
+ manager,
88
+ reserve,
89
+ freeze,
90
+ clawback,
91
+ unitName,
99
92
  assetName,
100
93
  assetURL,
101
94
  assetMetadataHash,
102
- assetManager: manager,
103
- assetReserve: reserve,
104
- assetFreeze: freeze,
105
- assetClawback: clawback,
106
- type: TransactionType.acfg,
107
- reKeyTo: rekeyTo,
108
- };
109
- return new txnBuilder.Transaction(o);
110
- }
111
- // helper for above makeAssetCreateTxnWithSuggestedParams, instead accepting an arguments object
112
- export function makeAssetCreateTxnWithSuggestedParamsFromObject(o) {
113
- return makeAssetCreateTxnWithSuggestedParams(o.from, o.note, o.total, o.decimals, o.defaultFrozen, o.manager, o.reserve, o.freeze, o.clawback, o.unitName, o.assetName, o.assetURL, o.assetMetadataHash, o.suggestedParams, o.rekeyTo);
95
+ note,
96
+ lease,
97
+ rekeyTo,
98
+ suggestedParams,
99
+ });
114
100
  }
115
- /** makeAssetConfigTxnWithSuggestedParams can be issued by the asset manager to change the manager, reserve, freeze, or clawback
116
- * you must respecify existing addresses to keep them the same; leaving a field blank is the same as turning
117
- * that feature off for this asset
101
+ /**
102
+ * Create a new asset config transaction. This transaction can be issued by the asset manager to
103
+ * change the manager, reserve, freeze, or clawback address.
118
104
  *
119
- * @param from - string representation of Algorand address of sender
120
- * @param note - uint8array of arbitrary data for sender to store
121
- * @param assetIndex - int asset index uniquely specifying the asset
122
- * @param manager - string representation of new asset manager Algorand address
123
- * @param reserve - string representation of new reserve Algorand address
124
- * @param freeze - string representation of new freeze manager Algorand address
125
- * @param clawback - string representation of new revocation manager Algorand address
126
- * @param strictEmptyAddressChecking - boolean - throw an error if any of manager, reserve, freeze, or clawback are undefined. optional, defaults to true.
127
- * @param suggestedParams - a dict holding common-to-all-txns args:
128
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
129
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
130
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
131
- * firstRound - integer first protocol round on which this txn is valid
132
- * lastRound - integer last protocol round on which this txn is valid
133
- * genesisHash - string specifies hash genesis block of network in use
134
- * genesisID - string specifies genesis ID of network in use
135
- * @param rekeyTo - rekeyTo address, optional
105
+ * You must respecify existing addresses to keep them the same; leaving a field blank is the same as
106
+ * turning that feature off for this asset.
136
107
  *
137
- * @deprecated This function will be removed in v3 in favor of {@link makeAssetConfigTxnWithSuggestedParamsFromObject}
108
+ * @param options - Asset modification transaction parameters
138
109
  */
139
- export function makeAssetConfigTxnWithSuggestedParams(from, note, assetIndex, manager, reserve, freeze, clawback, suggestedParams, strictEmptyAddressChecking = true, rekeyTo) {
140
- if (strictEmptyAddressChecking &&
141
- (manager === undefined ||
142
- reserve === undefined ||
143
- freeze === undefined ||
144
- clawback === undefined)) {
145
- throw Error('strict empty address checking was turned on, but at least one empty address was provided');
110
+ export function makeAssetConfigTxnWithSuggestedParamsFromObject({ sender, assetIndex, manager, reserve, freeze, clawback, strictEmptyAddressChecking, note, lease, rekeyTo, suggestedParams, }) {
111
+ if (!assetIndex) {
112
+ throw Error('assetIndex must be provided');
146
113
  }
147
- const o = {
148
- from,
149
- suggestedParams,
114
+ const strictChecking = strictEmptyAddressChecking ?? true;
115
+ if (strictChecking &&
116
+ (manager == null || reserve == null || freeze == null || clawback == null)) {
117
+ throw Error('strictEmptyAddressChecking is enabled, but an address is empty. If this is intentional, set strictEmptyAddressChecking to false.');
118
+ }
119
+ return makeBaseAssetConfigTxn({
120
+ sender,
150
121
  assetIndex,
151
- assetManager: manager,
152
- assetReserve: reserve,
153
- assetFreeze: freeze,
154
- assetClawback: clawback,
155
- type: TransactionType.acfg,
122
+ manager,
123
+ reserve,
124
+ freeze,
125
+ clawback,
156
126
  note,
157
- reKeyTo: rekeyTo,
158
- };
159
- return new txnBuilder.Transaction(o);
160
- }
161
- // helper for above makeAssetConfigTxnWithSuggestedParams, instead accepting an arguments object
162
- export function makeAssetConfigTxnWithSuggestedParamsFromObject(o) {
163
- return makeAssetConfigTxnWithSuggestedParams(o.from, o.note, o.assetIndex, o.manager, o.reserve, o.freeze, o.clawback, o.suggestedParams, o.strictEmptyAddressChecking, o.rekeyTo);
127
+ lease,
128
+ rekeyTo,
129
+ suggestedParams,
130
+ });
164
131
  }
165
- /** makeAssetDestroyTxnWithSuggestedParams will allow the asset's manager to remove this asset from the ledger, so long
166
- * as all outstanding assets are held by the creator.
167
- *
168
- * @param from - string representation of Algorand address of sender
169
- * @param note - uint8array of arbitrary data for sender to store
170
- * @param assetIndex - int asset index uniquely specifying the asset
171
- * @param suggestedParams - a dict holding common-to-all-txns args:
172
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
173
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
174
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
175
- * firstRound - integer first protocol round on which this txn is valid
176
- * lastRound - integer last protocol round on which this txn is valid
177
- * genesisHash - string specifies hash genesis block of network in use
178
- * genesisID - string specifies genesis ID of network in use
179
- * @param rekeyTo - rekeyTo address, optional
132
+ /**
133
+ * Create a new asset destroy transaction. This will allow the asset's manager to remove this asset
134
+ * from the ledger, provided all outstanding assets are held by the creator.
180
135
  *
181
- * @deprecated This function will be removed in v3 in favor of {@link makeAssetDestroyTxnWithSuggestedParamsFromObject}
136
+ * @param options - Asset destroy transaction parameters
182
137
  */
183
- export function makeAssetDestroyTxnWithSuggestedParams(from, note, assetIndex, suggestedParams, rekeyTo) {
184
- const o = {
185
- from,
186
- suggestedParams,
138
+ export function makeAssetDestroyTxnWithSuggestedParamsFromObject({ sender, assetIndex, note, lease, rekeyTo, suggestedParams, }) {
139
+ if (!assetIndex) {
140
+ throw Error('assetIndex must be provided');
141
+ }
142
+ return makeBaseAssetConfigTxn({
143
+ sender,
187
144
  assetIndex,
188
- type: TransactionType.acfg,
189
145
  note,
190
- reKeyTo: rekeyTo,
191
- };
192
- return new txnBuilder.Transaction(o);
193
- }
194
- // helper for above makeAssetDestroyTxnWithSuggestedParams, instead accepting an arguments object
195
- export function makeAssetDestroyTxnWithSuggestedParamsFromObject(o) {
196
- return makeAssetDestroyTxnWithSuggestedParams(o.from, o.note, o.assetIndex, o.suggestedParams, o.rekeyTo);
146
+ lease,
147
+ rekeyTo,
148
+ suggestedParams,
149
+ });
197
150
  }
198
- /** makeAssetFreezeTxnWithSuggestedParams will allow the asset's freeze manager to freeze or un-freeze an account,
199
- * blocking or allowing asset transfers to and from the targeted account.
200
- *
201
- * @param from - string representation of Algorand address of sender
202
- * @param note - uint8array of arbitrary data for sender to store
203
- * @param assetIndex - int asset index uniquely specifying the asset
204
- * @param freezeTarget - string representation of Algorand address being frozen or unfrozen
205
- * @param freezeState - true if freezeTarget should be frozen, false if freezeTarget should be allowed to transact
206
- * @param suggestedParams - a dict holding common-to-all-txns args:
207
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
208
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
209
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
210
- * firstRound - integer first protocol round on which this txn is valid
211
- * lastRound - integer last protocol round on which this txn is valid
212
- * genesisHash - string specifies hash genesis block of network in use
213
- * genesisID - string specifies genesis ID of network in use
214
- * @param rekeyTo - rekeyTo address, optional
151
+ /**
152
+ * Create a new asset freeze transaction. This transaction allows the asset's freeze manager to
153
+ * freeze or un-freeze an account, blocking or allowing asset transfers to and from the targeted
154
+ * account.
215
155
  *
216
- * @deprecated This function will be removed in v3 in favor of {@link makeAssetFreezeTxnWithSuggestedParamsFromObject}
156
+ * @param options - Asset freeze transaction parameters
217
157
  */
218
- export function makeAssetFreezeTxnWithSuggestedParams(from, note, assetIndex, freezeTarget, freezeState, suggestedParams, rekeyTo) {
219
- const o = {
220
- from,
158
+ export function makeAssetFreezeTxnWithSuggestedParamsFromObject({ sender, assetIndex, freezeTarget, frozen, suggestedParams, note, lease, rekeyTo, }) {
159
+ return new Transaction({
221
160
  type: TransactionType.afrz,
222
- freezeAccount: freezeTarget,
223
- assetIndex,
224
- freezeState,
161
+ sender,
225
162
  note,
163
+ lease,
164
+ rekeyTo,
226
165
  suggestedParams,
227
- reKeyTo: rekeyTo,
228
- };
229
- return new txnBuilder.Transaction(o);
230
- }
231
- // helper for above makeAssetFreezeTxnWithSuggestedParams, instead accepting an arguments object
232
- export function makeAssetFreezeTxnWithSuggestedParamsFromObject(o) {
233
- return makeAssetFreezeTxnWithSuggestedParams(o.from, o.note, o.assetIndex, o.freezeTarget, o.freezeState, o.suggestedParams, o.rekeyTo);
166
+ assetFreezeParams: {
167
+ assetIndex,
168
+ freezeTarget,
169
+ frozen,
170
+ },
171
+ });
234
172
  }
235
- /** makeAssetTransferTxnWithSuggestedParams allows for the creation of an asset transfer transaction.
236
- * Special case: to begin accepting assets, set amount=0 and from=to.
173
+ /**
174
+ * Create a new asset transfer transaction.
237
175
  *
238
- * @param from - string representation of Algorand address of sender
239
- * @param to - string representation of Algorand address of asset recipient
240
- * @param closeRemainderTo - optional - string representation of Algorand address - if provided,
241
- * send all remaining assets after transfer to the "closeRemainderTo" address and close "from"'s asset holdings
242
- * @param revocationTarget - optional - string representation of Algorand address - if provided,
243
- * and if "from" is the asset's revocation manager, then deduct from "revocationTarget" rather than "from"
244
- * @param amount - integer amount of assets to send
245
- * @param note - uint8array of arbitrary data for sender to store
246
- * @param assetIndex - int asset index uniquely specifying the asset
247
- * @param suggestedParams - a dict holding common-to-all-txns args:
248
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
249
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
250
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
251
- * * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
252
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
253
- * firstRound - integer first protocol round on which this txn is valid
254
- * lastRound - integer last protocol round on which this txn is valid
255
- * genesisHash - string specifies hash genesis block of network in use
256
- * genesisID - string specifies genesis ID of network in use
257
- * @param rekeyTo - rekeyTo address, optional
176
+ * Special case: to opt into an assets, set amount=0 and sender=receiver.
258
177
  *
259
- * @deprecated This function will be removed in v3 in favor of {@link makeAssetTransferTxnWithSuggestedParamsFromObject}
178
+ * @param options - Asset transfer transaction parameters
260
179
  */
261
- export function makeAssetTransferTxnWithSuggestedParams(from, to, closeRemainderTo, revocationTarget, amount, note, assetIndex, suggestedParams, rekeyTo) {
262
- const o = {
180
+ export function makeAssetTransferTxnWithSuggestedParamsFromObject({ sender, receiver, amount, closeRemainderTo, assetSender, note, assetIndex, suggestedParams, rekeyTo, lease, }) {
181
+ if (!assetIndex) {
182
+ throw Error('assetIndex must be provided');
183
+ }
184
+ return new Transaction({
263
185
  type: TransactionType.axfer,
264
- from,
265
- to,
266
- amount,
267
- suggestedParams,
268
- assetIndex,
186
+ sender,
269
187
  note,
270
- assetRevocationTarget: revocationTarget,
271
- closeRemainderTo,
272
- reKeyTo: rekeyTo,
273
- };
274
- return new txnBuilder.Transaction(o);
275
- }
276
- // helper for above makeAssetTransferTxnWithSuggestedParams, instead accepting an arguments object
277
- export function makeAssetTransferTxnWithSuggestedParamsFromObject(o) {
278
- return makeAssetTransferTxnWithSuggestedParams(o.from, o.to, o.closeRemainderTo, o.revocationTarget, o.amount, o.note, o.assetIndex, o.suggestedParams, o.rekeyTo);
188
+ lease,
189
+ rekeyTo,
190
+ suggestedParams,
191
+ assetTransferParams: {
192
+ assetIndex,
193
+ receiver,
194
+ amount,
195
+ assetSender,
196
+ closeRemainderTo,
197
+ },
198
+ });
279
199
  }
280
200
  /**
281
- * Make a transaction that will create an application.
282
- * @param from - address of sender
283
- * @param suggestedParams - a dict holding common-to-all-txns args:
284
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
285
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
286
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
287
- * firstRound - integer first protocol round on which this txn is valid
288
- * lastRound - integer last protocol round on which this txn is valid
289
- * genesisHash - string specifies hash genesis block of network in use
290
- * genesisID - string specifies genesis ID of network in use
291
- * @param onComplete - algosdk.OnApplicationComplete, what application should do once the program is done being run
292
- * @param approvalProgram - Uint8Array, the compiled TEAL that approves a transaction
293
- * @param clearProgram - Uint8Array, the compiled TEAL that runs when clearing state
294
- * @param numLocalInts - restricts number of ints in per-user local state
295
- * @param numLocalByteSlices - restricts number of byte slices in per-user local state
296
- * @param numGlobalInts - restricts number of ints in global state
297
- * @param numGlobalByteSlices - restricts number of byte slices in global state
298
- * @param appArgs - Array of Uint8Array, any additional arguments to the application
299
- * @param accounts - Array of Address strings, any additional accounts to supply to the application
300
- * @param foreignApps - Array of int, any other apps used by the application, identified by index
301
- * @param foreignAssets - Array of int, any assets used by the application, identified by index
302
- * @param note - Arbitrary data for sender to store
303
- * @param lease - Lease a transaction
304
- * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
305
- * @param extraPages - integer extra pages of memory to rent on creation of application
306
- * @param boxes - Array of BoxReference, app ID and name of box to be accessed
201
+ * Base function for creating any application call transaction.
307
202
  *
308
- * @deprecated This function will be removed in v3 in favor of {@link makeApplicationCreateTxnFromObject}
203
+ * @param options - Application call transaction parameters
309
204
  */
310
- export function makeApplicationCreateTxn(from, suggestedParams, onComplete, approvalProgram, clearProgram, numLocalInts, numLocalByteSlices, numGlobalInts, numGlobalByteSlices, appArgs, accounts, foreignApps, foreignAssets, note, lease, rekeyTo, extraPages, boxes) {
311
- const o = {
205
+ export function makeApplicationCallTxnFromObject({ sender, appIndex, onComplete, appArgs, accounts, foreignApps, foreignAssets, boxes, approvalProgram, clearProgram, numLocalInts, numLocalByteSlices, numGlobalInts, numGlobalByteSlices, extraPages, note, lease, rekeyTo, suggestedParams, }) {
206
+ if (onComplete == null) {
207
+ throw Error('onComplete must be provided');
208
+ }
209
+ return new Transaction({
312
210
  type: TransactionType.appl,
313
- from,
211
+ sender,
212
+ note,
213
+ lease,
214
+ rekeyTo,
314
215
  suggestedParams,
216
+ appCallParams: {
217
+ appIndex,
218
+ onComplete,
219
+ appArgs,
220
+ accounts,
221
+ foreignAssets,
222
+ foreignApps,
223
+ boxes,
224
+ approvalProgram,
225
+ clearProgram,
226
+ numLocalInts,
227
+ numLocalByteSlices,
228
+ numGlobalInts,
229
+ numGlobalByteSlices,
230
+ extraPages,
231
+ },
232
+ });
233
+ }
234
+ /**
235
+ * Make a transaction that will create an application.
236
+ *
237
+ * @param options - Application creation transaction parameters
238
+ */
239
+ export function makeApplicationCreateTxnFromObject({ sender, onComplete, appArgs, accounts, foreignApps, foreignAssets, boxes, approvalProgram, clearProgram, numLocalInts, numLocalByteSlices, numGlobalInts, numGlobalByteSlices, extraPages, note, lease, rekeyTo, suggestedParams, }) {
240
+ if (!approvalProgram || !clearProgram) {
241
+ throw Error('approvalProgram and clearProgram must be provided');
242
+ }
243
+ if (onComplete == null) {
244
+ throw Error('onComplete must be provided');
245
+ }
246
+ return makeApplicationCallTxnFromObject({
247
+ sender,
315
248
  appIndex: 0,
316
- appOnComplete: onComplete,
317
- appLocalInts: numLocalInts,
318
- appLocalByteSlices: numLocalByteSlices,
319
- appGlobalInts: numGlobalInts,
320
- appGlobalByteSlices: numGlobalByteSlices,
321
- appApprovalProgram: approvalProgram,
322
- appClearProgram: clearProgram,
249
+ onComplete,
323
250
  appArgs,
324
- appAccounts: accounts,
325
- appForeignApps: foreignApps,
326
- appForeignAssets: foreignAssets,
251
+ accounts,
252
+ foreignApps,
253
+ foreignAssets,
327
254
  boxes,
255
+ approvalProgram,
256
+ clearProgram,
257
+ numLocalInts,
258
+ numLocalByteSlices,
259
+ numGlobalInts,
260
+ numGlobalByteSlices,
261
+ extraPages,
328
262
  note,
329
263
  lease,
330
- reKeyTo: rekeyTo,
331
- extraPages,
332
- };
333
- return new txnBuilder.Transaction(o);
334
- }
335
- // helper for above makeApplicationCreateTxn, instead accepting an arguments object
336
- export function makeApplicationCreateTxnFromObject(o) {
337
- return makeApplicationCreateTxn(o.from, o.suggestedParams, o.onComplete, o.approvalProgram, o.clearProgram, o.numLocalInts, o.numLocalByteSlices, o.numGlobalInts, o.numGlobalByteSlices, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.extraPages, o.boxes);
264
+ rekeyTo,
265
+ suggestedParams,
266
+ });
338
267
  }
339
268
  /**
340
269
  * Make a transaction that changes an application's approval and clear programs
341
- * @param from - address of sender
342
- * @param suggestedParams - a dict holding common-to-all-txns args:
343
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
344
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
345
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
346
- * firstRound - integer first protocol round on which this txn is valid
347
- * lastRound - integer last protocol round on which this txn is valid
348
- * genesisHash - string specifies hash genesis block of network in use
349
- * genesisID - string specifies genesis ID of network in use
350
- * @param appIndex - the ID of the app to be updated
351
- * @param approvalProgram - Uint8Array, the compiled TEAL that approves a transaction
352
- * @param clearProgram - Uint8Array, the compiled TEAL that runs when clearing state
353
- * @param appArgs - Array of Uint8Array, any additional arguments to the application
354
- * @param accounts - Array of Address strings, any additional accounts to supply to the application
355
- * @param foreignApps - Array of int, any other apps used by the application, identified by index
356
- * @param foreignAssets - Array of int, any assets used by the application, identified by index
357
- * @param note - Arbitrary data for sender to store
358
- * @param lease - Lease a transaction
359
- * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
360
- * @param boxes - Array of BoxReference, app ID and name of box to be accessed
361
270
  *
362
- * @deprecated This function will be removed in v3 in favor of {@link makeApplicationUpdateTxnFromObject}
271
+ * @param options - Application update transaction parameters
363
272
  */
364
- export function makeApplicationUpdateTxn(from, suggestedParams, appIndex, approvalProgram, clearProgram, appArgs, accounts, foreignApps, foreignAssets, note, lease, rekeyTo, boxes) {
365
- const o = {
366
- type: TransactionType.appl,
367
- from,
368
- suggestedParams,
273
+ export function makeApplicationUpdateTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, approvalProgram, clearProgram, note, lease, rekeyTo, suggestedParams, }) {
274
+ if (!appIndex) {
275
+ throw Error('appIndex must be provided');
276
+ }
277
+ if (!approvalProgram || !clearProgram) {
278
+ throw Error('approvalProgram and clearProgram must be provided');
279
+ }
280
+ return makeApplicationCallTxnFromObject({
281
+ sender,
369
282
  appIndex,
370
- appApprovalProgram: approvalProgram,
371
- appOnComplete: OnApplicationComplete.UpdateApplicationOC,
372
- appClearProgram: clearProgram,
283
+ onComplete: OnApplicationComplete.UpdateApplicationOC,
373
284
  appArgs,
374
- appAccounts: accounts,
375
- appForeignApps: foreignApps,
376
- appForeignAssets: foreignAssets,
285
+ accounts,
286
+ foreignApps,
287
+ foreignAssets,
377
288
  boxes,
289
+ approvalProgram,
290
+ clearProgram,
378
291
  note,
379
292
  lease,
380
- reKeyTo: rekeyTo,
381
- };
382
- return new txnBuilder.Transaction(o);
383
- }
384
- // helper for above makeApplicationUpdateTxn, instead accepting an arguments object
385
- export function makeApplicationUpdateTxnFromObject(o) {
386
- return makeApplicationUpdateTxn(o.from, o.suggestedParams, o.appIndex, o.approvalProgram, o.clearProgram, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
293
+ rekeyTo,
294
+ suggestedParams,
295
+ });
387
296
  }
388
297
  /**
389
298
  * Make a transaction that deletes an application
390
- * @param from - address of sender
391
- * @param suggestedParams - a dict holding common-to-all-txns args:
392
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
393
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
394
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
395
- * firstRound - integer first protocol round on which this txn is valid
396
- * lastRound - integer last protocol round on which this txn is valid
397
- * genesisHash - string specifies hash genesis block of network in use
398
- * genesisID - string specifies genesis ID of network in use
399
- * @param appIndex - the ID of the app to be deleted
400
- * @param appArgs - Array of Uint8Array, any additional arguments to the application
401
- * @param accounts - Array of Address strings, any additional accounts to supply to the application
402
- * @param foreignApps - Array of int, any other apps used by the application, identified by index
403
- * @param foreignAssets - Array of int, any assets used by the application, identified by index
404
- * @param note - Arbitrary data for sender to store
405
- * @param lease - Lease a transaction
406
- * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
407
- * @param boxes - Array of BoxReference, app ID and name of box to be accessed
408
299
  *
409
- * @deprecated This function will be removed in v3 in favor of {@link makeApplicationDeleteTxnFromObject}
300
+ * @param options - Application deletion transaction parameters
410
301
  */
411
- export function makeApplicationDeleteTxn(from, suggestedParams, appIndex, appArgs, accounts, foreignApps, foreignAssets, note, lease, rekeyTo, boxes) {
412
- const o = {
413
- type: TransactionType.appl,
414
- from,
415
- suggestedParams,
302
+ export function makeApplicationDeleteTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, note, lease, rekeyTo, suggestedParams, }) {
303
+ if (!appIndex) {
304
+ throw Error('appIndex must be provided');
305
+ }
306
+ return makeApplicationCallTxnFromObject({
307
+ sender,
416
308
  appIndex,
417
- appOnComplete: OnApplicationComplete.DeleteApplicationOC,
309
+ onComplete: OnApplicationComplete.DeleteApplicationOC,
418
310
  appArgs,
419
- appAccounts: accounts,
420
- appForeignApps: foreignApps,
421
- appForeignAssets: foreignAssets,
311
+ accounts,
312
+ foreignApps,
313
+ foreignAssets,
422
314
  boxes,
423
315
  note,
424
316
  lease,
425
- reKeyTo: rekeyTo,
426
- };
427
- return new txnBuilder.Transaction(o);
428
- }
429
- // helper for above makeApplicationDeleteTxn, instead accepting an arguments object
430
- export function makeApplicationDeleteTxnFromObject(o) {
431
- return makeApplicationDeleteTxn(o.from, o.suggestedParams, o.appIndex, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
317
+ rekeyTo,
318
+ suggestedParams,
319
+ });
432
320
  }
433
321
  /**
434
322
  * Make a transaction that opts in to use an application
435
- * @param from - address of sender
436
- * @param suggestedParams - a dict holding common-to-all-txns args:
437
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
438
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
439
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
440
- * firstRound - integer first protocol round on which this txn is valid
441
- * lastRound - integer last protocol round on which this txn is valid
442
- * genesisHash - string specifies hash genesis block of network in use
443
- * genesisID - string specifies genesis ID of network in use
444
- * @param appIndex - the ID of the app to join
445
- * @param appArgs - Array of Uint8Array, any additional arguments to the application
446
- * @param accounts - Array of Address strings, any additional accounts to supply to the application
447
- * @param foreignApps - Array of int, any other apps used by the application, identified by index
448
- * @param foreignAssets - Array of int, any assets used by the application, identified by index
449
- * @param note - Arbitrary data for sender to store
450
- * @param lease - Lease a transaction
451
- * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
452
- * @param boxes - Array of BoxReference, app ID and name of box to be accessed
453
323
  *
454
- * @deprecated This function will be removed in v3 in favor of {@link makeApplicationOptInTxnFromObject}
324
+ * @param options - Application opt-in transaction parameters
455
325
  */
456
- export function makeApplicationOptInTxn(from, suggestedParams, appIndex, appArgs, accounts, foreignApps, foreignAssets, note, lease, rekeyTo, boxes) {
457
- const o = {
458
- type: TransactionType.appl,
459
- from,
460
- suggestedParams,
326
+ export function makeApplicationOptInTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, note, lease, rekeyTo, suggestedParams, }) {
327
+ if (!appIndex) {
328
+ throw Error('appIndex must be provided');
329
+ }
330
+ return makeApplicationCallTxnFromObject({
331
+ sender,
461
332
  appIndex,
462
- appOnComplete: OnApplicationComplete.OptInOC,
333
+ onComplete: OnApplicationComplete.OptInOC,
463
334
  appArgs,
464
- appAccounts: accounts,
465
- appForeignApps: foreignApps,
466
- appForeignAssets: foreignAssets,
335
+ accounts,
336
+ foreignApps,
337
+ foreignAssets,
467
338
  boxes,
468
339
  note,
469
340
  lease,
470
- reKeyTo: rekeyTo,
471
- };
472
- return new txnBuilder.Transaction(o);
473
- }
474
- // helper for above makeApplicationOptInTxn, instead accepting an argument object
475
- export function makeApplicationOptInTxnFromObject(o) {
476
- return makeApplicationOptInTxn(o.from, o.suggestedParams, o.appIndex, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
341
+ rekeyTo,
342
+ suggestedParams,
343
+ });
477
344
  }
478
345
  /**
479
346
  * Make a transaction that closes out a user's state in an application
480
- * @param from - address of sender
481
- * @param suggestedParams - a dict holding common-to-all-txns args:
482
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
483
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
484
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
485
- * firstRound - integer first protocol round on which this txn is valid
486
- * lastRound - integer last protocol round on which this txn is valid
487
- * genesisHash - string specifies hash genesis block of network in use
488
- * genesisID - string specifies genesis ID of network in use
489
- * @param appIndex - the ID of the app to use
490
- * @param appArgs - Array of Uint8Array, any additional arguments to the application
491
- * @param accounts - Array of Address strings, any additional accounts to supply to the application
492
- * @param foreignApps - Array of int, any other apps used by the application, identified by index
493
- * @param foreignAssets - Array of int, any assets used by the application, identified by index
494
- * @param note - Arbitrary data for sender to store
495
- * @param lease - Lease a transaction
496
- * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
497
- * @param boxes - Array of BoxReference, app ID and name of box to be accessed
498
347
  *
499
- * @deprecated This function will be removed in v3 in favor of {@link makeApplicationCloseOutTxnFromObject}
348
+ * @param options - Application close-out transaction parameters
500
349
  */
501
- export function makeApplicationCloseOutTxn(from, suggestedParams, appIndex, appArgs, accounts, foreignApps, foreignAssets, note, lease, rekeyTo, boxes) {
502
- const o = {
503
- type: TransactionType.appl,
504
- from,
505
- suggestedParams,
350
+ export function makeApplicationCloseOutTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, note, lease, rekeyTo, suggestedParams, }) {
351
+ if (!appIndex) {
352
+ throw Error('appIndex must be provided');
353
+ }
354
+ return makeApplicationCallTxnFromObject({
355
+ sender,
506
356
  appIndex,
507
- appOnComplete: OnApplicationComplete.CloseOutOC,
357
+ onComplete: OnApplicationComplete.CloseOutOC,
508
358
  appArgs,
509
- appAccounts: accounts,
510
- appForeignApps: foreignApps,
511
- appForeignAssets: foreignAssets,
359
+ accounts,
360
+ foreignApps,
361
+ foreignAssets,
512
362
  boxes,
513
363
  note,
514
364
  lease,
515
- reKeyTo: rekeyTo,
516
- };
517
- return new txnBuilder.Transaction(o);
518
- }
519
- // helper for above makeApplicationCloseOutTxn, instead accepting an argument object
520
- export function makeApplicationCloseOutTxnFromObject(o) {
521
- return makeApplicationCloseOutTxn(o.from, o.suggestedParams, o.appIndex, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
365
+ rekeyTo,
366
+ suggestedParams,
367
+ });
522
368
  }
523
369
  /**
524
370
  * Make a transaction that clears a user's state in an application
525
- * @param from - address of sender
526
- * @param suggestedParams - a dict holding common-to-all-txns args:
527
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
528
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
529
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
530
- * firstRound - integer first protocol round on which this txn is valid
531
- * lastRound - integer last protocol round on which this txn is valid
532
- * genesisHash - string specifies hash genesis block of network in use
533
- * genesisID - string specifies genesis ID of network in use
534
- * @param appIndex - the ID of the app to use
535
- * @param appArgs - Array of Uint8Array, any additional arguments to the application
536
- * @param accounts - Array of Address strings, any additional accounts to supply to the application
537
- * @param foreignApps - Array of int, any other apps used by the application, identified by index
538
- * @param foreignAssets - Array of int, any assets used by the application, identified by index
539
- * @param note - Arbitrary data for sender to store
540
- * @param lease - Lease a transaction
541
- * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
542
- * @param boxes - Array of BoxReference, app ID and name of box to be accessed
543
371
  *
544
- * @deprecated This function will be removed in v3 in favor of {@link makeApplicationClearStateTxnFromObject}
372
+ * @param options - Application clear state transaction parameters
545
373
  */
546
- export function makeApplicationClearStateTxn(from, suggestedParams, appIndex, appArgs, accounts, foreignApps, foreignAssets, note, lease, rekeyTo, boxes) {
547
- const o = {
548
- type: TransactionType.appl,
549
- from,
550
- suggestedParams,
374
+ export function makeApplicationClearStateTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, note, lease, rekeyTo, suggestedParams, }) {
375
+ if (!appIndex) {
376
+ throw Error('appIndex must be provided');
377
+ }
378
+ return makeApplicationCallTxnFromObject({
379
+ sender,
551
380
  appIndex,
552
- appOnComplete: OnApplicationComplete.ClearStateOC,
381
+ onComplete: OnApplicationComplete.ClearStateOC,
553
382
  appArgs,
554
- appAccounts: accounts,
555
- appForeignApps: foreignApps,
556
- appForeignAssets: foreignAssets,
383
+ accounts,
384
+ foreignApps,
385
+ foreignAssets,
557
386
  boxes,
558
387
  note,
559
388
  lease,
560
- reKeyTo: rekeyTo,
561
- };
562
- return new txnBuilder.Transaction(o);
563
- }
564
- // helper for above makeApplicationClearStateTxn, instead accepting an argument object
565
- export function makeApplicationClearStateTxnFromObject(o) {
566
- return makeApplicationClearStateTxn(o.from, o.suggestedParams, o.appIndex, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
389
+ rekeyTo,
390
+ suggestedParams,
391
+ });
567
392
  }
568
393
  /**
569
394
  * Make a transaction that just calls an application, doing nothing on completion
570
- * @param from - address of sender
571
- * @param suggestedParams - a dict holding common-to-all-txns args:
572
- * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
573
- * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
574
- * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
575
- * firstRound - integer first protocol round on which this txn is valid
576
- * lastRound - integer last protocol round on which this txn is valid
577
- * genesisHash - string specifies hash genesis block of network in use
578
- * genesisID - string specifies genesis ID of network in use
579
- * @param appIndex - the ID of the app to use
580
- * @param appArgs - Array of Uint8Array, any additional arguments to the application
581
- * @param accounts - Array of Address strings, any additional accounts to supply to the application
582
- * @param foreignApps - Array of int, any other apps used by the application, identified by index
583
- * @param foreignAssets - Array of int, any assets used by the application, identified by index
584
- * @param note - Arbitrary data for sender to store
585
- * @param lease - Lease a transaction
586
- * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
587
- * @param boxes - Array of BoxReference, app ID and name of box to be accessed
588
395
  *
589
- * @deprecated This function will be removed in v3 in favor of {@link makeApplicationNoOpTxnFromObject}
396
+ * @param options - Application no-op transaction parameters
590
397
  */
591
- export function makeApplicationNoOpTxn(from, suggestedParams, appIndex, appArgs, accounts, foreignApps, foreignAssets, note, lease, rekeyTo, boxes) {
592
- const o = {
593
- type: TransactionType.appl,
594
- from,
595
- suggestedParams,
398
+ export function makeApplicationNoOpTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, note, lease, rekeyTo, suggestedParams, }) {
399
+ if (!appIndex) {
400
+ throw Error('appIndex must be provided');
401
+ }
402
+ return makeApplicationCallTxnFromObject({
403
+ sender,
596
404
  appIndex,
597
- appOnComplete: OnApplicationComplete.NoOpOC,
405
+ onComplete: OnApplicationComplete.NoOpOC,
598
406
  appArgs,
599
- appAccounts: accounts,
600
- appForeignApps: foreignApps,
601
- appForeignAssets: foreignAssets,
407
+ accounts,
408
+ foreignApps,
409
+ foreignAssets,
602
410
  boxes,
603
411
  note,
604
412
  lease,
605
- reKeyTo: rekeyTo,
606
- };
607
- return new txnBuilder.Transaction(o);
608
- }
609
- // helper for above makeApplicationNoOpTxn, instead accepting an argument object
610
- export function makeApplicationNoOpTxnFromObject(o) {
611
- return makeApplicationNoOpTxn(o.from, o.suggestedParams, o.appIndex, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
612
- }
613
- export { OnApplicationComplete } from './types/transactions/base';
614
- /**
615
- * Generic function for creating any application call transaction.
616
- */
617
- export function makeApplicationCallTxnFromObject(options) {
618
- const o = {
619
- type: TransactionType.appl,
620
- from: options.from,
621
- suggestedParams: options.suggestedParams,
622
- appIndex: options.appIndex,
623
- appOnComplete: options.onComplete,
624
- appLocalInts: options.numLocalInts,
625
- appLocalByteSlices: options.numLocalByteSlices,
626
- appGlobalInts: options.numGlobalInts,
627
- appGlobalByteSlices: options.numGlobalByteSlices,
628
- appApprovalProgram: options.approvalProgram,
629
- appClearProgram: options.clearProgram,
630
- appArgs: options.appArgs,
631
- appAccounts: options.accounts,
632
- appForeignApps: options.foreignApps,
633
- appForeignAssets: options.foreignAssets,
634
- boxes: options.boxes,
635
- note: options.note,
636
- lease: options.lease,
637
- reKeyTo: options.rekeyTo,
638
- extraPages: options.extraPages,
639
- };
640
- return new txnBuilder.Transaction(o);
413
+ rekeyTo,
414
+ suggestedParams,
415
+ });
641
416
  }
642
417
  //# sourceMappingURL=makeTxn.js.map