algosdk 1.23.2 → 1.24.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 (909) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/abi/abi_type.js +693 -0
  5. package/dist/cjs/abi/abi_type.js.map +1 -0
  6. package/dist/cjs/{src/abi → abi}/contract.js +0 -0
  7. package/dist/cjs/abi/contract.js.map +1 -0
  8. package/dist/cjs/{src/abi → abi}/index.js +0 -0
  9. package/dist/cjs/abi/index.js.map +1 -0
  10. package/dist/cjs/{src/abi → abi}/interface.js +0 -0
  11. package/dist/cjs/abi/interface.js.map +1 -0
  12. package/dist/cjs/{src/abi → abi}/method.js +0 -0
  13. package/dist/cjs/abi/method.js.map +1 -0
  14. package/dist/cjs/{src/abi → abi}/reference.js +0 -0
  15. package/dist/cjs/abi/reference.js.map +1 -0
  16. package/dist/cjs/{src/abi → abi}/transaction.js +0 -0
  17. package/dist/cjs/abi/transaction.js.map +1 -0
  18. package/dist/cjs/{src/account.js → account.js} +0 -0
  19. package/dist/cjs/account.js.map +1 -0
  20. package/dist/cjs/{src/bid.js → bid.js} +0 -0
  21. package/dist/cjs/bid.js.map +1 -0
  22. package/dist/cjs/{src/boxStorage.js → boxStorage.js} +0 -0
  23. package/dist/cjs/boxStorage.js.map +1 -0
  24. package/dist/cjs/{src/client → client}/algod.js +0 -0
  25. package/dist/cjs/client/algod.js.map +1 -0
  26. package/dist/cjs/{src/client → client}/baseHTTPClient.js +0 -0
  27. package/dist/cjs/client/baseHTTPClient.js.map +1 -0
  28. package/dist/cjs/{src/client → client}/client.js +0 -0
  29. package/dist/cjs/client/client.js.map +1 -0
  30. package/dist/cjs/{src/client → client}/kmd.js +0 -0
  31. package/dist/cjs/client/kmd.js.map +1 -0
  32. package/dist/cjs/{src/client → client}/urlTokenBaseHTTPClient.js +0 -0
  33. package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -0
  34. package/dist/cjs/{src/client → client}/v2/algod/accountApplicationInformation.js +0 -0
  35. package/dist/cjs/client/v2/algod/accountApplicationInformation.js.map +1 -0
  36. package/dist/cjs/{src/client → client}/v2/algod/accountAssetInformation.js +0 -0
  37. package/dist/cjs/client/v2/algod/accountAssetInformation.js.map +1 -0
  38. package/dist/cjs/{src/client → client}/v2/algod/accountInformation.js +0 -0
  39. package/dist/cjs/client/v2/algod/accountInformation.js.map +1 -0
  40. package/dist/cjs/{src/client → client}/v2/algod/algod.js +0 -0
  41. package/dist/cjs/client/v2/algod/algod.js.map +1 -0
  42. package/dist/cjs/{src/client → client}/v2/algod/block.js +0 -0
  43. package/dist/cjs/client/v2/algod/block.js.map +1 -0
  44. package/dist/cjs/{src/client → client}/v2/algod/compile.js +0 -0
  45. package/dist/cjs/client/v2/algod/compile.js.map +1 -0
  46. package/dist/cjs/{src/client → client}/v2/algod/dryrun.js +0 -0
  47. package/dist/cjs/client/v2/algod/dryrun.js.map +1 -0
  48. package/dist/cjs/{src/client → client}/v2/algod/genesis.js +0 -0
  49. package/dist/cjs/client/v2/algod/genesis.js.map +1 -0
  50. package/dist/cjs/{src/client → client}/v2/algod/getApplicationBoxByName.js +0 -0
  51. package/dist/cjs/client/v2/algod/getApplicationBoxByName.js.map +1 -0
  52. package/dist/cjs/{src/client → client}/v2/algod/getApplicationBoxes.js +0 -0
  53. package/dist/cjs/client/v2/algod/getApplicationBoxes.js.map +1 -0
  54. package/dist/cjs/{src/client → client}/v2/algod/getApplicationByID.js +0 -0
  55. package/dist/cjs/client/v2/algod/getApplicationByID.js.map +1 -0
  56. package/dist/cjs/{src/client → client}/v2/algod/getAssetByID.js +0 -0
  57. package/dist/cjs/client/v2/algod/getAssetByID.js.map +1 -0
  58. package/dist/cjs/{src/client → client}/v2/algod/getBlockHash.js +0 -0
  59. package/dist/cjs/client/v2/algod/getBlockHash.js.map +1 -0
  60. package/dist/cjs/{src/client → client}/v2/algod/getTransactionProof.js +0 -0
  61. package/dist/cjs/client/v2/algod/getTransactionProof.js.map +1 -0
  62. package/dist/cjs/{src/client → client}/v2/algod/healthCheck.js +0 -0
  63. package/dist/cjs/client/v2/algod/healthCheck.js.map +1 -0
  64. package/dist/cjs/{src/client → client}/v2/algod/lightBlockHeaderProof.js +0 -0
  65. package/dist/cjs/client/v2/algod/lightBlockHeaderProof.js.map +1 -0
  66. package/dist/cjs/client/v2/algod/models/types.js +2047 -0
  67. package/dist/cjs/client/v2/algod/models/types.js.map +1 -0
  68. package/dist/cjs/{src/client → client}/v2/algod/pendingTransactionInformation.js +0 -0
  69. package/dist/cjs/client/v2/algod/pendingTransactionInformation.js.map +1 -0
  70. package/dist/cjs/{src/client → client}/v2/algod/pendingTransactions.js +0 -0
  71. package/dist/cjs/client/v2/algod/pendingTransactions.js.map +1 -0
  72. package/dist/cjs/{src/client → client}/v2/algod/pendingTransactionsByAddress.js +0 -0
  73. package/dist/cjs/client/v2/algod/pendingTransactionsByAddress.js.map +1 -0
  74. package/dist/cjs/{src/client → client}/v2/algod/sendRawTransaction.js +0 -0
  75. package/dist/cjs/client/v2/algod/sendRawTransaction.js.map +1 -0
  76. package/dist/cjs/{src/client → client}/v2/algod/stateproof.js +0 -0
  77. package/dist/cjs/client/v2/algod/stateproof.js.map +1 -0
  78. package/dist/cjs/{src/client → client}/v2/algod/status.js +0 -0
  79. package/dist/cjs/client/v2/algod/status.js.map +1 -0
  80. package/dist/cjs/{src/client → client}/v2/algod/statusAfterBlock.js +0 -0
  81. package/dist/cjs/client/v2/algod/statusAfterBlock.js.map +1 -0
  82. package/dist/cjs/{src/client → client}/v2/algod/suggestedParams.js +0 -0
  83. package/dist/cjs/client/v2/algod/suggestedParams.js.map +1 -0
  84. package/dist/cjs/{src/client → client}/v2/algod/supply.js +0 -0
  85. package/dist/cjs/client/v2/algod/supply.js.map +1 -0
  86. package/dist/cjs/{src/client → client}/v2/algod/versions.js +0 -0
  87. package/dist/cjs/client/v2/algod/versions.js.map +1 -0
  88. package/dist/cjs/{src/client → client}/v2/basemodel.js +0 -0
  89. package/dist/cjs/client/v2/basemodel.js.map +1 -0
  90. package/dist/cjs/{src/client → client}/v2/indexer/indexer.js +0 -0
  91. package/dist/cjs/client/v2/indexer/indexer.js.map +1 -0
  92. package/dist/cjs/{src/client → client}/v2/indexer/lookupAccountAppLocalStates.js +0 -0
  93. package/dist/cjs/client/v2/indexer/lookupAccountAppLocalStates.js.map +1 -0
  94. package/dist/cjs/{src/client → client}/v2/indexer/lookupAccountAssets.js +0 -0
  95. package/dist/cjs/client/v2/indexer/lookupAccountAssets.js.map +1 -0
  96. package/dist/cjs/{src/client → client}/v2/indexer/lookupAccountByID.js +0 -0
  97. package/dist/cjs/client/v2/indexer/lookupAccountByID.js.map +1 -0
  98. package/dist/cjs/{src/client → client}/v2/indexer/lookupAccountCreatedApplications.js +0 -0
  99. package/dist/cjs/client/v2/indexer/lookupAccountCreatedApplications.js.map +1 -0
  100. package/dist/cjs/{src/client → client}/v2/indexer/lookupAccountCreatedAssets.js +0 -0
  101. package/dist/cjs/client/v2/indexer/lookupAccountCreatedAssets.js.map +1 -0
  102. package/dist/cjs/{src/client → client}/v2/indexer/lookupAccountTransactions.js +0 -0
  103. package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js.map +1 -0
  104. package/dist/cjs/{src/client → client}/v2/indexer/lookupApplicationBoxByIDandName.js +0 -0
  105. package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -0
  106. package/dist/cjs/{src/client → client}/v2/indexer/lookupApplicationLogs.js +0 -0
  107. package/dist/cjs/client/v2/indexer/lookupApplicationLogs.js.map +1 -0
  108. package/dist/cjs/{src/client → client}/v2/indexer/lookupApplications.js +0 -0
  109. package/dist/cjs/client/v2/indexer/lookupApplications.js.map +1 -0
  110. package/dist/cjs/{src/client → client}/v2/indexer/lookupAssetBalances.js +0 -0
  111. package/dist/cjs/client/v2/indexer/lookupAssetBalances.js.map +1 -0
  112. package/dist/cjs/{src/client → client}/v2/indexer/lookupAssetByID.js +0 -0
  113. package/dist/cjs/client/v2/indexer/lookupAssetByID.js.map +1 -0
  114. package/dist/cjs/{src/client → client}/v2/indexer/lookupAssetTransactions.js +0 -0
  115. package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -0
  116. package/dist/cjs/{src/client → client}/v2/indexer/lookupBlock.js +0 -0
  117. package/dist/cjs/client/v2/indexer/lookupBlock.js.map +1 -0
  118. package/dist/cjs/{src/client → client}/v2/indexer/lookupTransactionByID.js +0 -0
  119. package/dist/cjs/client/v2/indexer/lookupTransactionByID.js.map +1 -0
  120. package/dist/cjs/{src/client → client}/v2/indexer/makeHealthCheck.js +0 -0
  121. package/dist/cjs/client/v2/indexer/makeHealthCheck.js.map +1 -0
  122. package/dist/cjs/{src/client → client}/v2/indexer/models/types.js +0 -0
  123. package/dist/cjs/client/v2/indexer/models/types.js.map +1 -0
  124. package/dist/cjs/{src/client → client}/v2/indexer/searchAccounts.js +0 -0
  125. package/dist/cjs/client/v2/indexer/searchAccounts.js.map +1 -0
  126. package/dist/cjs/{src/client → client}/v2/indexer/searchForApplicationBoxes.js +0 -0
  127. package/dist/cjs/client/v2/indexer/searchForApplicationBoxes.js.map +1 -0
  128. package/dist/cjs/{src/client → client}/v2/indexer/searchForApplications.js +0 -0
  129. package/dist/cjs/client/v2/indexer/searchForApplications.js.map +1 -0
  130. package/dist/cjs/{src/client → client}/v2/indexer/searchForAssets.js +0 -0
  131. package/dist/cjs/client/v2/indexer/searchForAssets.js.map +1 -0
  132. package/dist/cjs/{src/client → client}/v2/indexer/searchForTransactions.js +0 -0
  133. package/dist/cjs/client/v2/indexer/searchForTransactions.js.map +1 -0
  134. package/dist/cjs/{src/client → client}/v2/jsonrequest.js +0 -0
  135. package/dist/cjs/client/v2/jsonrequest.js.map +1 -0
  136. package/dist/cjs/{src/client → client}/v2/serviceClient.js +0 -0
  137. package/dist/cjs/client/v2/serviceClient.js.map +1 -0
  138. package/dist/cjs/{src/composer.js → composer.js} +0 -0
  139. package/dist/cjs/composer.js.map +1 -0
  140. package/dist/cjs/{src/convert.js → convert.js} +0 -0
  141. package/dist/cjs/convert.js.map +1 -0
  142. package/dist/cjs/{src/dryrun.js → dryrun.js} +0 -0
  143. package/dist/cjs/dryrun.js.map +1 -0
  144. package/dist/cjs/{src/encoding → encoding}/address.js +0 -0
  145. package/dist/cjs/encoding/address.js.map +1 -0
  146. package/dist/cjs/{src/encoding → encoding}/bigint.js +0 -0
  147. package/dist/cjs/encoding/bigint.js.map +1 -0
  148. package/dist/cjs/{src/encoding → encoding}/encoding.js +0 -0
  149. package/dist/cjs/encoding/encoding.js.map +1 -0
  150. package/dist/cjs/{src/encoding → encoding}/uint64.js +0 -0
  151. package/dist/cjs/encoding/uint64.js.map +1 -0
  152. package/dist/cjs/{src/group.js → group.js} +0 -0
  153. package/dist/cjs/group.js.map +1 -0
  154. package/dist/cjs/index.js +2 -2
  155. package/dist/cjs/index.js.map +1 -1
  156. package/dist/cjs/{src/logic → logic}/langspec.json +0 -0
  157. package/dist/cjs/{src/logic → logic}/logic.js +0 -0
  158. package/dist/cjs/logic/logic.js.map +1 -0
  159. package/dist/cjs/{src/logic → logic}/sourcemap.js +0 -0
  160. package/dist/cjs/logic/sourcemap.js.map +1 -0
  161. package/dist/cjs/{src/logicTemplates → logicTemplates}/dynamicfee.js +0 -0
  162. package/dist/cjs/logicTemplates/dynamicfee.js.map +1 -0
  163. package/dist/cjs/{src/logicTemplates → logicTemplates}/htlc.js +0 -0
  164. package/dist/cjs/logicTemplates/htlc.js.map +1 -0
  165. package/dist/cjs/{src/logicTemplates → logicTemplates}/index.js +0 -0
  166. package/dist/cjs/logicTemplates/index.js.map +1 -0
  167. package/dist/cjs/{src/logicTemplates → logicTemplates}/limitorder.js +0 -0
  168. package/dist/cjs/logicTemplates/limitorder.js.map +1 -0
  169. package/dist/cjs/{src/logicTemplates → logicTemplates}/periodicpayment.js +0 -0
  170. package/dist/cjs/logicTemplates/periodicpayment.js.map +1 -0
  171. package/dist/cjs/{src/logicTemplates → logicTemplates}/split.js +0 -0
  172. package/dist/cjs/logicTemplates/split.js.map +1 -0
  173. package/dist/cjs/{src/logicTemplates → logicTemplates}/templates.js +0 -0
  174. package/dist/cjs/logicTemplates/templates.js.map +1 -0
  175. package/dist/cjs/{src/logicsig.js → logicsig.js} +0 -0
  176. package/dist/cjs/logicsig.js.map +1 -0
  177. package/dist/cjs/{src/main.js → main.js} +0 -0
  178. package/dist/cjs/main.js.map +1 -0
  179. package/dist/cjs/{src/makeTxn.js → makeTxn.js} +0 -0
  180. package/dist/cjs/makeTxn.js.map +1 -0
  181. package/dist/cjs/{src/mnemonic → mnemonic}/mnemonic.js +0 -0
  182. package/dist/cjs/mnemonic/mnemonic.js.map +1 -0
  183. package/dist/cjs/{src/mnemonic → mnemonic}/wordlists/english.js +0 -0
  184. package/dist/cjs/mnemonic/wordlists/english.js.map +1 -0
  185. package/dist/cjs/multisig.js +398 -0
  186. package/dist/cjs/multisig.js.map +1 -0
  187. package/dist/cjs/{src/nacl → nacl}/naclWrappers.js +0 -0
  188. package/dist/cjs/nacl/naclWrappers.js.map +1 -0
  189. package/dist/cjs/{src/signer.js → signer.js} +0 -0
  190. package/dist/cjs/signer.js.map +1 -0
  191. package/dist/cjs/{src/transaction.js → transaction.js} +0 -0
  192. package/dist/cjs/transaction.js.map +1 -0
  193. package/dist/cjs/{src/types → types}/account.js +0 -0
  194. package/dist/cjs/types/account.js.map +1 -0
  195. package/dist/cjs/{src/types → types}/address.js +0 -0
  196. package/dist/cjs/types/address.js.map +1 -0
  197. package/dist/cjs/{src/types → types}/blockHeader.js +0 -0
  198. package/dist/cjs/types/blockHeader.js.map +1 -0
  199. package/dist/cjs/{src/types → types}/index.js +0 -0
  200. package/dist/cjs/types/index.js.map +1 -0
  201. package/dist/cjs/{src/types → types}/intDecoding.js +0 -0
  202. package/dist/cjs/types/intDecoding.js.map +1 -0
  203. package/dist/cjs/{src/types → types}/multisig.js +0 -0
  204. package/dist/cjs/types/multisig.js.map +1 -0
  205. package/dist/cjs/{src/types → types}/transactions/application.js +0 -0
  206. package/dist/cjs/types/transactions/application.js.map +1 -0
  207. package/dist/cjs/{src/types → types}/transactions/asset.js +0 -0
  208. package/dist/cjs/types/transactions/asset.js.map +1 -0
  209. package/dist/cjs/{src/types → types}/transactions/base.js +0 -0
  210. package/dist/cjs/types/transactions/base.js.map +1 -0
  211. package/dist/cjs/{src/types → types}/transactions/builder.js +0 -0
  212. package/dist/cjs/types/transactions/builder.js.map +1 -0
  213. package/dist/cjs/{src/types → types}/transactions/encoded.js +0 -0
  214. package/dist/cjs/types/transactions/encoded.js.map +1 -0
  215. package/dist/cjs/{src/types → types}/transactions/index.js +0 -0
  216. package/dist/cjs/types/transactions/index.js.map +1 -0
  217. package/dist/cjs/{src/types → types}/transactions/keyreg.js +0 -0
  218. package/dist/cjs/types/transactions/keyreg.js.map +1 -0
  219. package/dist/cjs/{src/types → types}/transactions/payment.js +0 -0
  220. package/dist/cjs/types/transactions/payment.js.map +1 -0
  221. package/dist/cjs/{src/types → types}/transactions/stateproof.js +0 -0
  222. package/dist/cjs/types/transactions/stateproof.js.map +1 -0
  223. package/dist/cjs/{src/types → types}/utils.js +0 -0
  224. package/dist/cjs/types/utils.js.map +1 -0
  225. package/dist/cjs/{src/utils → utils}/utils.js +0 -0
  226. package/dist/cjs/utils/utils.js.map +1 -0
  227. package/dist/cjs/{src/wait.js → wait.js} +0 -0
  228. package/dist/cjs/wait.js.map +1 -0
  229. package/dist/esm/abi/abi_type.js +680 -0
  230. package/dist/esm/abi/abi_type.js.map +1 -0
  231. package/dist/esm/{src/abi → abi}/contract.js +0 -0
  232. package/dist/esm/abi/contract.js.map +1 -0
  233. package/dist/esm/{src/abi → abi}/index.js +0 -0
  234. package/dist/esm/abi/index.js.map +1 -0
  235. package/dist/esm/{src/abi → abi}/interface.js +0 -0
  236. package/dist/esm/abi/interface.js.map +1 -0
  237. package/dist/esm/{src/abi → abi}/method.js +0 -0
  238. package/dist/esm/abi/method.js.map +1 -0
  239. package/dist/esm/{src/abi → abi}/reference.js +0 -0
  240. package/dist/esm/abi/reference.js.map +1 -0
  241. package/dist/esm/{src/abi → abi}/transaction.js +0 -0
  242. package/dist/esm/abi/transaction.js.map +1 -0
  243. package/dist/esm/{src/account.js → account.js} +0 -0
  244. package/dist/esm/account.js.map +1 -0
  245. package/dist/esm/{src/bid.js → bid.js} +0 -0
  246. package/dist/esm/bid.js.map +1 -0
  247. package/dist/esm/{src/boxStorage.js → boxStorage.js} +0 -0
  248. package/dist/esm/boxStorage.js.map +1 -0
  249. package/dist/esm/{src/client → client}/algod.js +0 -0
  250. package/dist/esm/client/algod.js.map +1 -0
  251. package/dist/esm/{src/client → client}/baseHTTPClient.js +0 -0
  252. package/dist/esm/client/baseHTTPClient.js.map +1 -0
  253. package/dist/esm/{src/client → client}/client.js +0 -0
  254. package/dist/esm/client/client.js.map +1 -0
  255. package/dist/esm/{src/client → client}/kmd.js +0 -0
  256. package/dist/esm/client/kmd.js.map +1 -0
  257. package/dist/esm/{src/client → client}/urlTokenBaseHTTPClient.js +0 -0
  258. package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -0
  259. package/dist/esm/{src/client → client}/v2/algod/accountApplicationInformation.js +0 -0
  260. package/dist/esm/client/v2/algod/accountApplicationInformation.js.map +1 -0
  261. package/dist/esm/{src/client → client}/v2/algod/accountAssetInformation.js +0 -0
  262. package/dist/esm/client/v2/algod/accountAssetInformation.js.map +1 -0
  263. package/dist/esm/{src/client → client}/v2/algod/accountInformation.js +0 -0
  264. package/dist/esm/client/v2/algod/accountInformation.js.map +1 -0
  265. package/dist/esm/{src/client → client}/v2/algod/algod.js +0 -0
  266. package/dist/esm/client/v2/algod/algod.js.map +1 -0
  267. package/dist/esm/{src/client → client}/v2/algod/block.js +0 -0
  268. package/dist/esm/client/v2/algod/block.js.map +1 -0
  269. package/dist/esm/{src/client → client}/v2/algod/compile.js +0 -0
  270. package/dist/esm/client/v2/algod/compile.js.map +1 -0
  271. package/dist/esm/{src/client → client}/v2/algod/dryrun.js +0 -0
  272. package/dist/esm/client/v2/algod/dryrun.js.map +1 -0
  273. package/dist/esm/{src/client → client}/v2/algod/genesis.js +0 -0
  274. package/dist/esm/client/v2/algod/genesis.js.map +1 -0
  275. package/dist/esm/{src/client → client}/v2/algod/getApplicationBoxByName.js +0 -0
  276. package/dist/esm/client/v2/algod/getApplicationBoxByName.js.map +1 -0
  277. package/dist/esm/{src/client → client}/v2/algod/getApplicationBoxes.js +0 -0
  278. package/dist/esm/client/v2/algod/getApplicationBoxes.js.map +1 -0
  279. package/dist/esm/{src/client → client}/v2/algod/getApplicationByID.js +0 -0
  280. package/dist/esm/client/v2/algod/getApplicationByID.js.map +1 -0
  281. package/dist/esm/{src/client → client}/v2/algod/getAssetByID.js +0 -0
  282. package/dist/esm/client/v2/algod/getAssetByID.js.map +1 -0
  283. package/dist/esm/{src/client → client}/v2/algod/getBlockHash.js +0 -0
  284. package/dist/esm/client/v2/algod/getBlockHash.js.map +1 -0
  285. package/dist/esm/{src/client → client}/v2/algod/getTransactionProof.js +0 -0
  286. package/dist/esm/client/v2/algod/getTransactionProof.js.map +1 -0
  287. package/dist/esm/{src/client → client}/v2/algod/healthCheck.js +0 -0
  288. package/dist/esm/client/v2/algod/healthCheck.js.map +1 -0
  289. package/dist/esm/{src/client → client}/v2/algod/lightBlockHeaderProof.js +0 -0
  290. package/dist/esm/client/v2/algod/lightBlockHeaderProof.js.map +1 -0
  291. package/dist/esm/client/v2/algod/models/types.js +1998 -0
  292. package/dist/esm/client/v2/algod/models/types.js.map +1 -0
  293. package/dist/esm/{src/client → client}/v2/algod/pendingTransactionInformation.js +0 -0
  294. package/dist/esm/client/v2/algod/pendingTransactionInformation.js.map +1 -0
  295. package/dist/esm/{src/client → client}/v2/algod/pendingTransactions.js +0 -0
  296. package/dist/esm/client/v2/algod/pendingTransactions.js.map +1 -0
  297. package/dist/esm/{src/client → client}/v2/algod/pendingTransactionsByAddress.js +0 -0
  298. package/dist/esm/client/v2/algod/pendingTransactionsByAddress.js.map +1 -0
  299. package/dist/esm/{src/client → client}/v2/algod/sendRawTransaction.js +0 -0
  300. package/dist/esm/client/v2/algod/sendRawTransaction.js.map +1 -0
  301. package/dist/esm/{src/client → client}/v2/algod/stateproof.js +0 -0
  302. package/dist/esm/client/v2/algod/stateproof.js.map +1 -0
  303. package/dist/esm/{src/client → client}/v2/algod/status.js +0 -0
  304. package/dist/esm/client/v2/algod/status.js.map +1 -0
  305. package/dist/esm/{src/client → client}/v2/algod/statusAfterBlock.js +0 -0
  306. package/dist/esm/client/v2/algod/statusAfterBlock.js.map +1 -0
  307. package/dist/esm/{src/client → client}/v2/algod/suggestedParams.js +0 -0
  308. package/dist/esm/client/v2/algod/suggestedParams.js.map +1 -0
  309. package/dist/esm/{src/client → client}/v2/algod/supply.js +0 -0
  310. package/dist/esm/client/v2/algod/supply.js.map +1 -0
  311. package/dist/esm/{src/client → client}/v2/algod/versions.js +0 -0
  312. package/dist/esm/client/v2/algod/versions.js.map +1 -0
  313. package/dist/esm/{src/client → client}/v2/basemodel.js +0 -0
  314. package/dist/esm/client/v2/basemodel.js.map +1 -0
  315. package/dist/esm/{src/client → client}/v2/indexer/indexer.js +0 -0
  316. package/dist/esm/client/v2/indexer/indexer.js.map +1 -0
  317. package/dist/esm/{src/client → client}/v2/indexer/lookupAccountAppLocalStates.js +0 -0
  318. package/dist/esm/client/v2/indexer/lookupAccountAppLocalStates.js.map +1 -0
  319. package/dist/esm/{src/client → client}/v2/indexer/lookupAccountAssets.js +0 -0
  320. package/dist/esm/client/v2/indexer/lookupAccountAssets.js.map +1 -0
  321. package/dist/esm/{src/client → client}/v2/indexer/lookupAccountByID.js +0 -0
  322. package/dist/esm/client/v2/indexer/lookupAccountByID.js.map +1 -0
  323. package/dist/esm/{src/client → client}/v2/indexer/lookupAccountCreatedApplications.js +0 -0
  324. package/dist/esm/client/v2/indexer/lookupAccountCreatedApplications.js.map +1 -0
  325. package/dist/esm/{src/client → client}/v2/indexer/lookupAccountCreatedAssets.js +0 -0
  326. package/dist/esm/client/v2/indexer/lookupAccountCreatedAssets.js.map +1 -0
  327. package/dist/esm/{src/client → client}/v2/indexer/lookupAccountTransactions.js +0 -0
  328. package/dist/esm/client/v2/indexer/lookupAccountTransactions.js.map +1 -0
  329. package/dist/esm/{src/client → client}/v2/indexer/lookupApplicationBoxByIDandName.js +0 -0
  330. package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -0
  331. package/dist/esm/{src/client → client}/v2/indexer/lookupApplicationLogs.js +0 -0
  332. package/dist/esm/client/v2/indexer/lookupApplicationLogs.js.map +1 -0
  333. package/dist/esm/{src/client → client}/v2/indexer/lookupApplications.js +0 -0
  334. package/dist/esm/client/v2/indexer/lookupApplications.js.map +1 -0
  335. package/dist/esm/{src/client → client}/v2/indexer/lookupAssetBalances.js +0 -0
  336. package/dist/esm/client/v2/indexer/lookupAssetBalances.js.map +1 -0
  337. package/dist/esm/{src/client → client}/v2/indexer/lookupAssetByID.js +0 -0
  338. package/dist/esm/client/v2/indexer/lookupAssetByID.js.map +1 -0
  339. package/dist/esm/{src/client → client}/v2/indexer/lookupAssetTransactions.js +0 -0
  340. package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -0
  341. package/dist/esm/{src/client → client}/v2/indexer/lookupBlock.js +0 -0
  342. package/dist/esm/client/v2/indexer/lookupBlock.js.map +1 -0
  343. package/dist/esm/{src/client → client}/v2/indexer/lookupTransactionByID.js +0 -0
  344. package/dist/esm/client/v2/indexer/lookupTransactionByID.js.map +1 -0
  345. package/dist/esm/{src/client → client}/v2/indexer/makeHealthCheck.js +0 -0
  346. package/dist/esm/client/v2/indexer/makeHealthCheck.js.map +1 -0
  347. package/dist/esm/{src/client → client}/v2/indexer/models/types.js +0 -0
  348. package/dist/esm/client/v2/indexer/models/types.js.map +1 -0
  349. package/dist/esm/{src/client → client}/v2/indexer/searchAccounts.js +0 -0
  350. package/dist/esm/client/v2/indexer/searchAccounts.js.map +1 -0
  351. package/dist/esm/{src/client → client}/v2/indexer/searchForApplicationBoxes.js +0 -0
  352. package/dist/esm/client/v2/indexer/searchForApplicationBoxes.js.map +1 -0
  353. package/dist/esm/{src/client → client}/v2/indexer/searchForApplications.js +0 -0
  354. package/dist/esm/client/v2/indexer/searchForApplications.js.map +1 -0
  355. package/dist/esm/{src/client → client}/v2/indexer/searchForAssets.js +0 -0
  356. package/dist/esm/client/v2/indexer/searchForAssets.js.map +1 -0
  357. package/dist/esm/{src/client → client}/v2/indexer/searchForTransactions.js +0 -0
  358. package/dist/esm/client/v2/indexer/searchForTransactions.js.map +1 -0
  359. package/dist/esm/{src/client → client}/v2/jsonrequest.js +0 -0
  360. package/dist/esm/client/v2/jsonrequest.js.map +1 -0
  361. package/dist/esm/{src/client → client}/v2/serviceClient.js +0 -0
  362. package/dist/esm/client/v2/serviceClient.js.map +1 -0
  363. package/dist/esm/{src/composer.js → composer.js} +0 -0
  364. package/dist/esm/composer.js.map +1 -0
  365. package/dist/esm/{src/convert.js → convert.js} +0 -0
  366. package/dist/esm/convert.js.map +1 -0
  367. package/dist/esm/{src/dryrun.js → dryrun.js} +0 -0
  368. package/dist/esm/dryrun.js.map +1 -0
  369. package/dist/esm/{src/encoding → encoding}/address.js +0 -0
  370. package/dist/esm/encoding/address.js.map +1 -0
  371. package/dist/esm/{src/encoding → encoding}/bigint.js +0 -0
  372. package/dist/esm/encoding/bigint.js.map +1 -0
  373. package/dist/esm/{src/encoding → encoding}/encoding.js +0 -0
  374. package/dist/esm/encoding/encoding.js.map +1 -0
  375. package/dist/esm/{src/encoding → encoding}/uint64.js +0 -0
  376. package/dist/esm/encoding/uint64.js.map +1 -0
  377. package/dist/esm/{src/group.js → group.js} +0 -0
  378. package/dist/esm/group.js.map +1 -0
  379. package/dist/esm/index.js +2 -2
  380. package/dist/esm/index.js.map +1 -1
  381. package/dist/esm/{src/logic → logic}/langspec.json +0 -0
  382. package/dist/esm/{src/logic → logic}/logic.js +0 -0
  383. package/dist/esm/logic/logic.js.map +1 -0
  384. package/dist/esm/{src/logic → logic}/sourcemap.js +0 -0
  385. package/dist/esm/logic/sourcemap.js.map +1 -0
  386. package/dist/esm/{src/logicTemplates → logicTemplates}/dynamicfee.js +0 -0
  387. package/dist/esm/logicTemplates/dynamicfee.js.map +1 -0
  388. package/dist/esm/{src/logicTemplates → logicTemplates}/htlc.js +0 -0
  389. package/dist/esm/logicTemplates/htlc.js.map +1 -0
  390. package/dist/esm/{src/logicTemplates → logicTemplates}/index.js +0 -0
  391. package/dist/esm/logicTemplates/index.js.map +1 -0
  392. package/dist/esm/{src/logicTemplates → logicTemplates}/limitorder.js +0 -0
  393. package/dist/esm/logicTemplates/limitorder.js.map +1 -0
  394. package/dist/esm/{src/logicTemplates → logicTemplates}/periodicpayment.js +0 -0
  395. package/dist/esm/logicTemplates/periodicpayment.js.map +1 -0
  396. package/dist/esm/{src/logicTemplates → logicTemplates}/split.js +0 -0
  397. package/dist/esm/logicTemplates/split.js.map +1 -0
  398. package/dist/esm/{src/logicTemplates → logicTemplates}/templates.js +0 -0
  399. package/dist/esm/logicTemplates/templates.js.map +1 -0
  400. package/dist/esm/{src/logicsig.js → logicsig.js} +0 -0
  401. package/dist/esm/logicsig.js.map +1 -0
  402. package/dist/esm/{src/main.js → main.js} +0 -0
  403. package/dist/esm/main.js.map +1 -0
  404. package/dist/esm/{src/makeTxn.js → makeTxn.js} +0 -0
  405. package/dist/esm/makeTxn.js.map +1 -0
  406. package/dist/esm/{src/mnemonic → mnemonic}/mnemonic.js +0 -0
  407. package/dist/esm/mnemonic/mnemonic.js.map +1 -0
  408. package/dist/esm/{src/mnemonic → mnemonic}/wordlists/english.js +0 -0
  409. package/dist/esm/mnemonic/wordlists/english.js.map +1 -0
  410. package/dist/esm/multisig.js +364 -0
  411. package/dist/esm/multisig.js.map +1 -0
  412. package/dist/esm/{src/nacl → nacl}/naclWrappers.js +0 -0
  413. package/dist/esm/nacl/naclWrappers.js.map +1 -0
  414. package/dist/esm/{src/signer.js → signer.js} +0 -0
  415. package/dist/esm/signer.js.map +1 -0
  416. package/dist/esm/{src/transaction.js → transaction.js} +0 -0
  417. package/dist/esm/transaction.js.map +1 -0
  418. package/dist/esm/{src/types → types}/account.js +0 -0
  419. package/dist/esm/types/account.js.map +1 -0
  420. package/dist/esm/{src/types → types}/address.js +0 -0
  421. package/dist/esm/types/address.js.map +1 -0
  422. package/dist/esm/{src/types → types}/blockHeader.js +0 -0
  423. package/dist/esm/types/blockHeader.js.map +1 -0
  424. package/dist/esm/{src/types → types}/index.js +0 -0
  425. package/dist/esm/types/index.js.map +1 -0
  426. package/dist/esm/{src/types → types}/intDecoding.js +0 -0
  427. package/dist/esm/types/intDecoding.js.map +1 -0
  428. package/dist/esm/{src/types → types}/multisig.js +0 -0
  429. package/dist/esm/types/multisig.js.map +1 -0
  430. package/dist/esm/{src/types → types}/transactions/application.js +0 -0
  431. package/dist/esm/types/transactions/application.js.map +1 -0
  432. package/dist/esm/{src/types → types}/transactions/asset.js +0 -0
  433. package/dist/esm/types/transactions/asset.js.map +1 -0
  434. package/dist/esm/{src/types → types}/transactions/base.js +0 -0
  435. package/dist/esm/types/transactions/base.js.map +1 -0
  436. package/dist/esm/{src/types → types}/transactions/builder.js +0 -0
  437. package/dist/esm/types/transactions/builder.js.map +1 -0
  438. package/dist/esm/{src/types → types}/transactions/encoded.js +0 -0
  439. package/dist/esm/types/transactions/encoded.js.map +1 -0
  440. package/dist/esm/{src/types → types}/transactions/index.js +0 -0
  441. package/dist/esm/types/transactions/index.js.map +1 -0
  442. package/dist/esm/{src/types → types}/transactions/keyreg.js +0 -0
  443. package/dist/esm/types/transactions/keyreg.js.map +1 -0
  444. package/dist/esm/{src/types → types}/transactions/payment.js +0 -0
  445. package/dist/esm/types/transactions/payment.js.map +1 -0
  446. package/dist/esm/{src/types → types}/transactions/stateproof.js +0 -0
  447. package/dist/esm/types/transactions/stateproof.js.map +1 -0
  448. package/dist/esm/{src/types → types}/utils.js +0 -0
  449. package/dist/esm/types/utils.js.map +1 -0
  450. package/dist/esm/{src/utils → utils}/utils.js +0 -0
  451. package/dist/esm/utils/utils.js.map +1 -0
  452. package/dist/esm/{src/wait.js → wait.js} +0 -0
  453. package/dist/esm/wait.js.map +1 -0
  454. package/dist/types/{src/abi → abi}/abi_type.d.ts +0 -0
  455. package/dist/types/{src/abi → abi}/contract.d.ts +0 -0
  456. package/dist/types/{src/abi → abi}/index.d.ts +0 -0
  457. package/dist/types/{src/abi → abi}/interface.d.ts +0 -0
  458. package/dist/types/{src/abi → abi}/method.d.ts +0 -0
  459. package/dist/types/{src/abi → abi}/reference.d.ts +0 -0
  460. package/dist/types/{src/abi → abi}/transaction.d.ts +0 -0
  461. package/dist/types/{src/account.d.ts → account.d.ts} +0 -0
  462. package/dist/types/{src/bid.d.ts → bid.d.ts} +0 -0
  463. package/dist/types/{src/boxStorage.d.ts → boxStorage.d.ts} +0 -0
  464. package/dist/types/{src/client → client}/algod.d.ts +0 -0
  465. package/dist/types/{src/client → client}/baseHTTPClient.d.ts +0 -0
  466. package/dist/types/{src/client → client}/client.d.ts +0 -0
  467. package/dist/types/{src/client → client}/kmd.d.ts +0 -0
  468. package/dist/types/{src/client → client}/urlTokenBaseHTTPClient.d.ts +0 -0
  469. package/dist/types/{src/client → client}/v2/algod/accountApplicationInformation.d.ts +0 -0
  470. package/dist/types/{src/client → client}/v2/algod/accountAssetInformation.d.ts +0 -0
  471. package/dist/types/{src/client → client}/v2/algod/accountInformation.d.ts +0 -0
  472. package/dist/types/{src/client → client}/v2/algod/algod.d.ts +0 -0
  473. package/dist/types/{src/client → client}/v2/algod/block.d.ts +0 -0
  474. package/dist/types/{src/client → client}/v2/algod/compile.d.ts +0 -0
  475. package/dist/types/{src/client → client}/v2/algod/dryrun.d.ts +0 -0
  476. package/dist/types/{src/client → client}/v2/algod/genesis.d.ts +0 -0
  477. package/dist/types/{src/client → client}/v2/algod/getApplicationBoxByName.d.ts +0 -0
  478. package/dist/types/{src/client → client}/v2/algod/getApplicationBoxes.d.ts +0 -0
  479. package/dist/types/{src/client → client}/v2/algod/getApplicationByID.d.ts +0 -0
  480. package/dist/types/{src/client → client}/v2/algod/getAssetByID.d.ts +0 -0
  481. package/dist/types/{src/client → client}/v2/algod/getBlockHash.d.ts +0 -0
  482. package/dist/types/{src/client → client}/v2/algod/getTransactionProof.d.ts +0 -0
  483. package/dist/types/{src/client → client}/v2/algod/healthCheck.d.ts +0 -0
  484. package/dist/types/{src/client → client}/v2/algod/lightBlockHeaderProof.d.ts +0 -0
  485. package/dist/types/client/v2/algod/models/types.d.ts +1634 -0
  486. package/dist/types/{src/client → client}/v2/algod/pendingTransactionInformation.d.ts +0 -0
  487. package/dist/types/{src/client → client}/v2/algod/pendingTransactions.d.ts +0 -0
  488. package/dist/types/{src/client → client}/v2/algod/pendingTransactionsByAddress.d.ts +0 -0
  489. package/dist/types/{src/client → client}/v2/algod/sendRawTransaction.d.ts +0 -0
  490. package/dist/types/{src/client → client}/v2/algod/stateproof.d.ts +0 -0
  491. package/dist/types/{src/client → client}/v2/algod/status.d.ts +0 -0
  492. package/dist/types/{src/client → client}/v2/algod/statusAfterBlock.d.ts +0 -0
  493. package/dist/types/{src/client → client}/v2/algod/suggestedParams.d.ts +0 -0
  494. package/dist/types/{src/client → client}/v2/algod/supply.d.ts +0 -0
  495. package/dist/types/{src/client → client}/v2/algod/versions.d.ts +0 -0
  496. package/dist/types/{src/client → client}/v2/basemodel.d.ts +0 -0
  497. package/dist/types/{src/client → client}/v2/indexer/indexer.d.ts +0 -0
  498. package/dist/types/{src/client → client}/v2/indexer/lookupAccountAppLocalStates.d.ts +0 -0
  499. package/dist/types/{src/client → client}/v2/indexer/lookupAccountAssets.d.ts +0 -0
  500. package/dist/types/{src/client → client}/v2/indexer/lookupAccountByID.d.ts +0 -0
  501. package/dist/types/{src/client → client}/v2/indexer/lookupAccountCreatedApplications.d.ts +0 -0
  502. package/dist/types/{src/client → client}/v2/indexer/lookupAccountCreatedAssets.d.ts +0 -0
  503. package/dist/types/{src/client → client}/v2/indexer/lookupAccountTransactions.d.ts +0 -0
  504. package/dist/types/{src/client → client}/v2/indexer/lookupApplicationBoxByIDandName.d.ts +0 -0
  505. package/dist/types/{src/client → client}/v2/indexer/lookupApplicationLogs.d.ts +0 -0
  506. package/dist/types/{src/client → client}/v2/indexer/lookupApplications.d.ts +0 -0
  507. package/dist/types/{src/client → client}/v2/indexer/lookupAssetBalances.d.ts +0 -0
  508. package/dist/types/{src/client → client}/v2/indexer/lookupAssetByID.d.ts +0 -0
  509. package/dist/types/{src/client → client}/v2/indexer/lookupAssetTransactions.d.ts +0 -0
  510. package/dist/types/{src/client → client}/v2/indexer/lookupBlock.d.ts +0 -0
  511. package/dist/types/{src/client → client}/v2/indexer/lookupTransactionByID.d.ts +0 -0
  512. package/dist/types/{src/client → client}/v2/indexer/makeHealthCheck.d.ts +0 -0
  513. package/dist/types/{src/client → client}/v2/indexer/models/types.d.ts +0 -0
  514. package/dist/types/{src/client → client}/v2/indexer/searchAccounts.d.ts +0 -0
  515. package/dist/types/{src/client → client}/v2/indexer/searchForApplicationBoxes.d.ts +0 -0
  516. package/dist/types/{src/client → client}/v2/indexer/searchForApplications.d.ts +0 -0
  517. package/dist/types/{src/client → client}/v2/indexer/searchForAssets.d.ts +0 -0
  518. package/dist/types/{src/client → client}/v2/indexer/searchForTransactions.d.ts +0 -0
  519. package/dist/types/{src/client → client}/v2/jsonrequest.d.ts +0 -0
  520. package/dist/types/{src/client → client}/v2/serviceClient.d.ts +0 -0
  521. package/dist/types/{src/composer.d.ts → composer.d.ts} +0 -0
  522. package/dist/types/{src/convert.d.ts → convert.d.ts} +0 -0
  523. package/dist/types/{src/dryrun.d.ts → dryrun.d.ts} +0 -0
  524. package/dist/types/{src/encoding → encoding}/address.d.ts +0 -0
  525. package/dist/types/{src/encoding → encoding}/bigint.d.ts +0 -0
  526. package/dist/types/{src/encoding → encoding}/encoding.d.ts +0 -0
  527. package/dist/types/{src/encoding → encoding}/uint64.d.ts +0 -0
  528. package/dist/types/{src/group.d.ts → group.d.ts} +0 -0
  529. package/dist/types/index.d.ts +2 -2
  530. package/dist/types/{src/logic → logic}/logic.d.ts +0 -0
  531. package/dist/types/{src/logic → logic}/sourcemap.d.ts +0 -0
  532. package/dist/types/{src/logicTemplates → logicTemplates}/dynamicfee.d.ts +0 -0
  533. package/dist/types/{src/logicTemplates → logicTemplates}/htlc.d.ts +0 -0
  534. package/dist/types/{src/logicTemplates → logicTemplates}/index.d.ts +0 -0
  535. package/dist/types/{src/logicTemplates → logicTemplates}/limitorder.d.ts +0 -0
  536. package/dist/types/{src/logicTemplates → logicTemplates}/periodicpayment.d.ts +0 -0
  537. package/dist/types/{src/logicTemplates → logicTemplates}/split.d.ts +0 -0
  538. package/dist/types/{src/logicTemplates → logicTemplates}/templates.d.ts +0 -0
  539. package/dist/types/{src/logicsig.d.ts → logicsig.d.ts} +0 -0
  540. package/dist/types/{src/main.d.ts → main.d.ts} +0 -0
  541. package/dist/types/{src/makeTxn.d.ts → makeTxn.d.ts} +0 -0
  542. package/dist/types/{src/mnemonic → mnemonic}/mnemonic.d.ts +0 -0
  543. package/dist/types/{src/mnemonic → mnemonic}/wordlists/english.d.ts +0 -0
  544. package/dist/types/multisig.d.ts +125 -0
  545. package/dist/types/{src/nacl → nacl}/naclWrappers.d.ts +0 -0
  546. package/dist/types/{src/signer.d.ts → signer.d.ts} +0 -0
  547. package/dist/types/{src/transaction.d.ts → transaction.d.ts} +0 -0
  548. package/dist/types/{src/types → types}/account.d.ts +0 -0
  549. package/dist/types/{src/types → types}/address.d.ts +0 -0
  550. package/dist/types/{src/types → types}/blockHeader.d.ts +0 -0
  551. package/dist/types/{src/types → types}/index.d.ts +0 -0
  552. package/dist/types/{src/types → types}/intDecoding.d.ts +0 -0
  553. package/dist/types/{src/types → types}/multisig.d.ts +0 -0
  554. package/dist/types/{src/types → types}/transactions/application.d.ts +0 -0
  555. package/dist/types/{src/types → types}/transactions/asset.d.ts +0 -0
  556. package/dist/types/{src/types → types}/transactions/base.d.ts +0 -0
  557. package/dist/types/{src/types → types}/transactions/builder.d.ts +0 -0
  558. package/dist/types/{src/types → types}/transactions/encoded.d.ts +0 -0
  559. package/dist/types/{src/types → types}/transactions/index.d.ts +0 -0
  560. package/dist/types/{src/types → types}/transactions/keyreg.d.ts +0 -0
  561. package/dist/types/{src/types → types}/transactions/payment.d.ts +0 -0
  562. package/dist/types/{src/types → types}/transactions/stateproof.d.ts +0 -0
  563. package/dist/types/{src/types → types}/utils.d.ts +0 -0
  564. package/dist/types/{src/utils → utils}/utils.d.ts +0 -0
  565. package/dist/types/{src/wait.d.ts → wait.d.ts} +0 -0
  566. package/package.json +10 -6
  567. package/src/abi/abi_type.ts +846 -0
  568. package/src/abi/contract.ts +51 -0
  569. package/src/abi/index.ts +6 -0
  570. package/src/abi/interface.ts +35 -0
  571. package/src/abi/method.ts +186 -0
  572. package/src/abi/reference.ts +24 -0
  573. package/src/abi/transaction.ts +61 -0
  574. package/src/account.ts +12 -0
  575. package/src/bid.ts +95 -0
  576. package/src/boxStorage.ts +42 -0
  577. package/src/client/algod.js +365 -0
  578. package/src/client/baseHTTPClient.ts +58 -0
  579. package/src/client/client.ts +306 -0
  580. package/src/client/kmd.ts +423 -0
  581. package/src/client/urlTokenBaseHTTPClient.ts +217 -0
  582. package/src/client/v2/algod/accountApplicationInformation.ts +20 -0
  583. package/src/client/v2/algod/accountAssetInformation.ts +20 -0
  584. package/src/client/v2/algod/accountInformation.ts +37 -0
  585. package/src/client/v2/algod/algod.ts +561 -0
  586. package/src/client/v2/algod/block.ts +30 -0
  587. package/src/client/v2/algod/compile.ts +50 -0
  588. package/src/client/v2/algod/dryrun.ts +33 -0
  589. package/src/client/v2/algod/genesis.ts +8 -0
  590. package/src/client/v2/algod/getApplicationBoxByName.ts +49 -0
  591. package/src/client/v2/algod/getApplicationBoxes.ts +61 -0
  592. package/src/client/v2/algod/getApplicationByID.ts +14 -0
  593. package/src/client/v2/algod/getAssetByID.ts +14 -0
  594. package/src/client/v2/algod/getBlockHash.ts +18 -0
  595. package/src/client/v2/algod/getTransactionProof.ts +43 -0
  596. package/src/client/v2/algod/healthCheck.ts +19 -0
  597. package/src/client/v2/algod/lightBlockHeaderProof.ts +15 -0
  598. package/src/client/v2/algod/models/types.ts +3662 -0
  599. package/src/client/v2/algod/pendingTransactionInformation.ts +32 -0
  600. package/src/client/v2/algod/pendingTransactions.ts +32 -0
  601. package/src/client/v2/algod/pendingTransactionsByAddress.ts +32 -0
  602. package/src/client/v2/algod/sendRawTransaction.ts +59 -0
  603. package/src/client/v2/algod/stateproof.ts +15 -0
  604. package/src/client/v2/algod/status.ts +8 -0
  605. package/src/client/v2/algod/statusAfterBlock.ts +15 -0
  606. package/src/client/v2/algod/suggestedParams.ts +24 -0
  607. package/src/client/v2/algod/supply.ts +8 -0
  608. package/src/client/v2/algod/versions.ts +11 -0
  609. package/src/client/v2/basemodel.ts +79 -0
  610. package/src/client/v2/indexer/indexer.ts +432 -0
  611. package/src/client/v2/indexer/lookupAccountAppLocalStates.ts +140 -0
  612. package/src/client/v2/indexer/lookupAccountAssets.ts +141 -0
  613. package/src/client/v2/indexer/lookupAccountByID.ts +109 -0
  614. package/src/client/v2/indexer/lookupAccountCreatedApplications.ts +141 -0
  615. package/src/client/v2/indexer/lookupAccountCreatedAssets.ts +142 -0
  616. package/src/client/v2/indexer/lookupAccountTransactions.ts +393 -0
  617. package/src/client/v2/indexer/lookupApplicationBoxByIDandName.ts +50 -0
  618. package/src/client/v2/indexer/lookupApplicationLogs.ts +156 -0
  619. package/src/client/v2/indexer/lookupApplications.ts +59 -0
  620. package/src/client/v2/indexer/lookupAssetBalances.ts +146 -0
  621. package/src/client/v2/indexer/lookupAssetByID.ts +58 -0
  622. package/src/client/v2/indexer/lookupAssetTransactions.ts +406 -0
  623. package/src/client/v2/indexer/lookupBlock.ts +39 -0
  624. package/src/client/v2/indexer/lookupTransactionByID.ts +30 -0
  625. package/src/client/v2/indexer/makeHealthCheck.ts +23 -0
  626. package/src/client/v2/indexer/models/types.ts +5667 -0
  627. package/src/client/v2/indexer/searchAccounts.ts +268 -0
  628. package/src/client/v2/indexer/searchForApplicationBoxes.ts +101 -0
  629. package/src/client/v2/indexer/searchForApplications.ts +134 -0
  630. package/src/client/v2/indexer/searchForAssets.ts +175 -0
  631. package/src/client/v2/indexer/searchForTransactions.ts +435 -0
  632. package/src/client/v2/jsonrequest.ts +103 -0
  633. package/src/client/v2/serviceClient.ts +86 -0
  634. package/src/composer.ts +688 -0
  635. package/src/convert.ts +25 -0
  636. package/src/dryrun.ts +468 -0
  637. package/src/encoding/address.ts +191 -0
  638. package/src/encoding/bigint.ts +33 -0
  639. package/src/encoding/encoding.ts +56 -0
  640. package/src/encoding/uint64.ts +84 -0
  641. package/src/group.ts +97 -0
  642. package/src/index.ts +4 -0
  643. package/src/logic/langspec.json +2014 -0
  644. package/src/logic/logic.ts +316 -0
  645. package/src/logic/sourcemap.ts +67 -0
  646. package/src/logicTemplates/dynamicfee.js +219 -0
  647. package/src/logicTemplates/htlc.js +165 -0
  648. package/src/logicTemplates/index.js +20 -0
  649. package/src/logicTemplates/limitorder.js +227 -0
  650. package/src/logicTemplates/periodicpayment.js +208 -0
  651. package/src/logicTemplates/split.js +208 -0
  652. package/src/logicTemplates/templates.js +78 -0
  653. package/src/logicsig.ts +523 -0
  654. package/src/main.ts +185 -0
  655. package/src/makeTxn.ts +1871 -0
  656. package/src/mnemonic/mnemonic.ts +181 -0
  657. package/src/mnemonic/wordlists/english.ts +2052 -0
  658. package/src/multisig.ts +495 -0
  659. package/src/nacl/naclWrappers.ts +49 -0
  660. package/src/signer.ts +105 -0
  661. package/src/transaction.ts +1363 -0
  662. package/src/types/account.ts +16 -0
  663. package/src/types/address.ts +7 -0
  664. package/src/types/blockHeader.ts +81 -0
  665. package/src/types/index.ts +3 -0
  666. package/src/types/intDecoding.ts +29 -0
  667. package/src/types/multisig.ts +22 -0
  668. package/src/types/transactions/application.ts +111 -0
  669. package/src/types/transactions/asset.ts +108 -0
  670. package/src/types/transactions/base.ts +428 -0
  671. package/src/types/transactions/builder.ts +69 -0
  672. package/src/types/transactions/encoded.ts +423 -0
  673. package/src/types/transactions/index.ts +72 -0
  674. package/src/types/transactions/keyreg.ts +23 -0
  675. package/src/types/transactions/payment.ts +14 -0
  676. package/src/types/transactions/stateproof.ts +17 -0
  677. package/src/types/utils.ts +63 -0
  678. package/src/utils/utils.ts +121 -0
  679. package/src/wait.ts +58 -0
  680. package/dist/cjs/src/abi/abi_type.js +0 -693
  681. package/dist/cjs/src/abi/abi_type.js.map +0 -1
  682. package/dist/cjs/src/abi/contract.js.map +0 -1
  683. package/dist/cjs/src/abi/index.js.map +0 -1
  684. package/dist/cjs/src/abi/interface.js.map +0 -1
  685. package/dist/cjs/src/abi/method.js.map +0 -1
  686. package/dist/cjs/src/abi/reference.js.map +0 -1
  687. package/dist/cjs/src/abi/transaction.js.map +0 -1
  688. package/dist/cjs/src/account.js.map +0 -1
  689. package/dist/cjs/src/bid.js.map +0 -1
  690. package/dist/cjs/src/boxStorage.js.map +0 -1
  691. package/dist/cjs/src/client/algod.js.map +0 -1
  692. package/dist/cjs/src/client/baseHTTPClient.js.map +0 -1
  693. package/dist/cjs/src/client/client.js.map +0 -1
  694. package/dist/cjs/src/client/kmd.js.map +0 -1
  695. package/dist/cjs/src/client/urlTokenBaseHTTPClient.js.map +0 -1
  696. package/dist/cjs/src/client/v2/algod/accountApplicationInformation.js.map +0 -1
  697. package/dist/cjs/src/client/v2/algod/accountAssetInformation.js.map +0 -1
  698. package/dist/cjs/src/client/v2/algod/accountInformation.js.map +0 -1
  699. package/dist/cjs/src/client/v2/algod/algod.js.map +0 -1
  700. package/dist/cjs/src/client/v2/algod/block.js.map +0 -1
  701. package/dist/cjs/src/client/v2/algod/compile.js.map +0 -1
  702. package/dist/cjs/src/client/v2/algod/dryrun.js.map +0 -1
  703. package/dist/cjs/src/client/v2/algod/genesis.js.map +0 -1
  704. package/dist/cjs/src/client/v2/algod/getApplicationBoxByName.js.map +0 -1
  705. package/dist/cjs/src/client/v2/algod/getApplicationBoxes.js.map +0 -1
  706. package/dist/cjs/src/client/v2/algod/getApplicationByID.js.map +0 -1
  707. package/dist/cjs/src/client/v2/algod/getAssetByID.js.map +0 -1
  708. package/dist/cjs/src/client/v2/algod/getBlockHash.js.map +0 -1
  709. package/dist/cjs/src/client/v2/algod/getTransactionProof.js.map +0 -1
  710. package/dist/cjs/src/client/v2/algod/healthCheck.js.map +0 -1
  711. package/dist/cjs/src/client/v2/algod/lightBlockHeaderProof.js.map +0 -1
  712. package/dist/cjs/src/client/v2/algod/models/types.js +0 -2033
  713. package/dist/cjs/src/client/v2/algod/models/types.js.map +0 -1
  714. package/dist/cjs/src/client/v2/algod/pendingTransactionInformation.js.map +0 -1
  715. package/dist/cjs/src/client/v2/algod/pendingTransactions.js.map +0 -1
  716. package/dist/cjs/src/client/v2/algod/pendingTransactionsByAddress.js.map +0 -1
  717. package/dist/cjs/src/client/v2/algod/sendRawTransaction.js.map +0 -1
  718. package/dist/cjs/src/client/v2/algod/stateproof.js.map +0 -1
  719. package/dist/cjs/src/client/v2/algod/status.js.map +0 -1
  720. package/dist/cjs/src/client/v2/algod/statusAfterBlock.js.map +0 -1
  721. package/dist/cjs/src/client/v2/algod/suggestedParams.js.map +0 -1
  722. package/dist/cjs/src/client/v2/algod/supply.js.map +0 -1
  723. package/dist/cjs/src/client/v2/algod/versions.js.map +0 -1
  724. package/dist/cjs/src/client/v2/basemodel.js.map +0 -1
  725. package/dist/cjs/src/client/v2/indexer/indexer.js.map +0 -1
  726. package/dist/cjs/src/client/v2/indexer/lookupAccountAppLocalStates.js.map +0 -1
  727. package/dist/cjs/src/client/v2/indexer/lookupAccountAssets.js.map +0 -1
  728. package/dist/cjs/src/client/v2/indexer/lookupAccountByID.js.map +0 -1
  729. package/dist/cjs/src/client/v2/indexer/lookupAccountCreatedApplications.js.map +0 -1
  730. package/dist/cjs/src/client/v2/indexer/lookupAccountCreatedAssets.js.map +0 -1
  731. package/dist/cjs/src/client/v2/indexer/lookupAccountTransactions.js.map +0 -1
  732. package/dist/cjs/src/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +0 -1
  733. package/dist/cjs/src/client/v2/indexer/lookupApplicationLogs.js.map +0 -1
  734. package/dist/cjs/src/client/v2/indexer/lookupApplications.js.map +0 -1
  735. package/dist/cjs/src/client/v2/indexer/lookupAssetBalances.js.map +0 -1
  736. package/dist/cjs/src/client/v2/indexer/lookupAssetByID.js.map +0 -1
  737. package/dist/cjs/src/client/v2/indexer/lookupAssetTransactions.js.map +0 -1
  738. package/dist/cjs/src/client/v2/indexer/lookupBlock.js.map +0 -1
  739. package/dist/cjs/src/client/v2/indexer/lookupTransactionByID.js.map +0 -1
  740. package/dist/cjs/src/client/v2/indexer/makeHealthCheck.js.map +0 -1
  741. package/dist/cjs/src/client/v2/indexer/models/types.js.map +0 -1
  742. package/dist/cjs/src/client/v2/indexer/searchAccounts.js.map +0 -1
  743. package/dist/cjs/src/client/v2/indexer/searchForApplicationBoxes.js.map +0 -1
  744. package/dist/cjs/src/client/v2/indexer/searchForApplications.js.map +0 -1
  745. package/dist/cjs/src/client/v2/indexer/searchForAssets.js.map +0 -1
  746. package/dist/cjs/src/client/v2/indexer/searchForTransactions.js.map +0 -1
  747. package/dist/cjs/src/client/v2/jsonrequest.js.map +0 -1
  748. package/dist/cjs/src/client/v2/serviceClient.js.map +0 -1
  749. package/dist/cjs/src/composer.js.map +0 -1
  750. package/dist/cjs/src/convert.js.map +0 -1
  751. package/dist/cjs/src/dryrun.js.map +0 -1
  752. package/dist/cjs/src/encoding/address.js.map +0 -1
  753. package/dist/cjs/src/encoding/bigint.js.map +0 -1
  754. package/dist/cjs/src/encoding/encoding.js.map +0 -1
  755. package/dist/cjs/src/encoding/uint64.js.map +0 -1
  756. package/dist/cjs/src/group.js.map +0 -1
  757. package/dist/cjs/src/logic/logic.js.map +0 -1
  758. package/dist/cjs/src/logic/sourcemap.js.map +0 -1
  759. package/dist/cjs/src/logicTemplates/dynamicfee.js.map +0 -1
  760. package/dist/cjs/src/logicTemplates/htlc.js.map +0 -1
  761. package/dist/cjs/src/logicTemplates/index.js.map +0 -1
  762. package/dist/cjs/src/logicTemplates/limitorder.js.map +0 -1
  763. package/dist/cjs/src/logicTemplates/periodicpayment.js.map +0 -1
  764. package/dist/cjs/src/logicTemplates/split.js.map +0 -1
  765. package/dist/cjs/src/logicTemplates/templates.js.map +0 -1
  766. package/dist/cjs/src/logicsig.js.map +0 -1
  767. package/dist/cjs/src/main.js.map +0 -1
  768. package/dist/cjs/src/makeTxn.js.map +0 -1
  769. package/dist/cjs/src/mnemonic/mnemonic.js.map +0 -1
  770. package/dist/cjs/src/mnemonic/wordlists/english.js.map +0 -1
  771. package/dist/cjs/src/multisig.js +0 -398
  772. package/dist/cjs/src/multisig.js.map +0 -1
  773. package/dist/cjs/src/nacl/naclWrappers.js.map +0 -1
  774. package/dist/cjs/src/signer.js.map +0 -1
  775. package/dist/cjs/src/transaction.js.map +0 -1
  776. package/dist/cjs/src/types/account.js.map +0 -1
  777. package/dist/cjs/src/types/address.js.map +0 -1
  778. package/dist/cjs/src/types/blockHeader.js.map +0 -1
  779. package/dist/cjs/src/types/index.js.map +0 -1
  780. package/dist/cjs/src/types/intDecoding.js.map +0 -1
  781. package/dist/cjs/src/types/multisig.js.map +0 -1
  782. package/dist/cjs/src/types/transactions/application.js.map +0 -1
  783. package/dist/cjs/src/types/transactions/asset.js.map +0 -1
  784. package/dist/cjs/src/types/transactions/base.js.map +0 -1
  785. package/dist/cjs/src/types/transactions/builder.js.map +0 -1
  786. package/dist/cjs/src/types/transactions/encoded.js.map +0 -1
  787. package/dist/cjs/src/types/transactions/index.js.map +0 -1
  788. package/dist/cjs/src/types/transactions/keyreg.js.map +0 -1
  789. package/dist/cjs/src/types/transactions/payment.js.map +0 -1
  790. package/dist/cjs/src/types/transactions/stateproof.js.map +0 -1
  791. package/dist/cjs/src/types/utils.js.map +0 -1
  792. package/dist/cjs/src/utils/utils.js.map +0 -1
  793. package/dist/cjs/src/wait.js.map +0 -1
  794. package/dist/esm/src/abi/abi_type.js +0 -680
  795. package/dist/esm/src/abi/abi_type.js.map +0 -1
  796. package/dist/esm/src/abi/contract.js.map +0 -1
  797. package/dist/esm/src/abi/index.js.map +0 -1
  798. package/dist/esm/src/abi/interface.js.map +0 -1
  799. package/dist/esm/src/abi/method.js.map +0 -1
  800. package/dist/esm/src/abi/reference.js.map +0 -1
  801. package/dist/esm/src/abi/transaction.js.map +0 -1
  802. package/dist/esm/src/account.js.map +0 -1
  803. package/dist/esm/src/bid.js.map +0 -1
  804. package/dist/esm/src/boxStorage.js.map +0 -1
  805. package/dist/esm/src/client/algod.js.map +0 -1
  806. package/dist/esm/src/client/baseHTTPClient.js.map +0 -1
  807. package/dist/esm/src/client/client.js.map +0 -1
  808. package/dist/esm/src/client/kmd.js.map +0 -1
  809. package/dist/esm/src/client/urlTokenBaseHTTPClient.js.map +0 -1
  810. package/dist/esm/src/client/v2/algod/accountApplicationInformation.js.map +0 -1
  811. package/dist/esm/src/client/v2/algod/accountAssetInformation.js.map +0 -1
  812. package/dist/esm/src/client/v2/algod/accountInformation.js.map +0 -1
  813. package/dist/esm/src/client/v2/algod/algod.js.map +0 -1
  814. package/dist/esm/src/client/v2/algod/block.js.map +0 -1
  815. package/dist/esm/src/client/v2/algod/compile.js.map +0 -1
  816. package/dist/esm/src/client/v2/algod/dryrun.js.map +0 -1
  817. package/dist/esm/src/client/v2/algod/genesis.js.map +0 -1
  818. package/dist/esm/src/client/v2/algod/getApplicationBoxByName.js.map +0 -1
  819. package/dist/esm/src/client/v2/algod/getApplicationBoxes.js.map +0 -1
  820. package/dist/esm/src/client/v2/algod/getApplicationByID.js.map +0 -1
  821. package/dist/esm/src/client/v2/algod/getAssetByID.js.map +0 -1
  822. package/dist/esm/src/client/v2/algod/getBlockHash.js.map +0 -1
  823. package/dist/esm/src/client/v2/algod/getTransactionProof.js.map +0 -1
  824. package/dist/esm/src/client/v2/algod/healthCheck.js.map +0 -1
  825. package/dist/esm/src/client/v2/algod/lightBlockHeaderProof.js.map +0 -1
  826. package/dist/esm/src/client/v2/algod/models/types.js +0 -1984
  827. package/dist/esm/src/client/v2/algod/models/types.js.map +0 -1
  828. package/dist/esm/src/client/v2/algod/pendingTransactionInformation.js.map +0 -1
  829. package/dist/esm/src/client/v2/algod/pendingTransactions.js.map +0 -1
  830. package/dist/esm/src/client/v2/algod/pendingTransactionsByAddress.js.map +0 -1
  831. package/dist/esm/src/client/v2/algod/sendRawTransaction.js.map +0 -1
  832. package/dist/esm/src/client/v2/algod/stateproof.js.map +0 -1
  833. package/dist/esm/src/client/v2/algod/status.js.map +0 -1
  834. package/dist/esm/src/client/v2/algod/statusAfterBlock.js.map +0 -1
  835. package/dist/esm/src/client/v2/algod/suggestedParams.js.map +0 -1
  836. package/dist/esm/src/client/v2/algod/supply.js.map +0 -1
  837. package/dist/esm/src/client/v2/algod/versions.js.map +0 -1
  838. package/dist/esm/src/client/v2/basemodel.js.map +0 -1
  839. package/dist/esm/src/client/v2/indexer/indexer.js.map +0 -1
  840. package/dist/esm/src/client/v2/indexer/lookupAccountAppLocalStates.js.map +0 -1
  841. package/dist/esm/src/client/v2/indexer/lookupAccountAssets.js.map +0 -1
  842. package/dist/esm/src/client/v2/indexer/lookupAccountByID.js.map +0 -1
  843. package/dist/esm/src/client/v2/indexer/lookupAccountCreatedApplications.js.map +0 -1
  844. package/dist/esm/src/client/v2/indexer/lookupAccountCreatedAssets.js.map +0 -1
  845. package/dist/esm/src/client/v2/indexer/lookupAccountTransactions.js.map +0 -1
  846. package/dist/esm/src/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +0 -1
  847. package/dist/esm/src/client/v2/indexer/lookupApplicationLogs.js.map +0 -1
  848. package/dist/esm/src/client/v2/indexer/lookupApplications.js.map +0 -1
  849. package/dist/esm/src/client/v2/indexer/lookupAssetBalances.js.map +0 -1
  850. package/dist/esm/src/client/v2/indexer/lookupAssetByID.js.map +0 -1
  851. package/dist/esm/src/client/v2/indexer/lookupAssetTransactions.js.map +0 -1
  852. package/dist/esm/src/client/v2/indexer/lookupBlock.js.map +0 -1
  853. package/dist/esm/src/client/v2/indexer/lookupTransactionByID.js.map +0 -1
  854. package/dist/esm/src/client/v2/indexer/makeHealthCheck.js.map +0 -1
  855. package/dist/esm/src/client/v2/indexer/models/types.js.map +0 -1
  856. package/dist/esm/src/client/v2/indexer/searchAccounts.js.map +0 -1
  857. package/dist/esm/src/client/v2/indexer/searchForApplicationBoxes.js.map +0 -1
  858. package/dist/esm/src/client/v2/indexer/searchForApplications.js.map +0 -1
  859. package/dist/esm/src/client/v2/indexer/searchForAssets.js.map +0 -1
  860. package/dist/esm/src/client/v2/indexer/searchForTransactions.js.map +0 -1
  861. package/dist/esm/src/client/v2/jsonrequest.js.map +0 -1
  862. package/dist/esm/src/client/v2/serviceClient.js.map +0 -1
  863. package/dist/esm/src/composer.js.map +0 -1
  864. package/dist/esm/src/convert.js.map +0 -1
  865. package/dist/esm/src/dryrun.js.map +0 -1
  866. package/dist/esm/src/encoding/address.js.map +0 -1
  867. package/dist/esm/src/encoding/bigint.js.map +0 -1
  868. package/dist/esm/src/encoding/encoding.js.map +0 -1
  869. package/dist/esm/src/encoding/uint64.js.map +0 -1
  870. package/dist/esm/src/group.js.map +0 -1
  871. package/dist/esm/src/logic/logic.js.map +0 -1
  872. package/dist/esm/src/logic/sourcemap.js.map +0 -1
  873. package/dist/esm/src/logicTemplates/dynamicfee.js.map +0 -1
  874. package/dist/esm/src/logicTemplates/htlc.js.map +0 -1
  875. package/dist/esm/src/logicTemplates/index.js.map +0 -1
  876. package/dist/esm/src/logicTemplates/limitorder.js.map +0 -1
  877. package/dist/esm/src/logicTemplates/periodicpayment.js.map +0 -1
  878. package/dist/esm/src/logicTemplates/split.js.map +0 -1
  879. package/dist/esm/src/logicTemplates/templates.js.map +0 -1
  880. package/dist/esm/src/logicsig.js.map +0 -1
  881. package/dist/esm/src/main.js.map +0 -1
  882. package/dist/esm/src/makeTxn.js.map +0 -1
  883. package/dist/esm/src/mnemonic/mnemonic.js.map +0 -1
  884. package/dist/esm/src/mnemonic/wordlists/english.js.map +0 -1
  885. package/dist/esm/src/multisig.js +0 -364
  886. package/dist/esm/src/multisig.js.map +0 -1
  887. package/dist/esm/src/nacl/naclWrappers.js.map +0 -1
  888. package/dist/esm/src/signer.js.map +0 -1
  889. package/dist/esm/src/transaction.js.map +0 -1
  890. package/dist/esm/src/types/account.js.map +0 -1
  891. package/dist/esm/src/types/address.js.map +0 -1
  892. package/dist/esm/src/types/blockHeader.js.map +0 -1
  893. package/dist/esm/src/types/index.js.map +0 -1
  894. package/dist/esm/src/types/intDecoding.js.map +0 -1
  895. package/dist/esm/src/types/multisig.js.map +0 -1
  896. package/dist/esm/src/types/transactions/application.js.map +0 -1
  897. package/dist/esm/src/types/transactions/asset.js.map +0 -1
  898. package/dist/esm/src/types/transactions/base.js.map +0 -1
  899. package/dist/esm/src/types/transactions/builder.js.map +0 -1
  900. package/dist/esm/src/types/transactions/encoded.js.map +0 -1
  901. package/dist/esm/src/types/transactions/index.js.map +0 -1
  902. package/dist/esm/src/types/transactions/keyreg.js.map +0 -1
  903. package/dist/esm/src/types/transactions/payment.js.map +0 -1
  904. package/dist/esm/src/types/transactions/stateproof.js.map +0 -1
  905. package/dist/esm/src/types/utils.js.map +0 -1
  906. package/dist/esm/src/utils/utils.js.map +0 -1
  907. package/dist/esm/src/wait.js.map +0 -1
  908. package/dist/types/src/client/v2/algod/models/types.d.ts +0 -1612
  909. package/dist/types/src/multisig.d.ts +0 -125
package/src/makeTxn.ts ADDED
@@ -0,0 +1,1871 @@
1
+ import * as txnBuilder from './transaction';
2
+ import { OnApplicationComplete } from './types/transactions/base';
3
+ import {
4
+ // Transaction types
5
+ PaymentTxn,
6
+ KeyRegistrationTxn,
7
+
8
+ // Utilities
9
+ TransactionType,
10
+ SuggestedParams,
11
+ MustHaveSuggestedParams,
12
+ MustHaveSuggestedParamsInline,
13
+ AssetCreateTxn,
14
+ AssetConfigTxn,
15
+ AssetDestroyTxn,
16
+ AssetFreezeTxn,
17
+ AssetTransferTxn,
18
+ AppCreateTxn,
19
+ AppUpdateTxn,
20
+ AppDeleteTxn,
21
+ AppOptInTxn,
22
+ AppCloseOutTxn,
23
+ AppClearStateTxn,
24
+ AppNoOpTxn,
25
+ } from './types/transactions';
26
+ import { RenameProperties, RenameProperty, Expand } from './types/utils';
27
+
28
+ /**
29
+ * makePaymentTxnWithSuggestedParams takes payment arguments and returns a Transaction object
30
+ * @param from - string representation of Algorand address of sender
31
+ * @param to - string representation of Algorand address of recipient
32
+ * @param amount - integer amount to send, in microAlgos
33
+ * @param closeRemainderTo - optionally close out remaining account balance to this account, represented as string rep of Algorand address
34
+ * @param note - uint8array of arbitrary data for sender to store
35
+ * @param suggestedParams - a dict holding common-to-all-txns args:
36
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
37
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
38
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
39
+ * firstRound - integer first protocol round on which this txn is valid
40
+ * lastRound - integer last protocol round on which this txn is valid
41
+ * genesisHash - string specifies hash genesis block of network in use
42
+ * genesisID - string specifies genesis ID of network in use
43
+ * @param rekeyTo - rekeyTo address, optional
44
+ */
45
+ export function makePaymentTxnWithSuggestedParams(
46
+ from: PaymentTxn['from'],
47
+ to: PaymentTxn['to'],
48
+ amount: PaymentTxn['amount'],
49
+ closeRemainderTo: PaymentTxn['closeRemainderTo'],
50
+ note: PaymentTxn['note'],
51
+ suggestedParams: MustHaveSuggestedParams<PaymentTxn>['suggestedParams'],
52
+ rekeyTo?: PaymentTxn['reKeyTo']
53
+ ) {
54
+ const o: PaymentTxn = {
55
+ from,
56
+ to,
57
+ amount,
58
+ closeRemainderTo,
59
+ note,
60
+ suggestedParams,
61
+ type: TransactionType.pay,
62
+ reKeyTo: rekeyTo,
63
+ };
64
+ return new txnBuilder.Transaction(o);
65
+ }
66
+
67
+ /**
68
+ * makePaymentTxn takes payment arguments and returns a Transaction object
69
+ * @param from - string representation of Algorand address of sender
70
+ * @param to - string representation of Algorand address of recipient
71
+ * @param fee - integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object
72
+ * If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.
73
+ * @param amount - integer amount to send, in microAlgos
74
+ * @param closeRemainderTo - optionally close out remaining account balance to this account, represented as string rep of Algorand address
75
+ * @param firstRound - integer first protocol round on which this txn is valid
76
+ * @param lastRound - integer last protocol round on which this txn is valid
77
+ * @param note - uint8array of arbitrary data for sender to store
78
+ * @param genesisHash - string specifies hash genesis block of network in use
79
+ * @param genesisID - string specifies genesis ID of network in use
80
+ * @param rekeyTo - rekeyTo address, optional
81
+ * @Deprecated in version 2.0 this will change to use the "WithSuggestedParams" signature.
82
+ */
83
+ export function makePaymentTxn(
84
+ from: PaymentTxn['from'],
85
+ to: PaymentTxn['to'],
86
+ fee: MustHaveSuggestedParamsInline<PaymentTxn>['fee'],
87
+ amount: PaymentTxn['amount'],
88
+ closeRemainderTo: PaymentTxn['closeRemainderTo'],
89
+ firstRound: MustHaveSuggestedParamsInline<PaymentTxn>['firstRound'],
90
+ lastRound: MustHaveSuggestedParamsInline<PaymentTxn>['lastRound'],
91
+ note: PaymentTxn['note'],
92
+ genesisHash: MustHaveSuggestedParamsInline<PaymentTxn>['genesisHash'],
93
+ genesisID: MustHaveSuggestedParamsInline<PaymentTxn>['genesisID'],
94
+ rekeyTo?: PaymentTxn['reKeyTo']
95
+ ) {
96
+ const suggestedParams: SuggestedParams = {
97
+ genesisHash,
98
+ genesisID,
99
+ firstRound,
100
+ lastRound,
101
+ fee,
102
+ };
103
+ return makePaymentTxnWithSuggestedParams(
104
+ from,
105
+ to,
106
+ amount,
107
+ closeRemainderTo,
108
+ note,
109
+ suggestedParams,
110
+ rekeyTo
111
+ );
112
+ }
113
+
114
+ // helper for above makePaymentTxnWithSuggestedParams, instead accepting an arguments object
115
+ export function makePaymentTxnWithSuggestedParamsFromObject(
116
+ o: Expand<
117
+ Pick<
118
+ RenameProperty<MustHaveSuggestedParams<PaymentTxn>, 'reKeyTo', 'rekeyTo'>,
119
+ | 'from'
120
+ | 'to'
121
+ | 'amount'
122
+ | 'closeRemainderTo'
123
+ | 'note'
124
+ | 'suggestedParams'
125
+ | 'rekeyTo'
126
+ >
127
+ >
128
+ ) {
129
+ return makePaymentTxnWithSuggestedParams(
130
+ o.from,
131
+ o.to,
132
+ o.amount,
133
+ o.closeRemainderTo,
134
+ o.note,
135
+ o.suggestedParams,
136
+ o.rekeyTo
137
+ );
138
+ }
139
+
140
+ /**
141
+ * makeKeyRegistrationTxnWithSuggestedParams takes key registration arguments and returns a Transaction object for
142
+ * that key registration operation
143
+ *
144
+ * @param from - string representation of Algorand address of sender
145
+ * @param note - uint8array of arbitrary data for sender to store
146
+ * @param voteKey - voting key. for key deregistration, leave undefined
147
+ * @param selectionKey - selection key. for key deregistration, leave undefined
148
+ * @param voteFirst - first round on which voteKey is valid
149
+ * @param voteLast - last round on which voteKey is valid
150
+ * @param voteKeyDilution - integer
151
+ * @param suggestedParams - a dict holding common-to-all-txns args:
152
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
153
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
154
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
155
+ * firstRound - integer first protocol round on which this txn is valid
156
+ * lastRound - integer last protocol round on which this txn is valid
157
+ * genesisHash - string specifies hash genesis block of network in use
158
+ * genesisID - string specifies genesis ID of network in use
159
+ * @param rekeyTo - rekeyTo address, optional
160
+ * @param nonParticipation - configure whether the address wants to stop participating. If true,
161
+ * voteKey, selectionKey, voteFirst, voteLast, and voteKeyDilution must be undefined.
162
+ * @param stateProofKey - state proof key. for key deregistration, leave undefined
163
+ */
164
+ export function makeKeyRegistrationTxnWithSuggestedParams(
165
+ from: KeyRegistrationTxn['from'],
166
+ note: KeyRegistrationTxn['note'],
167
+ voteKey: KeyRegistrationTxn['voteKey'],
168
+ selectionKey: KeyRegistrationTxn['selectionKey'],
169
+ voteFirst: KeyRegistrationTxn['voteFirst'],
170
+ voteLast: KeyRegistrationTxn['voteLast'],
171
+ voteKeyDilution: KeyRegistrationTxn['voteKeyDilution'],
172
+ suggestedParams: MustHaveSuggestedParams<KeyRegistrationTxn>['suggestedParams'],
173
+ rekeyTo?: KeyRegistrationTxn['reKeyTo'],
174
+ nonParticipation?: false,
175
+ stateProofKey?: KeyRegistrationTxn['stateProofKey']
176
+ ): txnBuilder.Transaction;
177
+ export function makeKeyRegistrationTxnWithSuggestedParams(
178
+ from: KeyRegistrationTxn['from'],
179
+ note: KeyRegistrationTxn['note'],
180
+ voteKey: undefined,
181
+ selectionKey: undefined,
182
+ voteFirst: undefined,
183
+ voteLast: undefined,
184
+ voteKeyDilution: undefined,
185
+ suggestedParams: MustHaveSuggestedParams<KeyRegistrationTxn>['suggestedParams'],
186
+ rekeyTo?: KeyRegistrationTxn['reKeyTo'],
187
+ nonParticipation?: true,
188
+ stateProofKey?: undefined
189
+ ): txnBuilder.Transaction;
190
+ export function makeKeyRegistrationTxnWithSuggestedParams(
191
+ from: any,
192
+ note: any,
193
+ voteKey: any,
194
+ selectionKey: any,
195
+ voteFirst: any,
196
+ voteLast: any,
197
+ voteKeyDilution: any,
198
+ suggestedParams: any,
199
+ rekeyTo?: any,
200
+ nonParticipation = false,
201
+ stateProofKey: any = undefined
202
+ ) {
203
+ const o: KeyRegistrationTxn = {
204
+ from,
205
+ note,
206
+ voteKey,
207
+ selectionKey,
208
+ voteFirst,
209
+ voteLast,
210
+ voteKeyDilution,
211
+ suggestedParams,
212
+ type: TransactionType.keyreg,
213
+ reKeyTo: rekeyTo,
214
+ nonParticipation,
215
+ stateProofKey,
216
+ };
217
+ return new txnBuilder.Transaction(o);
218
+ }
219
+
220
+ /**
221
+ * makeKeyRegistrationTxn takes key registration arguments and returns a Transaction object for
222
+ * that key registration operation
223
+ *
224
+ * @param from - string representation of Algorand address of sender
225
+ * @param fee - integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object
226
+ * If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.
227
+ * @param firstRound - integer first protocol round on which this txn is valid
228
+ * @param lastRound - integer last protocol round on which this txn is valid
229
+ * @param note - uint8array of arbitrary data for sender to store
230
+ * @param genesisHash - string specifies hash genesis block of network in use
231
+ * @param genesisID - string specifies genesis ID of network in use
232
+ * @param voteKey - voting key. for key deregistration, leave undefined
233
+ * @param selectionKey - selection key. for key deregistration, leave undefined
234
+ * @param voteFirst - first round on which voteKey is valid
235
+ * @param voteLast - last round on which voteKey is valid
236
+ * @param voteKeyDilution - integer
237
+ * @param rekeyTo - rekeyTo address, optional
238
+ * @param nonParticipation - configure whether the address wants to stop participating. If true,
239
+ * voteKey, selectionKey, voteFirst, voteLast, and voteKeyDilution must be undefined.
240
+ * @param stateProofKey - state proof key. for key deregistration, leave undefined
241
+ * @Deprecated in version 2.0 this will change to use the "WithSuggestedParams" signature.
242
+ */
243
+ export function makeKeyRegistrationTxn(
244
+ from: KeyRegistrationTxn['from'],
245
+ fee: MustHaveSuggestedParamsInline<KeyRegistrationTxn>['fee'],
246
+ firstRound: MustHaveSuggestedParamsInline<KeyRegistrationTxn>['firstRound'],
247
+ lastRound: MustHaveSuggestedParamsInline<KeyRegistrationTxn>['lastRound'],
248
+ note: KeyRegistrationTxn['note'],
249
+ genesisHash: MustHaveSuggestedParamsInline<KeyRegistrationTxn>['genesisHash'],
250
+ genesisID: MustHaveSuggestedParamsInline<KeyRegistrationTxn>['genesisID'],
251
+ voteKey: KeyRegistrationTxn['voteKey'],
252
+ selectionKey: KeyRegistrationTxn['selectionKey'],
253
+ voteFirst: KeyRegistrationTxn['voteFirst'],
254
+ voteLast: KeyRegistrationTxn['voteLast'],
255
+ voteKeyDilution: KeyRegistrationTxn['voteKeyDilution'],
256
+ rekeyTo?: KeyRegistrationTxn['reKeyTo'],
257
+ nonParticipation?: false,
258
+ stateProofKey?: KeyRegistrationTxn['stateProofKey']
259
+ ): txnBuilder.Transaction;
260
+ export function makeKeyRegistrationTxn(
261
+ from: KeyRegistrationTxn['from'],
262
+ fee: MustHaveSuggestedParamsInline<KeyRegistrationTxn>['fee'],
263
+ firstRound: MustHaveSuggestedParamsInline<KeyRegistrationTxn>['firstRound'],
264
+ lastRound: MustHaveSuggestedParamsInline<KeyRegistrationTxn>['lastRound'],
265
+ note: KeyRegistrationTxn['note'],
266
+ genesisHash: MustHaveSuggestedParamsInline<KeyRegistrationTxn>['genesisHash'],
267
+ genesisID: MustHaveSuggestedParamsInline<KeyRegistrationTxn>['genesisID'],
268
+ voteKey: undefined,
269
+ selectionKey: undefined,
270
+ voteFirst: undefined,
271
+ voteLast: undefined,
272
+ voteKeyDilution: undefined,
273
+ rekeyTo?: KeyRegistrationTxn['reKeyTo'],
274
+ nonParticipation?: true,
275
+ stateProofKey?: undefined
276
+ ): txnBuilder.Transaction;
277
+ export function makeKeyRegistrationTxn(
278
+ from: any,
279
+ fee: any,
280
+ firstRound: any,
281
+ lastRound: any,
282
+ note: any,
283
+ genesisHash: any,
284
+ genesisID: any,
285
+ voteKey: any,
286
+ selectionKey: any,
287
+ voteFirst: any,
288
+ voteLast: any,
289
+ voteKeyDilution: any,
290
+ rekeyTo?: any,
291
+ nonParticipation: any = false,
292
+ stateProofKey: any = undefined
293
+ ) {
294
+ const suggestedParams: SuggestedParams = {
295
+ genesisHash,
296
+ genesisID,
297
+ firstRound,
298
+ lastRound,
299
+ fee,
300
+ };
301
+ return makeKeyRegistrationTxnWithSuggestedParams(
302
+ from,
303
+ note,
304
+ voteKey,
305
+ selectionKey,
306
+ voteFirst,
307
+ voteLast,
308
+ voteKeyDilution,
309
+ suggestedParams,
310
+ rekeyTo,
311
+ nonParticipation,
312
+ stateProofKey
313
+ );
314
+ }
315
+
316
+ // helper for above makeKeyRegistrationTxnWithSuggestedParams, instead accepting an arguments object
317
+ export function makeKeyRegistrationTxnWithSuggestedParamsFromObject(
318
+ o: Expand<
319
+ Pick<
320
+ RenameProperty<
321
+ MustHaveSuggestedParams<KeyRegistrationTxn>,
322
+ 'reKeyTo',
323
+ 'rekeyTo'
324
+ >,
325
+ | 'from'
326
+ | 'note'
327
+ | 'voteKey'
328
+ | 'selectionKey'
329
+ | 'stateProofKey'
330
+ | 'voteFirst'
331
+ | 'voteLast'
332
+ | 'voteKeyDilution'
333
+ | 'suggestedParams'
334
+ | 'rekeyTo'
335
+ > & {
336
+ nonParticipation?: false;
337
+ }
338
+ >
339
+ ): txnBuilder.Transaction;
340
+ export function makeKeyRegistrationTxnWithSuggestedParamsFromObject(
341
+ o: Expand<
342
+ Pick<
343
+ RenameProperty<
344
+ MustHaveSuggestedParams<KeyRegistrationTxn>,
345
+ 'reKeyTo',
346
+ 'rekeyTo'
347
+ >,
348
+ 'from' | 'note' | 'suggestedParams' | 'rekeyTo'
349
+ > & {
350
+ nonParticipation: true;
351
+ }
352
+ >
353
+ ): txnBuilder.Transaction;
354
+ export function makeKeyRegistrationTxnWithSuggestedParamsFromObject(o: any) {
355
+ return makeKeyRegistrationTxnWithSuggestedParams(
356
+ o.from,
357
+ o.note,
358
+ o.voteKey,
359
+ o.selectionKey,
360
+ o.voteFirst,
361
+ o.voteLast,
362
+ o.voteKeyDilution,
363
+ o.suggestedParams,
364
+ o.rekeyTo,
365
+ o.nonParticipation,
366
+ o.stateProofKey
367
+ );
368
+ }
369
+
370
+ /** makeAssetCreateTxnWithSuggestedParams takes asset creation arguments and returns a Transaction object
371
+ * for creating that asset
372
+ *
373
+ * @param from - string representation of Algorand address of sender
374
+ * @param note - uint8array of arbitrary data for sender to store
375
+ * @param total - integer total supply of the asset
376
+ * @param decimals - integer number of decimals for asset unit calculation
377
+ * @param defaultFrozen - boolean whether asset accounts should default to being frozen
378
+ * @param manager - string representation of Algorand address in charge of reserve, freeze, clawback, destruction, etc
379
+ * @param reserve - string representation of Algorand address representing asset reserve
380
+ * @param freeze - string representation of Algorand address with power to freeze/unfreeze asset holdings
381
+ * @param clawback - string representation of Algorand address with power to revoke asset holdings
382
+ * @param unitName - string units name for this asset
383
+ * @param assetName - string name for this asset
384
+ * @param assetURL - string URL relating to this asset
385
+ * @param assetMetadataHash - Uint8Array or UTF-8 string representation of a hash commitment with respect to the asset. Must be exactly 32 bytes long.
386
+ * @param suggestedParams - a dict holding common-to-all-txns args:
387
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
388
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
389
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
390
+ * firstRound - integer first protocol round on which this txn is valid
391
+ * lastRound - integer last protocol round on which this txn is valid
392
+ * genesisHash - string specifies hash genesis block of network in use
393
+ * genesisID - string specifies genesis ID of network in use
394
+ * @param rekeyTo - rekeyTo address, optional
395
+ */
396
+ export function makeAssetCreateTxnWithSuggestedParams(
397
+ from: AssetCreateTxn['from'],
398
+ note: AssetCreateTxn['note'],
399
+ total: AssetCreateTxn['assetTotal'],
400
+ decimals: AssetCreateTxn['assetDecimals'],
401
+ defaultFrozen: AssetCreateTxn['assetDefaultFrozen'],
402
+ manager: AssetCreateTxn['assetManager'],
403
+ reserve: AssetCreateTxn['assetReserve'],
404
+ freeze: AssetCreateTxn['assetFreeze'],
405
+ clawback: AssetCreateTxn['assetClawback'],
406
+ unitName: AssetCreateTxn['assetUnitName'],
407
+ assetName: AssetCreateTxn['assetName'],
408
+ assetURL: AssetCreateTxn['assetURL'],
409
+ assetMetadataHash: AssetCreateTxn['assetMetadataHash'] | undefined,
410
+ suggestedParams: MustHaveSuggestedParams<AssetCreateTxn>['suggestedParams'],
411
+ rekeyTo?: AssetCreateTxn['reKeyTo']
412
+ ) {
413
+ const o: AssetCreateTxn = {
414
+ from,
415
+ note,
416
+ suggestedParams,
417
+ assetTotal: total,
418
+ assetDecimals: decimals,
419
+ assetDefaultFrozen: defaultFrozen,
420
+ assetUnitName: unitName,
421
+ assetName,
422
+ assetURL,
423
+ assetMetadataHash,
424
+ assetManager: manager,
425
+ assetReserve: reserve,
426
+ assetFreeze: freeze,
427
+ assetClawback: clawback,
428
+ type: TransactionType.acfg,
429
+ reKeyTo: rekeyTo,
430
+ };
431
+ return new txnBuilder.Transaction(o);
432
+ }
433
+
434
+ /** makeAssetCreateTxn takes asset creation arguments and returns a Transaction object
435
+ * for creating that asset
436
+ *
437
+ * @param from - string representation of Algorand address of sender
438
+ * @param fee - integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object
439
+ * If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.
440
+ * @param firstRound - integer first protocol round on which this txn is valid
441
+ * @param lastRound - integer last protocol round on which this txn is valid
442
+ * @param note - uint8array of arbitrary data for sender to store
443
+ * @param genesisHash - string specifies hash genesis block of network in use
444
+ * @param genesisID - string specifies genesis ID of network in use
445
+ * @param total - integer total supply of the asset
446
+ * @param decimals - integer number of decimals for asset unit calculation
447
+ * @param defaultFrozen - boolean whether asset accounts should default to being frozen
448
+ * @param manager - string representation of Algorand address in charge of reserve, freeze, clawback, destruction, etc
449
+ * @param reserve - string representation of Algorand address representing asset reserve
450
+ * @param freeze - string representation of Algorand address with power to freeze/unfreeze asset holdings
451
+ * @param clawback - string representation of Algorand address with power to revoke asset holdings
452
+ * @param unitName - string units name for this asset
453
+ * @param assetName - string name for this asset
454
+ * @param assetURL - string URL relating to this asset
455
+ * @param assetMetadataHash - Uint8Array or UTF-8 string representation of a hash commitment with respect to the asset. Must be exactly 32 bytes long.
456
+ * @param rekeyTo - rekeyTo address, optional
457
+ * @Deprecated in version 2.0 this will change to use the "WithSuggestedParams" signature.
458
+ */
459
+ export function makeAssetCreateTxn(
460
+ from: AssetCreateTxn['from'],
461
+ fee: MustHaveSuggestedParamsInline<AssetCreateTxn>['fee'],
462
+ firstRound: MustHaveSuggestedParamsInline<AssetCreateTxn>['firstRound'],
463
+ lastRound: MustHaveSuggestedParamsInline<AssetCreateTxn>['lastRound'],
464
+ note: AssetCreateTxn['note'],
465
+ genesisHash: MustHaveSuggestedParamsInline<AssetCreateTxn>['genesisHash'],
466
+ genesisID: MustHaveSuggestedParamsInline<AssetCreateTxn>['genesisID'],
467
+ total: AssetCreateTxn['assetTotal'],
468
+ decimals: AssetCreateTxn['assetDecimals'],
469
+ defaultFrozen: AssetCreateTxn['assetDefaultFrozen'],
470
+ manager: AssetCreateTxn['assetManager'],
471
+ reserve: AssetCreateTxn['assetManager'],
472
+ freeze: AssetCreateTxn['assetFreeze'],
473
+ clawback: AssetCreateTxn['assetClawback'],
474
+ unitName: AssetCreateTxn['assetUnitName'],
475
+ assetName: AssetCreateTxn['assetName'],
476
+ assetURL: AssetCreateTxn['assetURL'],
477
+ assetMetadataHash?: AssetCreateTxn['assetMetadataHash'],
478
+ rekeyTo?: AssetCreateTxn['reKeyTo']
479
+ ) {
480
+ const suggestedParams: SuggestedParams = {
481
+ genesisHash,
482
+ genesisID,
483
+ firstRound,
484
+ lastRound,
485
+ fee,
486
+ };
487
+ return makeAssetCreateTxnWithSuggestedParams(
488
+ from,
489
+ note,
490
+ total,
491
+ decimals,
492
+ defaultFrozen,
493
+ manager,
494
+ reserve,
495
+ freeze,
496
+ clawback,
497
+ unitName,
498
+ assetName,
499
+ assetURL,
500
+ assetMetadataHash,
501
+ suggestedParams,
502
+ rekeyTo
503
+ );
504
+ }
505
+
506
+ // helper for above makeAssetCreateTxnWithSuggestedParams, instead accepting an arguments object
507
+ export function makeAssetCreateTxnWithSuggestedParamsFromObject(
508
+ o: Expand<
509
+ Pick<
510
+ RenameProperties<
511
+ MustHaveSuggestedParams<AssetCreateTxn>,
512
+ {
513
+ reKeyTo: 'rekeyTo';
514
+ assetTotal: 'total';
515
+ assetDecimals: 'decimals';
516
+ assetDefaultFrozen: 'defaultFrozen';
517
+ assetManager: 'manager';
518
+ assetReserve: 'reserve';
519
+ assetFreeze: 'freeze';
520
+ assetClawback: 'clawback';
521
+ assetUnitName: 'unitName';
522
+ }
523
+ >,
524
+ | 'from'
525
+ | 'note'
526
+ | 'total'
527
+ | 'decimals'
528
+ | 'defaultFrozen'
529
+ | 'manager'
530
+ | 'reserve'
531
+ | 'freeze'
532
+ | 'clawback'
533
+ | 'unitName'
534
+ | 'assetName'
535
+ | 'assetURL'
536
+ | 'assetMetadataHash'
537
+ | 'suggestedParams'
538
+ | 'rekeyTo'
539
+ >
540
+ >
541
+ ) {
542
+ return makeAssetCreateTxnWithSuggestedParams(
543
+ o.from,
544
+ o.note,
545
+ o.total,
546
+ o.decimals,
547
+ o.defaultFrozen,
548
+ o.manager,
549
+ o.reserve,
550
+ o.freeze,
551
+ o.clawback,
552
+ o.unitName,
553
+ o.assetName,
554
+ o.assetURL,
555
+ o.assetMetadataHash,
556
+ o.suggestedParams,
557
+ o.rekeyTo
558
+ );
559
+ }
560
+
561
+ /** makeAssetConfigTxnWithSuggestedParams can be issued by the asset manager to change the manager, reserve, freeze, or clawback
562
+ * you must respecify existing addresses to keep them the same; leaving a field blank is the same as turning
563
+ * that feature off for this asset
564
+ *
565
+ * @param from - string representation of Algorand address of sender
566
+ * @param note - uint8array of arbitrary data for sender to store
567
+ * @param assetIndex - int asset index uniquely specifying the asset
568
+ * @param manager - string representation of new asset manager Algorand address
569
+ * @param reserve - string representation of new reserve Algorand address
570
+ * @param freeze - string representation of new freeze manager Algorand address
571
+ * @param clawback - string representation of new revocation manager Algorand address
572
+ * @param strictEmptyAddressChecking - boolean - throw an error if any of manager, reserve, freeze, or clawback are undefined. optional, defaults to true.
573
+ * @param suggestedParams - a dict holding common-to-all-txns args:
574
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
575
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
576
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
577
+ * firstRound - integer first protocol round on which this txn is valid
578
+ * lastRound - integer last protocol round on which this txn is valid
579
+ * genesisHash - string specifies hash genesis block of network in use
580
+ * genesisID - string specifies genesis ID of network in use
581
+ * @param rekeyTo - rekeyTo address, optional
582
+ */
583
+ export function makeAssetConfigTxnWithSuggestedParams(
584
+ from: AssetConfigTxn['from'],
585
+ note: AssetConfigTxn['note'],
586
+ assetIndex: AssetConfigTxn['assetIndex'],
587
+ manager: AssetConfigTxn['assetManager'],
588
+ reserve: AssetConfigTxn['assetReserve'],
589
+ freeze: AssetConfigTxn['assetFreeze'],
590
+ clawback: AssetConfigTxn['assetClawback'],
591
+ suggestedParams: MustHaveSuggestedParams<AssetConfigTxn>['suggestedParams'],
592
+ strictEmptyAddressChecking = true,
593
+ rekeyTo?: AssetConfigTxn['reKeyTo']
594
+ ) {
595
+ if (
596
+ strictEmptyAddressChecking &&
597
+ (manager === undefined ||
598
+ reserve === undefined ||
599
+ freeze === undefined ||
600
+ clawback === undefined)
601
+ ) {
602
+ throw Error(
603
+ 'strict empty address checking was turned on, but at least one empty address was provided'
604
+ );
605
+ }
606
+ const o: AssetConfigTxn = {
607
+ from,
608
+ suggestedParams,
609
+ assetIndex,
610
+ assetManager: manager,
611
+ assetReserve: reserve,
612
+ assetFreeze: freeze,
613
+ assetClawback: clawback,
614
+ type: TransactionType.acfg,
615
+ note,
616
+ reKeyTo: rekeyTo,
617
+ };
618
+ return new txnBuilder.Transaction(o);
619
+ }
620
+
621
+ /** makeAssetConfigTxn can be issued by the asset manager to change the manager, reserve, freeze, or clawback
622
+ * you must respecify existing addresses to keep them the same; leaving a field blank is the same as turning
623
+ * that feature off for this asset
624
+ *
625
+ * @param from - string representation of Algorand address of sender
626
+ * @param fee - integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object
627
+ * If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.
628
+ * @param firstRound - integer first protocol round on which this txn is valid
629
+ * @param lastRound - integer last protocol round on which this txn is valid
630
+ * @param note - uint8array of arbitrary data for sender to store
631
+ * @param genesisHash - string specifies hash genesis block of network in use
632
+ * @param genesisID - string specifies genesis ID of network in use
633
+ * @param assetIndex - int asset index uniquely specifying the asset
634
+ * @param manager - string representation of new asset manager Algorand address
635
+ * @param reserve - string representation of new reserve Algorand address
636
+ * @param freeze - string representation of new freeze manager Algorand address
637
+ * @param clawback - string representation of new revocation manager Algorand address
638
+ * @param strictEmptyAddressChecking - boolean - throw an error if any of manager, reserve, freeze, or clawback are undefined. optional, defaults to true.
639
+ * @param rekeyTo - rekeyTo address, optional
640
+ * @Deprecated in version 2.0 this will change to use the "WithSuggestedParams" signature.
641
+ */
642
+ export function makeAssetConfigTxn(
643
+ from: AssetConfigTxn['from'],
644
+ fee: MustHaveSuggestedParamsInline<AssetConfigTxn>['fee'],
645
+ firstRound: MustHaveSuggestedParamsInline<AssetConfigTxn>['firstRound'],
646
+ lastRound: MustHaveSuggestedParamsInline<AssetConfigTxn>['lastRound'],
647
+ note: AssetConfigTxn['note'],
648
+ genesisHash: MustHaveSuggestedParamsInline<AssetConfigTxn>['genesisHash'],
649
+ genesisID: MustHaveSuggestedParamsInline<AssetConfigTxn>['genesisID'],
650
+ assetIndex: AssetConfigTxn['assetIndex'],
651
+ manager: AssetConfigTxn['assetManager'],
652
+ reserve: AssetConfigTxn['assetReserve'],
653
+ freeze: AssetConfigTxn['assetFreeze'],
654
+ clawback: AssetConfigTxn['assetClawback'],
655
+ strictEmptyAddressChecking = true,
656
+ rekeyTo?: AssetConfigTxn['reKeyTo']
657
+ ) {
658
+ const suggestedParams: SuggestedParams = {
659
+ genesisHash,
660
+ genesisID,
661
+ firstRound,
662
+ lastRound,
663
+ fee,
664
+ };
665
+ return makeAssetConfigTxnWithSuggestedParams(
666
+ from,
667
+ note,
668
+ assetIndex,
669
+ manager,
670
+ reserve,
671
+ freeze,
672
+ clawback,
673
+ suggestedParams,
674
+ strictEmptyAddressChecking,
675
+ rekeyTo
676
+ );
677
+ }
678
+
679
+ // helper for above makeAssetConfigTxnWithSuggestedParams, instead accepting an arguments object
680
+ export function makeAssetConfigTxnWithSuggestedParamsFromObject(
681
+ o: Expand<
682
+ Pick<
683
+ RenameProperties<
684
+ MustHaveSuggestedParams<AssetConfigTxn>,
685
+ {
686
+ reKeyTo: 'rekeyTo';
687
+ assetManager: 'manager';
688
+ assetReserve: 'reserve';
689
+ assetFreeze: 'freeze';
690
+ assetClawback: 'clawback';
691
+ }
692
+ >,
693
+ | 'from'
694
+ | 'note'
695
+ | 'assetIndex'
696
+ | 'manager'
697
+ | 'reserve'
698
+ | 'freeze'
699
+ | 'clawback'
700
+ | 'suggestedParams'
701
+ | 'rekeyTo'
702
+ > & {
703
+ strictEmptyAddressChecking: boolean;
704
+ }
705
+ >
706
+ ) {
707
+ return makeAssetConfigTxnWithSuggestedParams(
708
+ o.from,
709
+ o.note,
710
+ o.assetIndex,
711
+ o.manager,
712
+ o.reserve,
713
+ o.freeze,
714
+ o.clawback,
715
+ o.suggestedParams,
716
+ o.strictEmptyAddressChecking,
717
+ o.rekeyTo
718
+ );
719
+ }
720
+
721
+ /** makeAssetDestroyTxnWithSuggestedParams will allow the asset's manager to remove this asset from the ledger, so long
722
+ * as all outstanding assets are held by the creator.
723
+ *
724
+ * @param from - string representation of Algorand address of sender
725
+ * @param note - uint8array of arbitrary data for sender to store
726
+ * @param assetIndex - int asset index uniquely specifying the asset
727
+ * @param suggestedParams - a dict holding common-to-all-txns args:
728
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
729
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
730
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
731
+ * firstRound - integer first protocol round on which this txn is valid
732
+ * lastRound - integer last protocol round on which this txn is valid
733
+ * genesisHash - string specifies hash genesis block of network in use
734
+ * genesisID - string specifies genesis ID of network in use
735
+ * @param rekeyTo - rekeyTo address, optional
736
+ */
737
+ export function makeAssetDestroyTxnWithSuggestedParams(
738
+ from: AssetDestroyTxn['from'],
739
+ note: AssetDestroyTxn['note'],
740
+ assetIndex: AssetDestroyTxn['assetIndex'],
741
+ suggestedParams: MustHaveSuggestedParams<AssetDestroyTxn>['suggestedParams'],
742
+ rekeyTo?: AssetDestroyTxn['reKeyTo']
743
+ ) {
744
+ const o: AssetDestroyTxn = {
745
+ from,
746
+ suggestedParams,
747
+ assetIndex,
748
+ type: TransactionType.acfg,
749
+ note,
750
+ reKeyTo: rekeyTo,
751
+ };
752
+ return new txnBuilder.Transaction(o);
753
+ }
754
+
755
+ /** makeAssetDestroyTxn will allow the asset's manager to remove this asset from the ledger, so long
756
+ * as all outstanding assets are held by the creator.
757
+ *
758
+ * @param from - string representation of Algorand address of sender
759
+ * @param fee - integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object
760
+ * If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.
761
+ * @param firstRound - integer first protocol round on which this txn is valid
762
+ * @param lastRound - integer last protocol round on which this txn is valid
763
+ * @param note - uint8array of arbitrary data for sender to store
764
+ * @param genesisHash - string specifies hash genesis block of network in use
765
+ * @param genesisID - string specifies genesis ID of network in use
766
+ * @param assetIndex - int asset index uniquely specifying the asset
767
+ * @param rekeyTo - rekeyTo address, optional
768
+ * @Deprecated in version 2.0 this will change to use the "WithSuggestedParams" signature.
769
+ */
770
+ export function makeAssetDestroyTxn(
771
+ from: AssetDestroyTxn['from'],
772
+ fee: MustHaveSuggestedParamsInline<AssetDestroyTxn>['fee'],
773
+ firstRound: MustHaveSuggestedParamsInline<AssetDestroyTxn>['firstRound'],
774
+ lastRound: MustHaveSuggestedParamsInline<AssetDestroyTxn>['lastRound'],
775
+ note: AssetDestroyTxn['note'],
776
+ genesisHash: MustHaveSuggestedParamsInline<AssetDestroyTxn>['genesisHash'],
777
+ genesisID: MustHaveSuggestedParamsInline<AssetDestroyTxn>['genesisID'],
778
+ assetIndex: AssetDestroyTxn['assetIndex'],
779
+ rekeyTo?: AssetDestroyTxn['reKeyTo']
780
+ ) {
781
+ const suggestedParams: SuggestedParams = {
782
+ genesisHash,
783
+ genesisID,
784
+ firstRound,
785
+ lastRound,
786
+ fee,
787
+ };
788
+ return makeAssetDestroyTxnWithSuggestedParams(
789
+ from,
790
+ note,
791
+ assetIndex,
792
+ suggestedParams,
793
+ rekeyTo
794
+ );
795
+ }
796
+
797
+ // helper for above makeAssetDestroyTxnWithSuggestedParams, instead accepting an arguments object
798
+ export function makeAssetDestroyTxnWithSuggestedParamsFromObject(
799
+ o: Expand<
800
+ Pick<
801
+ RenameProperty<
802
+ MustHaveSuggestedParams<AssetDestroyTxn>,
803
+ 'reKeyTo',
804
+ 'rekeyTo'
805
+ >,
806
+ 'from' | 'note' | 'assetIndex' | 'suggestedParams' | 'rekeyTo'
807
+ >
808
+ >
809
+ ) {
810
+ return makeAssetDestroyTxnWithSuggestedParams(
811
+ o.from,
812
+ o.note,
813
+ o.assetIndex,
814
+ o.suggestedParams,
815
+ o.rekeyTo
816
+ );
817
+ }
818
+
819
+ /** makeAssetFreezeTxnWithSuggestedParams will allow the asset's freeze manager to freeze or un-freeze an account,
820
+ * blocking or allowing asset transfers to and from the targeted account.
821
+ *
822
+ * @param from - string representation of Algorand address of sender
823
+ * @param note - uint8array of arbitrary data for sender to store
824
+ * @param assetIndex - int asset index uniquely specifying the asset
825
+ * @param freezeTarget - string representation of Algorand address being frozen or unfrozen
826
+ * @param freezeState - true if freezeTarget should be frozen, false if freezeTarget should be allowed to transact
827
+ * @param suggestedParams - a dict holding common-to-all-txns args:
828
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
829
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
830
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
831
+ * firstRound - integer first protocol round on which this txn is valid
832
+ * lastRound - integer last protocol round on which this txn is valid
833
+ * genesisHash - string specifies hash genesis block of network in use
834
+ * genesisID - string specifies genesis ID of network in use
835
+ * @param rekeyTo - rekeyTo address, optional
836
+ */
837
+ export function makeAssetFreezeTxnWithSuggestedParams(
838
+ from: AssetFreezeTxn['from'],
839
+ note: AssetFreezeTxn['note'],
840
+ assetIndex: AssetFreezeTxn['assetIndex'],
841
+ freezeTarget: AssetFreezeTxn['freezeAccount'],
842
+ freezeState: AssetFreezeTxn['freezeState'],
843
+ suggestedParams: MustHaveSuggestedParams<AssetFreezeTxn>['suggestedParams'],
844
+ rekeyTo?: AssetFreezeTxn['reKeyTo']
845
+ ) {
846
+ const o: AssetFreezeTxn = {
847
+ from,
848
+ type: TransactionType.afrz,
849
+ freezeAccount: freezeTarget,
850
+ assetIndex,
851
+ freezeState,
852
+ note,
853
+ suggestedParams,
854
+ reKeyTo: rekeyTo,
855
+ };
856
+ return new txnBuilder.Transaction(o);
857
+ }
858
+
859
+ /** makeAssetFreezeTxn will allow the asset's freeze manager to freeze or un-freeze an account,
860
+ * blocking or allowing asset transfers to and from the targeted account.
861
+ *
862
+ * @param from - string representation of Algorand address of sender
863
+ * @param fee - integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object
864
+ * If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.
865
+ * @param firstRound - integer first protocol round on which this txn is valid
866
+ * @param lastRound - integer last protocol round on which this txn is valid
867
+ * @param note - uint8array of arbitrary data for sender to store
868
+ * @param genesisHash - string specifies hash genesis block of network in use
869
+ * @param genesisID - string specifies genesis ID of network in use
870
+ * @param assetIndex - int asset index uniquely specifying the asset
871
+ * @param freezeTarget - string representation of Algorand address being frozen or unfrozen
872
+ * @param freezeState - true if freezeTarget should be frozen, false if freezeTarget should be allowed to transact
873
+ * @param rekeyTo - rekeyTo address, optional
874
+ * @Deprecated in version 2.0 this will change to use the "WithSuggestedParams" signature.
875
+ */
876
+ export function makeAssetFreezeTxn(
877
+ from: AssetFreezeTxn['from'],
878
+ fee: MustHaveSuggestedParamsInline<AssetFreezeTxn>['fee'],
879
+ firstRound: MustHaveSuggestedParamsInline<AssetFreezeTxn>['firstRound'],
880
+ lastRound: MustHaveSuggestedParamsInline<AssetFreezeTxn>['lastRound'],
881
+ note: MustHaveSuggestedParamsInline<AssetFreezeTxn>['note'],
882
+ genesisHash: MustHaveSuggestedParamsInline<AssetFreezeTxn>['genesisHash'],
883
+ genesisID: MustHaveSuggestedParamsInline<AssetFreezeTxn>['genesisID'],
884
+ assetIndex: AssetFreezeTxn['assetIndex'],
885
+ freezeTarget: AssetFreezeTxn['freezeAccount'],
886
+ freezeState: AssetFreezeTxn['freezeState'],
887
+ rekeyTo?: AssetFreezeTxn['reKeyTo']
888
+ ) {
889
+ const suggestedParams: SuggestedParams = {
890
+ genesisHash,
891
+ genesisID,
892
+ firstRound,
893
+ lastRound,
894
+ fee,
895
+ };
896
+ return makeAssetFreezeTxnWithSuggestedParams(
897
+ from,
898
+ note,
899
+ assetIndex,
900
+ freezeTarget,
901
+ freezeState,
902
+ suggestedParams,
903
+ rekeyTo
904
+ );
905
+ }
906
+
907
+ // helper for above makeAssetFreezeTxnWithSuggestedParams, instead accepting an arguments object
908
+ export function makeAssetFreezeTxnWithSuggestedParamsFromObject(
909
+ o: Expand<
910
+ Pick<
911
+ RenameProperties<
912
+ MustHaveSuggestedParams<AssetFreezeTxn>,
913
+ {
914
+ freezeAccount: 'freezeTarget';
915
+ reKeyTo: 'rekeyTo';
916
+ }
917
+ >,
918
+ | 'from'
919
+ | 'note'
920
+ | 'assetIndex'
921
+ | 'freezeTarget'
922
+ | 'freezeState'
923
+ | 'suggestedParams'
924
+ | 'rekeyTo'
925
+ >
926
+ >
927
+ ) {
928
+ return makeAssetFreezeTxnWithSuggestedParams(
929
+ o.from,
930
+ o.note,
931
+ o.assetIndex,
932
+ o.freezeTarget,
933
+ o.freezeState,
934
+ o.suggestedParams,
935
+ o.rekeyTo
936
+ );
937
+ }
938
+
939
+ /** makeAssetTransferTxnWithSuggestedParams allows for the creation of an asset transfer transaction.
940
+ * Special case: to begin accepting assets, set amount=0 and from=to.
941
+ *
942
+ * @param from - string representation of Algorand address of sender
943
+ * @param to - string representation of Algorand address of asset recipient
944
+ * @param closeRemainderTo - optional - string representation of Algorand address - if provided,
945
+ * send all remaining assets after transfer to the "closeRemainderTo" address and close "from"'s asset holdings
946
+ * @param revocationTarget - optional - string representation of Algorand address - if provided,
947
+ * and if "from" is the asset's revocation manager, then deduct from "revocationTarget" rather than "from"
948
+ * @param amount - integer amount of assets to send
949
+ * @param note - uint8array of arbitrary data for sender to store
950
+ * @param assetIndex - int asset index uniquely specifying the asset
951
+ * @param suggestedParams - a dict holding common-to-all-txns args:
952
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
953
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
954
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
955
+ * * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
956
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
957
+ * firstRound - integer first protocol round on which this txn is valid
958
+ * lastRound - integer last protocol round on which this txn is valid
959
+ * genesisHash - string specifies hash genesis block of network in use
960
+ * genesisID - string specifies genesis ID of network in use
961
+ * @param rekeyTo - rekeyTo address, optional
962
+ */
963
+ export function makeAssetTransferTxnWithSuggestedParams(
964
+ from: AssetTransferTxn['from'],
965
+ to: AssetTransferTxn['to'],
966
+ closeRemainderTo: AssetTransferTxn['closeRemainderTo'],
967
+ revocationTarget: AssetTransferTxn['assetRevocationTarget'],
968
+ amount: AssetTransferTxn['amount'],
969
+ note: AssetTransferTxn['note'],
970
+ assetIndex: AssetTransferTxn['assetIndex'],
971
+ suggestedParams: MustHaveSuggestedParams<AssetTransferTxn>['suggestedParams'],
972
+ rekeyTo?: AssetTransferTxn['reKeyTo']
973
+ ) {
974
+ const o: AssetTransferTxn = {
975
+ type: TransactionType.axfer,
976
+ from,
977
+ to,
978
+ amount,
979
+ suggestedParams,
980
+ assetIndex,
981
+ note,
982
+ assetRevocationTarget: revocationTarget,
983
+ closeRemainderTo,
984
+ reKeyTo: rekeyTo,
985
+ };
986
+ return new txnBuilder.Transaction(o);
987
+ }
988
+
989
+ /** makeAssetTransferTxn allows for the creation of an asset transfer transaction.
990
+ * Special case: to begin accepting assets, set amount=0 and from=to.
991
+ *
992
+ * @param from - string representation of Algorand address of sender
993
+ * @param to - string representation of Algorand address of asset recipient
994
+ * @param closeRemainderTo - optional - string representation of Algorand address - if provided,
995
+ * send all remaining assets after transfer to the "closeRemainderTo" address and close "from"'s asset holdings
996
+ * @param revocationTarget - optional - string representation of Algorand address - if provided,
997
+ * and if "from" is the asset's revocation manager, then deduct from "revocationTarget" rather than "from"
998
+ * @param fee - integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object
999
+ * If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.
1000
+ * @param amount - integer amount of assets to send
1001
+ * @param firstRound - integer first protocol round on which this txn is valid
1002
+ * @param lastRound - integer last protocol round on which this txn is valid
1003
+ * @param note - uint8array of arbitrary data for sender to store
1004
+ * @param genesisHash - string specifies hash genesis block of network in use
1005
+ * @param genesisID - string specifies genesis ID of network in use
1006
+ * @param assetIndex - int asset index uniquely specifying the asset
1007
+ * @param rekeyTo - rekeyTo address, optional
1008
+ * @Deprecated in version 2.0 this will change to use the "WithSuggestedParams" signature.
1009
+ */
1010
+ export function makeAssetTransferTxn(
1011
+ from: AssetTransferTxn['from'],
1012
+ to: AssetTransferTxn['to'],
1013
+ closeRemainderTo: AssetTransferTxn['closeRemainderTo'],
1014
+ revocationTarget: AssetTransferTxn['assetRevocationTarget'],
1015
+ fee: MustHaveSuggestedParamsInline<AssetTransferTxn>['fee'],
1016
+ amount: AssetTransferTxn['amount'],
1017
+ firstRound: MustHaveSuggestedParamsInline<AssetTransferTxn>['firstRound'],
1018
+ lastRound: MustHaveSuggestedParamsInline<AssetTransferTxn>['lastRound'],
1019
+ note: AssetTransferTxn['note'],
1020
+ genesisHash: MustHaveSuggestedParamsInline<AssetTransferTxn>['genesisHash'],
1021
+ genesisID: MustHaveSuggestedParamsInline<AssetTransferTxn>['genesisID'],
1022
+ assetIndex: AssetTransferTxn['assetIndex'],
1023
+ rekeyTo?: AssetTransferTxn['reKeyTo']
1024
+ ) {
1025
+ const suggestedParams: SuggestedParams = {
1026
+ genesisHash,
1027
+ genesisID,
1028
+ firstRound,
1029
+ lastRound,
1030
+ fee,
1031
+ };
1032
+ return makeAssetTransferTxnWithSuggestedParams(
1033
+ from,
1034
+ to,
1035
+ closeRemainderTo,
1036
+ revocationTarget,
1037
+ amount,
1038
+ note,
1039
+ assetIndex,
1040
+ suggestedParams,
1041
+ rekeyTo
1042
+ );
1043
+ }
1044
+
1045
+ // helper for above makeAssetTransferTxnWithSuggestedParams, instead accepting an arguments object
1046
+ export function makeAssetTransferTxnWithSuggestedParamsFromObject(
1047
+ o: Expand<
1048
+ Pick<
1049
+ RenameProperties<
1050
+ MustHaveSuggestedParams<AssetTransferTxn>,
1051
+ {
1052
+ assetRevocationTarget: 'revocationTarget';
1053
+ reKeyTo: 'rekeyTo';
1054
+ }
1055
+ >,
1056
+ | 'from'
1057
+ | 'to'
1058
+ | 'closeRemainderTo'
1059
+ | 'revocationTarget'
1060
+ | 'amount'
1061
+ | 'note'
1062
+ | 'assetIndex'
1063
+ | 'suggestedParams'
1064
+ | 'rekeyTo'
1065
+ >
1066
+ >
1067
+ ) {
1068
+ return makeAssetTransferTxnWithSuggestedParams(
1069
+ o.from,
1070
+ o.to,
1071
+ o.closeRemainderTo,
1072
+ o.revocationTarget,
1073
+ o.amount,
1074
+ o.note,
1075
+ o.assetIndex,
1076
+ o.suggestedParams,
1077
+ o.rekeyTo
1078
+ );
1079
+ }
1080
+
1081
+ /**
1082
+ * Make a transaction that will create an application.
1083
+ * @param from - address of sender
1084
+ * @param suggestedParams - a dict holding common-to-all-txns args:
1085
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
1086
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
1087
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
1088
+ * firstRound - integer first protocol round on which this txn is valid
1089
+ * lastRound - integer last protocol round on which this txn is valid
1090
+ * genesisHash - string specifies hash genesis block of network in use
1091
+ * genesisID - string specifies genesis ID of network in use
1092
+ * @param onComplete - algosdk.OnApplicationComplete, what application should do once the program is done being run
1093
+ * @param approvalProgram - Uint8Array, the compiled TEAL that approves a transaction
1094
+ * @param clearProgram - Uint8Array, the compiled TEAL that runs when clearing state
1095
+ * @param numLocalInts - restricts number of ints in per-user local state
1096
+ * @param numLocalByteSlices - restricts number of byte slices in per-user local state
1097
+ * @param numGlobalInts - restricts number of ints in global state
1098
+ * @param numGlobalByteSlices - restricts number of byte slices in global state
1099
+ * @param appArgs - Array of Uint8Array, any additional arguments to the application
1100
+ * @param accounts - Array of Address strings, any additional accounts to supply to the application
1101
+ * @param foreignApps - Array of int, any other apps used by the application, identified by index
1102
+ * @param foreignAssets - Array of int, any assets used by the application, identified by index
1103
+ * @param note - Arbitrary data for sender to store
1104
+ * @param lease - Lease a transaction
1105
+ * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1106
+ * @param extraPages - integer extra pages of memory to rent on creation of application
1107
+ * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1108
+ */
1109
+ export function makeApplicationCreateTxn(
1110
+ from: AppCreateTxn['from'],
1111
+ suggestedParams: MustHaveSuggestedParams<AppCreateTxn>['suggestedParams'],
1112
+ onComplete: AppCreateTxn['appOnComplete'],
1113
+ approvalProgram: AppCreateTxn['appApprovalProgram'],
1114
+ clearProgram: AppCreateTxn['appClearProgram'],
1115
+ numLocalInts: AppCreateTxn['appLocalInts'],
1116
+ numLocalByteSlices: AppCreateTxn['appLocalByteSlices'],
1117
+ numGlobalInts: AppCreateTxn['appGlobalInts'],
1118
+ numGlobalByteSlices: AppCreateTxn['appGlobalByteSlices'],
1119
+ appArgs?: AppCreateTxn['appArgs'],
1120
+ accounts?: AppCreateTxn['appAccounts'],
1121
+ foreignApps?: AppCreateTxn['appForeignApps'],
1122
+ foreignAssets?: AppCreateTxn['appForeignAssets'],
1123
+ note?: AppCreateTxn['note'],
1124
+ lease?: AppCreateTxn['lease'],
1125
+ rekeyTo?: AppCreateTxn['reKeyTo'],
1126
+ extraPages?: AppCreateTxn['extraPages'],
1127
+ boxes?: AppCreateTxn['boxes']
1128
+ ) {
1129
+ const o: AppCreateTxn = {
1130
+ type: TransactionType.appl,
1131
+ from,
1132
+ suggestedParams,
1133
+ appIndex: 0,
1134
+ appOnComplete: onComplete,
1135
+ appLocalInts: numLocalInts,
1136
+ appLocalByteSlices: numLocalByteSlices,
1137
+ appGlobalInts: numGlobalInts,
1138
+ appGlobalByteSlices: numGlobalByteSlices,
1139
+ appApprovalProgram: approvalProgram,
1140
+ appClearProgram: clearProgram,
1141
+ appArgs,
1142
+ appAccounts: accounts,
1143
+ appForeignApps: foreignApps,
1144
+ appForeignAssets: foreignAssets,
1145
+ boxes,
1146
+ note,
1147
+ lease,
1148
+ reKeyTo: rekeyTo,
1149
+ extraPages,
1150
+ };
1151
+ return new txnBuilder.Transaction(o);
1152
+ }
1153
+
1154
+ // helper for above makeApplicationCreateTxn, instead accepting an arguments object
1155
+ export function makeApplicationCreateTxnFromObject(
1156
+ o: Expand<
1157
+ Pick<
1158
+ RenameProperties<
1159
+ MustHaveSuggestedParams<AppCreateTxn>,
1160
+ {
1161
+ appOnComplete: 'onComplete';
1162
+ appApprovalProgram: 'approvalProgram';
1163
+ appClearProgram: 'clearProgram';
1164
+ appLocalInts: 'numLocalInts';
1165
+ appLocalByteSlices: 'numLocalByteSlices';
1166
+ appGlobalInts: 'numGlobalInts';
1167
+ appGlobalByteSlices: 'numGlobalByteSlices';
1168
+ appAccounts: 'accounts';
1169
+ appForeignApps: 'foreignApps';
1170
+ appForeignAssets: 'foreignAssets';
1171
+ reKeyTo: 'rekeyTo';
1172
+ }
1173
+ >,
1174
+ | 'from'
1175
+ | 'suggestedParams'
1176
+ | 'onComplete'
1177
+ | 'approvalProgram'
1178
+ | 'clearProgram'
1179
+ | 'numLocalInts'
1180
+ | 'numLocalByteSlices'
1181
+ | 'numGlobalInts'
1182
+ | 'numGlobalByteSlices'
1183
+ | 'appArgs'
1184
+ | 'accounts'
1185
+ | 'foreignApps'
1186
+ | 'foreignAssets'
1187
+ | 'boxes'
1188
+ | 'note'
1189
+ | 'lease'
1190
+ | 'rekeyTo'
1191
+ | 'extraPages'
1192
+ >
1193
+ >
1194
+ ) {
1195
+ return makeApplicationCreateTxn(
1196
+ o.from,
1197
+ o.suggestedParams,
1198
+ o.onComplete,
1199
+ o.approvalProgram,
1200
+ o.clearProgram,
1201
+ o.numLocalInts,
1202
+ o.numLocalByteSlices,
1203
+ o.numGlobalInts,
1204
+ o.numGlobalByteSlices,
1205
+ o.appArgs,
1206
+ o.accounts,
1207
+ o.foreignApps,
1208
+ o.foreignAssets,
1209
+ o.note,
1210
+ o.lease,
1211
+ o.rekeyTo,
1212
+ o.extraPages,
1213
+ o.boxes
1214
+ );
1215
+ }
1216
+
1217
+ /**
1218
+ * Make a transaction that changes an application's approval and clear programs
1219
+ * @param from - address of sender
1220
+ * @param suggestedParams - a dict holding common-to-all-txns args:
1221
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
1222
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
1223
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
1224
+ * firstRound - integer first protocol round on which this txn is valid
1225
+ * lastRound - integer last protocol round on which this txn is valid
1226
+ * genesisHash - string specifies hash genesis block of network in use
1227
+ * genesisID - string specifies genesis ID of network in use
1228
+ * @param appIndex - the ID of the app to be updated
1229
+ * @param approvalProgram - Uint8Array, the compiled TEAL that approves a transaction
1230
+ * @param clearProgram - Uint8Array, the compiled TEAL that runs when clearing state
1231
+ * @param appArgs - Array of Uint8Array, any additional arguments to the application
1232
+ * @param accounts - Array of Address strings, any additional accounts to supply to the application
1233
+ * @param foreignApps - Array of int, any other apps used by the application, identified by index
1234
+ * @param foreignAssets - Array of int, any assets used by the application, identified by index
1235
+ * @param note - Arbitrary data for sender to store
1236
+ * @param lease - Lease a transaction
1237
+ * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1238
+ * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1239
+ */
1240
+ export function makeApplicationUpdateTxn(
1241
+ from: AppUpdateTxn['from'],
1242
+ suggestedParams: MustHaveSuggestedParams<AppUpdateTxn>['suggestedParams'],
1243
+ appIndex: AppUpdateTxn['appIndex'],
1244
+ approvalProgram: AppUpdateTxn['appApprovalProgram'],
1245
+ clearProgram: AppUpdateTxn['appClearProgram'],
1246
+ appArgs?: AppUpdateTxn['appArgs'],
1247
+ accounts?: AppUpdateTxn['appAccounts'],
1248
+ foreignApps?: AppUpdateTxn['appForeignApps'],
1249
+ foreignAssets?: AppUpdateTxn['appForeignAssets'],
1250
+ note?: AppUpdateTxn['note'],
1251
+ lease?: AppUpdateTxn['lease'],
1252
+ rekeyTo?: AppUpdateTxn['reKeyTo'],
1253
+ boxes?: AppUpdateTxn['boxes']
1254
+ ) {
1255
+ const o: AppUpdateTxn = {
1256
+ type: TransactionType.appl,
1257
+ from,
1258
+ suggestedParams,
1259
+ appIndex,
1260
+ appApprovalProgram: approvalProgram,
1261
+ appOnComplete: OnApplicationComplete.UpdateApplicationOC,
1262
+ appClearProgram: clearProgram,
1263
+ appArgs,
1264
+ appAccounts: accounts,
1265
+ appForeignApps: foreignApps,
1266
+ appForeignAssets: foreignAssets,
1267
+ boxes,
1268
+ note,
1269
+ lease,
1270
+ reKeyTo: rekeyTo,
1271
+ };
1272
+ return new txnBuilder.Transaction(o);
1273
+ }
1274
+
1275
+ // helper for above makeApplicationUpdateTxn, instead accepting an arguments object
1276
+ export function makeApplicationUpdateTxnFromObject(
1277
+ o: Expand<
1278
+ Pick<
1279
+ RenameProperties<
1280
+ MustHaveSuggestedParams<AppUpdateTxn>,
1281
+ {
1282
+ appApprovalProgram: 'approvalProgram';
1283
+ appClearProgram: 'clearProgram';
1284
+ appAccounts: 'accounts';
1285
+ appForeignApps: 'foreignApps';
1286
+ appForeignAssets: 'foreignAssets';
1287
+ reKeyTo: 'rekeyTo';
1288
+ }
1289
+ >,
1290
+ | 'from'
1291
+ | 'suggestedParams'
1292
+ | 'appIndex'
1293
+ | 'approvalProgram'
1294
+ | 'clearProgram'
1295
+ | 'appArgs'
1296
+ | 'accounts'
1297
+ | 'foreignApps'
1298
+ | 'foreignAssets'
1299
+ | 'boxes'
1300
+ | 'note'
1301
+ | 'lease'
1302
+ | 'rekeyTo'
1303
+ >
1304
+ >
1305
+ ) {
1306
+ return makeApplicationUpdateTxn(
1307
+ o.from,
1308
+ o.suggestedParams,
1309
+ o.appIndex,
1310
+ o.approvalProgram,
1311
+ o.clearProgram,
1312
+ o.appArgs,
1313
+ o.accounts,
1314
+ o.foreignApps,
1315
+ o.foreignAssets,
1316
+ o.note,
1317
+ o.lease,
1318
+ o.rekeyTo,
1319
+ o.boxes
1320
+ );
1321
+ }
1322
+
1323
+ /**
1324
+ * Make a transaction that deletes an application
1325
+ * @param from - address of sender
1326
+ * @param suggestedParams - a dict holding common-to-all-txns args:
1327
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
1328
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
1329
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
1330
+ * firstRound - integer first protocol round on which this txn is valid
1331
+ * lastRound - integer last protocol round on which this txn is valid
1332
+ * genesisHash - string specifies hash genesis block of network in use
1333
+ * genesisID - string specifies genesis ID of network in use
1334
+ * @param appIndex - the ID of the app to be deleted
1335
+ * @param appArgs - Array of Uint8Array, any additional arguments to the application
1336
+ * @param accounts - Array of Address strings, any additional accounts to supply to the application
1337
+ * @param foreignApps - Array of int, any other apps used by the application, identified by index
1338
+ * @param foreignAssets - Array of int, any assets used by the application, identified by index
1339
+ * @param note - Arbitrary data for sender to store
1340
+ * @param lease - Lease a transaction
1341
+ * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1342
+ * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1343
+ */
1344
+ export function makeApplicationDeleteTxn(
1345
+ from: AppDeleteTxn['from'],
1346
+ suggestedParams: MustHaveSuggestedParams<AppDeleteTxn>['suggestedParams'],
1347
+ appIndex: AppDeleteTxn['appIndex'],
1348
+ appArgs?: AppDeleteTxn['appArgs'],
1349
+ accounts?: AppDeleteTxn['appAccounts'],
1350
+ foreignApps?: AppDeleteTxn['appForeignApps'],
1351
+ foreignAssets?: AppDeleteTxn['appForeignAssets'],
1352
+ note?: AppDeleteTxn['note'],
1353
+ lease?: AppDeleteTxn['lease'],
1354
+ rekeyTo?: AppDeleteTxn['reKeyTo'],
1355
+ boxes?: AppDeleteTxn['boxes']
1356
+ ) {
1357
+ const o: AppDeleteTxn = {
1358
+ type: TransactionType.appl,
1359
+ from,
1360
+ suggestedParams,
1361
+ appIndex,
1362
+ appOnComplete: OnApplicationComplete.DeleteApplicationOC,
1363
+ appArgs,
1364
+ appAccounts: accounts,
1365
+ appForeignApps: foreignApps,
1366
+ appForeignAssets: foreignAssets,
1367
+ boxes,
1368
+ note,
1369
+ lease,
1370
+ reKeyTo: rekeyTo,
1371
+ };
1372
+ return new txnBuilder.Transaction(o);
1373
+ }
1374
+
1375
+ // helper for above makeApplicationDeleteTxn, instead accepting an arguments object
1376
+ export function makeApplicationDeleteTxnFromObject(
1377
+ o: Expand<
1378
+ Pick<
1379
+ RenameProperties<
1380
+ MustHaveSuggestedParams<AppDeleteTxn>,
1381
+ {
1382
+ appAccounts: 'accounts';
1383
+ appForeignApps: 'foreignApps';
1384
+ appForeignAssets: 'foreignAssets';
1385
+ reKeyTo: 'rekeyTo';
1386
+ }
1387
+ >,
1388
+ | 'from'
1389
+ | 'suggestedParams'
1390
+ | 'appIndex'
1391
+ | 'appArgs'
1392
+ | 'accounts'
1393
+ | 'foreignApps'
1394
+ | 'foreignAssets'
1395
+ | 'boxes'
1396
+ | 'note'
1397
+ | 'lease'
1398
+ | 'rekeyTo'
1399
+ >
1400
+ >
1401
+ ) {
1402
+ return makeApplicationDeleteTxn(
1403
+ o.from,
1404
+ o.suggestedParams,
1405
+ o.appIndex,
1406
+ o.appArgs,
1407
+ o.accounts,
1408
+ o.foreignApps,
1409
+ o.foreignAssets,
1410
+ o.note,
1411
+ o.lease,
1412
+ o.rekeyTo,
1413
+ o.boxes
1414
+ );
1415
+ }
1416
+
1417
+ /**
1418
+ * Make a transaction that opts in to use an application
1419
+ * @param from - address of sender
1420
+ * @param suggestedParams - a dict holding common-to-all-txns args:
1421
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
1422
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
1423
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
1424
+ * firstRound - integer first protocol round on which this txn is valid
1425
+ * lastRound - integer last protocol round on which this txn is valid
1426
+ * genesisHash - string specifies hash genesis block of network in use
1427
+ * genesisID - string specifies genesis ID of network in use
1428
+ * @param appIndex - the ID of the app to join
1429
+ * @param appArgs - Array of Uint8Array, any additional arguments to the application
1430
+ * @param accounts - Array of Address strings, any additional accounts to supply to the application
1431
+ * @param foreignApps - Array of int, any other apps used by the application, identified by index
1432
+ * @param foreignAssets - Array of int, any assets used by the application, identified by index
1433
+ * @param note - Arbitrary data for sender to store
1434
+ * @param lease - Lease a transaction
1435
+ * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1436
+ * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1437
+ */
1438
+ export function makeApplicationOptInTxn(
1439
+ from: AppOptInTxn['from'],
1440
+ suggestedParams: MustHaveSuggestedParams<AppOptInTxn>['suggestedParams'],
1441
+ appIndex: AppOptInTxn['appIndex'],
1442
+ appArgs?: AppOptInTxn['appArgs'],
1443
+ accounts?: AppOptInTxn['appAccounts'],
1444
+ foreignApps?: AppOptInTxn['appForeignApps'],
1445
+ foreignAssets?: AppOptInTxn['appForeignAssets'],
1446
+ note?: AppOptInTxn['note'],
1447
+ lease?: AppOptInTxn['lease'],
1448
+ rekeyTo?: AppOptInTxn['reKeyTo'],
1449
+ boxes?: AppOptInTxn['boxes']
1450
+ ) {
1451
+ const o: AppOptInTxn = {
1452
+ type: TransactionType.appl,
1453
+ from,
1454
+ suggestedParams,
1455
+ appIndex,
1456
+ appOnComplete: OnApplicationComplete.OptInOC,
1457
+ appArgs,
1458
+ appAccounts: accounts,
1459
+ appForeignApps: foreignApps,
1460
+ appForeignAssets: foreignAssets,
1461
+ boxes,
1462
+ note,
1463
+ lease,
1464
+ reKeyTo: rekeyTo,
1465
+ };
1466
+ return new txnBuilder.Transaction(o);
1467
+ }
1468
+
1469
+ // helper for above makeApplicationOptInTxn, instead accepting an argument object
1470
+ export function makeApplicationOptInTxnFromObject(
1471
+ o: Expand<
1472
+ Pick<
1473
+ RenameProperties<
1474
+ MustHaveSuggestedParams<AppOptInTxn>,
1475
+ {
1476
+ appAccounts: 'accounts';
1477
+ appForeignApps: 'foreignApps';
1478
+ appForeignAssets: 'foreignAssets';
1479
+ reKeyTo: 'rekeyTo';
1480
+ }
1481
+ >,
1482
+ | 'from'
1483
+ | 'suggestedParams'
1484
+ | 'appIndex'
1485
+ | 'appArgs'
1486
+ | 'accounts'
1487
+ | 'foreignApps'
1488
+ | 'foreignAssets'
1489
+ | 'boxes'
1490
+ | 'note'
1491
+ | 'lease'
1492
+ | 'rekeyTo'
1493
+ >
1494
+ >
1495
+ ) {
1496
+ return makeApplicationOptInTxn(
1497
+ o.from,
1498
+ o.suggestedParams,
1499
+ o.appIndex,
1500
+ o.appArgs,
1501
+ o.accounts,
1502
+ o.foreignApps,
1503
+ o.foreignAssets,
1504
+ o.note,
1505
+ o.lease,
1506
+ o.rekeyTo,
1507
+ o.boxes
1508
+ );
1509
+ }
1510
+
1511
+ /**
1512
+ * Make a transaction that closes out a user's state in an application
1513
+ * @param from - address of sender
1514
+ * @param suggestedParams - a dict holding common-to-all-txns args:
1515
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
1516
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
1517
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
1518
+ * firstRound - integer first protocol round on which this txn is valid
1519
+ * lastRound - integer last protocol round on which this txn is valid
1520
+ * genesisHash - string specifies hash genesis block of network in use
1521
+ * genesisID - string specifies genesis ID of network in use
1522
+ * @param appIndex - the ID of the app to use
1523
+ * @param appArgs - Array of Uint8Array, any additional arguments to the application
1524
+ * @param accounts - Array of Address strings, any additional accounts to supply to the application
1525
+ * @param foreignApps - Array of int, any other apps used by the application, identified by index
1526
+ * @param foreignAssets - Array of int, any assets used by the application, identified by index
1527
+ * @param note - Arbitrary data for sender to store
1528
+ * @param lease - Lease a transaction
1529
+ * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1530
+ * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1531
+ */
1532
+ export function makeApplicationCloseOutTxn(
1533
+ from: AppCloseOutTxn['from'],
1534
+ suggestedParams: MustHaveSuggestedParams<AppCloseOutTxn>['suggestedParams'],
1535
+ appIndex: AppCloseOutTxn['appIndex'],
1536
+ appArgs?: AppCloseOutTxn['appArgs'],
1537
+ accounts?: AppCloseOutTxn['appAccounts'],
1538
+ foreignApps?: AppCloseOutTxn['appForeignApps'],
1539
+ foreignAssets?: AppCloseOutTxn['appForeignAssets'],
1540
+ note?: AppCloseOutTxn['note'],
1541
+ lease?: AppCloseOutTxn['lease'],
1542
+ rekeyTo?: AppCloseOutTxn['reKeyTo'],
1543
+ boxes?: AppCloseOutTxn['boxes']
1544
+ ) {
1545
+ const o: AppCloseOutTxn = {
1546
+ type: TransactionType.appl,
1547
+ from,
1548
+ suggestedParams,
1549
+ appIndex,
1550
+ appOnComplete: OnApplicationComplete.CloseOutOC,
1551
+ appArgs,
1552
+ appAccounts: accounts,
1553
+ appForeignApps: foreignApps,
1554
+ appForeignAssets: foreignAssets,
1555
+ boxes,
1556
+ note,
1557
+ lease,
1558
+ reKeyTo: rekeyTo,
1559
+ };
1560
+ return new txnBuilder.Transaction(o);
1561
+ }
1562
+
1563
+ // helper for above makeApplicationCloseOutTxn, instead accepting an argument object
1564
+ export function makeApplicationCloseOutTxnFromObject(
1565
+ o: Expand<
1566
+ Pick<
1567
+ RenameProperties<
1568
+ MustHaveSuggestedParams<AppOptInTxn>,
1569
+ {
1570
+ appAccounts: 'accounts';
1571
+ appForeignApps: 'foreignApps';
1572
+ appForeignAssets: 'foreignAssets';
1573
+ reKeyTo: 'rekeyTo';
1574
+ }
1575
+ >,
1576
+ | 'from'
1577
+ | 'suggestedParams'
1578
+ | 'appIndex'
1579
+ | 'appArgs'
1580
+ | 'accounts'
1581
+ | 'foreignApps'
1582
+ | 'foreignAssets'
1583
+ | 'boxes'
1584
+ | 'note'
1585
+ | 'lease'
1586
+ | 'rekeyTo'
1587
+ >
1588
+ >
1589
+ ) {
1590
+ return makeApplicationCloseOutTxn(
1591
+ o.from,
1592
+ o.suggestedParams,
1593
+ o.appIndex,
1594
+ o.appArgs,
1595
+ o.accounts,
1596
+ o.foreignApps,
1597
+ o.foreignAssets,
1598
+ o.note,
1599
+ o.lease,
1600
+ o.rekeyTo,
1601
+ o.boxes
1602
+ );
1603
+ }
1604
+
1605
+ /**
1606
+ * Make a transaction that clears a user's state in an application
1607
+ * @param from - address of sender
1608
+ * @param suggestedParams - a dict holding common-to-all-txns args:
1609
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
1610
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
1611
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
1612
+ * firstRound - integer first protocol round on which this txn is valid
1613
+ * lastRound - integer last protocol round on which this txn is valid
1614
+ * genesisHash - string specifies hash genesis block of network in use
1615
+ * genesisID - string specifies genesis ID of network in use
1616
+ * @param appIndex - the ID of the app to use
1617
+ * @param appArgs - Array of Uint8Array, any additional arguments to the application
1618
+ * @param accounts - Array of Address strings, any additional accounts to supply to the application
1619
+ * @param foreignApps - Array of int, any other apps used by the application, identified by index
1620
+ * @param foreignAssets - Array of int, any assets used by the application, identified by index
1621
+ * @param note - Arbitrary data for sender to store
1622
+ * @param lease - Lease a transaction
1623
+ * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1624
+ * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1625
+ */
1626
+ export function makeApplicationClearStateTxn(
1627
+ from: AppClearStateTxn['from'],
1628
+ suggestedParams: MustHaveSuggestedParams<AppClearStateTxn>['suggestedParams'],
1629
+ appIndex: AppClearStateTxn['appIndex'],
1630
+ appArgs?: AppClearStateTxn['appArgs'],
1631
+ accounts?: AppClearStateTxn['appAccounts'],
1632
+ foreignApps?: AppClearStateTxn['appForeignApps'],
1633
+ foreignAssets?: AppClearStateTxn['appForeignAssets'],
1634
+ note?: AppClearStateTxn['note'],
1635
+ lease?: AppClearStateTxn['lease'],
1636
+ rekeyTo?: AppClearStateTxn['reKeyTo'],
1637
+ boxes?: AppClearStateTxn['boxes']
1638
+ ) {
1639
+ const o: AppClearStateTxn = {
1640
+ type: TransactionType.appl,
1641
+ from,
1642
+ suggestedParams,
1643
+ appIndex,
1644
+ appOnComplete: OnApplicationComplete.ClearStateOC,
1645
+ appArgs,
1646
+ appAccounts: accounts,
1647
+ appForeignApps: foreignApps,
1648
+ appForeignAssets: foreignAssets,
1649
+ boxes,
1650
+ note,
1651
+ lease,
1652
+ reKeyTo: rekeyTo,
1653
+ };
1654
+ return new txnBuilder.Transaction(o);
1655
+ }
1656
+
1657
+ // helper for above makeApplicationClearStateTxn, instead accepting an argument object
1658
+ export function makeApplicationClearStateTxnFromObject(
1659
+ o: Expand<
1660
+ Pick<
1661
+ RenameProperties<
1662
+ MustHaveSuggestedParams<AppOptInTxn>,
1663
+ {
1664
+ appAccounts: 'accounts';
1665
+ appForeignApps: 'foreignApps';
1666
+ appForeignAssets: 'foreignAssets';
1667
+ reKeyTo: 'rekeyTo';
1668
+ }
1669
+ >,
1670
+ | 'from'
1671
+ | 'suggestedParams'
1672
+ | 'appIndex'
1673
+ | 'appArgs'
1674
+ | 'accounts'
1675
+ | 'foreignApps'
1676
+ | 'foreignAssets'
1677
+ | 'boxes'
1678
+ | 'note'
1679
+ | 'lease'
1680
+ | 'rekeyTo'
1681
+ >
1682
+ >
1683
+ ) {
1684
+ return makeApplicationClearStateTxn(
1685
+ o.from,
1686
+ o.suggestedParams,
1687
+ o.appIndex,
1688
+ o.appArgs,
1689
+ o.accounts,
1690
+ o.foreignApps,
1691
+ o.foreignAssets,
1692
+ o.note,
1693
+ o.lease,
1694
+ o.rekeyTo,
1695
+ o.boxes
1696
+ );
1697
+ }
1698
+
1699
+ /**
1700
+ * Make a transaction that just calls an application, doing nothing on completion
1701
+ * @param from - address of sender
1702
+ * @param suggestedParams - a dict holding common-to-all-txns args:
1703
+ * fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
1704
+ * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
1705
+ * If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
1706
+ * firstRound - integer first protocol round on which this txn is valid
1707
+ * lastRound - integer last protocol round on which this txn is valid
1708
+ * genesisHash - string specifies hash genesis block of network in use
1709
+ * genesisID - string specifies genesis ID of network in use
1710
+ * @param appIndex - the ID of the app to use
1711
+ * @param appArgs - Array of Uint8Array, any additional arguments to the application
1712
+ * @param accounts - Array of Address strings, any additional accounts to supply to the application
1713
+ * @param foreignApps - Array of int, any other apps used by the application, identified by index
1714
+ * @param foreignAssets - Array of int, any assets used by the application, identified by index
1715
+ * @param note - Arbitrary data for sender to store
1716
+ * @param lease - Lease a transaction
1717
+ * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1718
+ * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1719
+ */
1720
+ export function makeApplicationNoOpTxn(
1721
+ from: AppNoOpTxn['from'],
1722
+ suggestedParams: MustHaveSuggestedParams<AppNoOpTxn>['suggestedParams'],
1723
+ appIndex: AppNoOpTxn['appIndex'],
1724
+ appArgs?: AppNoOpTxn['appArgs'],
1725
+ accounts?: AppNoOpTxn['appAccounts'],
1726
+ foreignApps?: AppNoOpTxn['appForeignApps'],
1727
+ foreignAssets?: AppNoOpTxn['appForeignAssets'],
1728
+ note?: AppNoOpTxn['note'],
1729
+ lease?: AppNoOpTxn['lease'],
1730
+ rekeyTo?: AppNoOpTxn['reKeyTo'],
1731
+ boxes?: AppNoOpTxn['boxes']
1732
+ ) {
1733
+ const o: AppNoOpTxn = {
1734
+ type: TransactionType.appl,
1735
+ from,
1736
+ suggestedParams,
1737
+ appIndex,
1738
+ appOnComplete: OnApplicationComplete.NoOpOC,
1739
+ appArgs,
1740
+ appAccounts: accounts,
1741
+ appForeignApps: foreignApps,
1742
+ appForeignAssets: foreignAssets,
1743
+ boxes,
1744
+ note,
1745
+ lease,
1746
+ reKeyTo: rekeyTo,
1747
+ };
1748
+ return new txnBuilder.Transaction(o);
1749
+ }
1750
+
1751
+ // helper for above makeApplicationNoOpTxn, instead accepting an argument object
1752
+ export function makeApplicationNoOpTxnFromObject(
1753
+ o: Expand<
1754
+ Pick<
1755
+ RenameProperties<
1756
+ MustHaveSuggestedParams<AppOptInTxn>,
1757
+ {
1758
+ appAccounts: 'accounts';
1759
+ appForeignApps: 'foreignApps';
1760
+ appForeignAssets: 'foreignAssets';
1761
+ reKeyTo: 'rekeyTo';
1762
+ }
1763
+ >,
1764
+ | 'from'
1765
+ | 'suggestedParams'
1766
+ | 'appIndex'
1767
+ | 'appArgs'
1768
+ | 'accounts'
1769
+ | 'foreignApps'
1770
+ | 'foreignAssets'
1771
+ | 'boxes'
1772
+ | 'note'
1773
+ | 'lease'
1774
+ | 'rekeyTo'
1775
+ >
1776
+ >
1777
+ ) {
1778
+ return makeApplicationNoOpTxn(
1779
+ o.from,
1780
+ o.suggestedParams,
1781
+ o.appIndex,
1782
+ o.appArgs,
1783
+ o.accounts,
1784
+ o.foreignApps,
1785
+ o.foreignAssets,
1786
+ o.note,
1787
+ o.lease,
1788
+ o.rekeyTo,
1789
+ o.boxes
1790
+ );
1791
+ }
1792
+
1793
+ export { OnApplicationComplete } from './types/transactions/base';
1794
+
1795
+ /**
1796
+ * Generic function for creating any application call transaction.
1797
+ */
1798
+ export function makeApplicationCallTxnFromObject(
1799
+ options: Expand<
1800
+ Pick<
1801
+ RenameProperties<
1802
+ MustHaveSuggestedParams<AppCreateTxn>,
1803
+ {
1804
+ appOnComplete: 'onComplete';
1805
+ appAccounts: 'accounts';
1806
+ appForeignApps: 'foreignApps';
1807
+ appForeignAssets: 'foreignAssets';
1808
+ reKeyTo: 'rekeyTo';
1809
+ }
1810
+ >,
1811
+ | 'from'
1812
+ | 'suggestedParams'
1813
+ | 'appIndex'
1814
+ | 'onComplete'
1815
+ | 'appArgs'
1816
+ | 'accounts'
1817
+ | 'foreignApps'
1818
+ | 'foreignAssets'
1819
+ | 'boxes'
1820
+ | 'note'
1821
+ | 'lease'
1822
+ | 'rekeyTo'
1823
+ | 'extraPages'
1824
+ > &
1825
+ Partial<
1826
+ Pick<
1827
+ RenameProperties<
1828
+ MustHaveSuggestedParams<AppCreateTxn>,
1829
+ {
1830
+ appApprovalProgram: 'approvalProgram';
1831
+ appClearProgram: 'clearProgram';
1832
+ appLocalInts: 'numLocalInts';
1833
+ appLocalByteSlices: 'numLocalByteSlices';
1834
+ appGlobalInts: 'numGlobalInts';
1835
+ appGlobalByteSlices: 'numGlobalByteSlices';
1836
+ }
1837
+ >,
1838
+ | 'approvalProgram'
1839
+ | 'clearProgram'
1840
+ | 'numLocalInts'
1841
+ | 'numLocalByteSlices'
1842
+ | 'numGlobalInts'
1843
+ | 'numGlobalByteSlices'
1844
+ >
1845
+ >
1846
+ >
1847
+ ) {
1848
+ const o: AppCreateTxn = {
1849
+ type: TransactionType.appl,
1850
+ from: options.from,
1851
+ suggestedParams: options.suggestedParams,
1852
+ appIndex: options.appIndex,
1853
+ appOnComplete: options.onComplete,
1854
+ appLocalInts: options.numLocalInts,
1855
+ appLocalByteSlices: options.numLocalByteSlices,
1856
+ appGlobalInts: options.numGlobalInts,
1857
+ appGlobalByteSlices: options.numGlobalByteSlices,
1858
+ appApprovalProgram: options.approvalProgram,
1859
+ appClearProgram: options.clearProgram,
1860
+ appArgs: options.appArgs,
1861
+ appAccounts: options.accounts,
1862
+ appForeignApps: options.foreignApps,
1863
+ appForeignAssets: options.foreignAssets,
1864
+ boxes: options.boxes,
1865
+ note: options.note,
1866
+ lease: options.lease,
1867
+ reKeyTo: options.rekeyTo,
1868
+ extraPages: options.extraPages,
1869
+ };
1870
+ return new txnBuilder.Transaction(o);
1871
+ }