@algorandfoundation/algokit-utils 9.2.0-beta.7 → 10.0.0-alpha.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 (1683) hide show
  1. package/README.md +37 -0
  2. package/_virtual/rolldown_runtime.js +34 -0
  3. package/_virtual/rolldown_runtime.mjs +13 -0
  4. package/abi/index.d.ts +6 -0
  5. package/abi/index.js +40 -0
  6. package/abi/index.mjs +5 -0
  7. package/algod-client/index.d.ts +76 -0
  8. package/algod-client/index.js +17 -0
  9. package/algod-client/index.mjs +8 -0
  10. package/amount.d.ts +40 -35
  11. package/amount.js +36 -36
  12. package/amount.js.map +1 -1
  13. package/amount.mjs +36 -34
  14. package/amount.mjs.map +1 -1
  15. package/config.d.ts +7 -2
  16. package/config.js +5 -5
  17. package/config.js.map +1 -1
  18. package/config.mjs +4 -2
  19. package/config.mjs.map +1 -1
  20. package/index.d.ts +10 -18
  21. package/index.js +41 -143
  22. package/index.mjs +11 -29
  23. package/indexer-client/index.d.ts +78 -0
  24. package/indexer-client/index.js +17 -0
  25. package/indexer-client/index.mjs +8 -0
  26. package/indexer-lookup.d.ts +20 -27
  27. package/indexer-lookup.js +98 -128
  28. package/indexer-lookup.js.map +1 -1
  29. package/indexer-lookup.mjs +93 -123
  30. package/indexer-lookup.mjs.map +1 -1
  31. package/kmd-client/index.d.ts +54 -0
  32. package/kmd-client/index.js +17 -0
  33. package/kmd-client/index.mjs +8 -0
  34. package/package.json +43 -5
  35. package/packages/abi/src/abi-method.d.ts +117 -0
  36. package/packages/abi/src/abi-method.js +209 -0
  37. package/packages/abi/src/abi-method.js.map +1 -0
  38. package/packages/abi/src/abi-method.mjs +196 -0
  39. package/packages/abi/src/abi-method.mjs.map +1 -0
  40. package/packages/abi/src/abi-type.d.ts +253 -0
  41. package/packages/abi/src/abi-type.js +685 -0
  42. package/packages/abi/src/abi-type.js.map +1 -0
  43. package/packages/abi/src/abi-type.mjs +674 -0
  44. package/packages/abi/src/abi-type.mjs.map +1 -0
  45. package/packages/abi/src/abi-value.d.ts +11 -0
  46. package/packages/abi/src/arc28-event.d.ts +20 -0
  47. package/packages/abi/src/arc56-contract.d.ts +389 -0
  48. package/packages/abi/src/arc56-contract.js +196 -0
  49. package/packages/abi/src/arc56-contract.js.map +1 -0
  50. package/packages/abi/src/arc56-contract.mjs +185 -0
  51. package/packages/abi/src/arc56-contract.mjs.map +1 -0
  52. package/packages/abi/src/bigint.js +32 -0
  53. package/packages/abi/src/bigint.js.map +1 -0
  54. package/packages/abi/src/bigint.mjs +30 -0
  55. package/packages/abi/src/bigint.mjs.map +1 -0
  56. package/packages/algo25/src/english.js +2057 -0
  57. package/packages/algo25/src/english.js.map +1 -0
  58. package/packages/algo25/src/english.mjs +2056 -0
  59. package/packages/algo25/src/english.mjs.map +1 -0
  60. package/packages/algo25/src/index.js +75 -0
  61. package/packages/algo25/src/index.js.map +1 -0
  62. package/packages/algo25/src/index.mjs +75 -0
  63. package/packages/algo25/src/index.mjs.map +1 -0
  64. package/packages/algod_client/src/apis/api-service.d.ts +184 -0
  65. package/packages/algod_client/src/apis/api-service.js +627 -0
  66. package/packages/algod_client/src/apis/api-service.js.map +1 -0
  67. package/packages/algod_client/src/apis/api-service.mjs +627 -0
  68. package/packages/algod_client/src/apis/api-service.mjs.map +1 -0
  69. package/packages/algod_client/src/client.d.ts +10 -0
  70. package/packages/algod_client/src/client.js +13 -0
  71. package/packages/algod_client/src/client.js.map +1 -0
  72. package/packages/algod_client/src/client.mjs +13 -0
  73. package/packages/algod_client/src/client.mjs.map +1 -0
  74. package/packages/algod_client/src/core/api-error.d.ts +10 -0
  75. package/packages/algod_client/src/core/api-error.js +17 -0
  76. package/packages/algod_client/src/core/api-error.js.map +1 -0
  77. package/packages/algod_client/src/core/api-error.mjs +16 -0
  78. package/packages/algod_client/src/core/api-error.mjs.map +1 -0
  79. package/packages/algod_client/src/core/base-http-request.d.ts +25 -0
  80. package/packages/algod_client/src/core/base-http-request.js +16 -0
  81. package/packages/algod_client/src/core/base-http-request.js.map +1 -0
  82. package/packages/algod_client/src/core/base-http-request.mjs +14 -0
  83. package/packages/algod_client/src/core/base-http-request.mjs.map +1 -0
  84. package/packages/algod_client/src/core/client-config.d.ts +17 -0
  85. package/packages/algod_client/src/core/fetch-http-request.d.ts +10 -0
  86. package/packages/algod_client/src/core/fetch-http-request.js +85 -0
  87. package/packages/algod_client/src/core/fetch-http-request.js.map +1 -0
  88. package/packages/algod_client/src/core/fetch-http-request.mjs +85 -0
  89. package/packages/algod_client/src/core/fetch-http-request.mjs.map +1 -0
  90. package/packages/algod_client/src/core/model-runtime.d.ts +10 -0
  91. package/packages/algod_client/src/core/model-runtime.js +25 -0
  92. package/packages/algod_client/src/core/model-runtime.js.map +1 -0
  93. package/packages/algod_client/src/core/model-runtime.mjs +22 -0
  94. package/packages/algod_client/src/core/model-runtime.mjs.map +1 -0
  95. package/packages/algod_client/src/core/request.js +62 -0
  96. package/packages/algod_client/src/core/request.js.map +1 -0
  97. package/packages/algod_client/src/core/request.mjs +62 -0
  98. package/packages/algod_client/src/core/request.mjs.map +1 -0
  99. package/packages/algod_client/src/models/account-application-response.d.ts +15 -0
  100. package/packages/algod_client/src/models/account-application-response.js +34 -0
  101. package/packages/algod_client/src/models/account-application-response.js.map +1 -0
  102. package/packages/algod_client/src/models/account-application-response.mjs +34 -0
  103. package/packages/algod_client/src/models/account-application-response.mjs.map +1 -0
  104. package/packages/algod_client/src/models/account-asset-response.d.ts +15 -0
  105. package/packages/algod_client/src/models/account-asset-response.js +34 -0
  106. package/packages/algod_client/src/models/account-asset-response.js.map +1 -0
  107. package/packages/algod_client/src/models/account-asset-response.mjs +34 -0
  108. package/packages/algod_client/src/models/account-asset-response.mjs.map +1 -0
  109. package/packages/algod_client/src/models/account-participation.d.ts +33 -0
  110. package/packages/algod_client/src/models/account-participation.js +50 -0
  111. package/packages/algod_client/src/models/account-participation.js.map +1 -0
  112. package/packages/algod_client/src/models/account-participation.mjs +50 -0
  113. package/packages/algod_client/src/models/account-participation.mjs.map +1 -0
  114. package/packages/algod_client/src/models/account-state-delta.d.ts +15 -0
  115. package/packages/algod_client/src/models/account-state-delta.js +24 -0
  116. package/packages/algod_client/src/models/account-state-delta.js.map +1 -0
  117. package/packages/algod_client/src/models/account-state-delta.mjs +24 -0
  118. package/packages/algod_client/src/models/account-state-delta.mjs.map +1 -0
  119. package/packages/algod_client/src/models/account.d.ts +139 -0
  120. package/packages/algod_client/src/models/account.js +187 -0
  121. package/packages/algod_client/src/models/account.js.map +1 -0
  122. package/packages/algod_client/src/models/account.mjs +187 -0
  123. package/packages/algod_client/src/models/account.mjs.map +1 -0
  124. package/packages/algod_client/src/models/application-initial-states.d.ts +22 -0
  125. package/packages/algod_client/src/models/application-initial-states.js +40 -0
  126. package/packages/algod_client/src/models/application-initial-states.js.map +1 -0
  127. package/packages/algod_client/src/models/application-initial-states.mjs +40 -0
  128. package/packages/algod_client/src/models/application-initial-states.mjs.map +1 -0
  129. package/packages/algod_client/src/models/application-kv-storage.d.ts +21 -0
  130. package/packages/algod_client/src/models/application-kv-storage.js +25 -0
  131. package/packages/algod_client/src/models/application-kv-storage.js.map +1 -0
  132. package/packages/algod_client/src/models/application-kv-storage.mjs +25 -0
  133. package/packages/algod_client/src/models/application-kv-storage.mjs.map +1 -0
  134. package/packages/algod_client/src/models/application-local-reference.d.ts +20 -0
  135. package/packages/algod_client/src/models/application-local-reference.js +23 -0
  136. package/packages/algod_client/src/models/application-local-reference.js.map +1 -0
  137. package/packages/algod_client/src/models/application-local-reference.mjs +23 -0
  138. package/packages/algod_client/src/models/application-local-reference.mjs.map +1 -0
  139. package/packages/algod_client/src/models/application-local-state.d.ts +19 -0
  140. package/packages/algod_client/src/models/application-local-state.js +35 -0
  141. package/packages/algod_client/src/models/application-local-state.js.map +1 -0
  142. package/packages/algod_client/src/models/application-local-state.mjs +35 -0
  143. package/packages/algod_client/src/models/application-local-state.mjs.map +1 -0
  144. package/packages/algod_client/src/models/application-params.d.ts +37 -0
  145. package/packages/algod_client/src/models/application-params.js +67 -0
  146. package/packages/algod_client/src/models/application-params.js.map +1 -0
  147. package/packages/algod_client/src/models/application-params.mjs +67 -0
  148. package/packages/algod_client/src/models/application-params.mjs.map +1 -0
  149. package/packages/algod_client/src/models/application-state-operation.d.ts +30 -0
  150. package/packages/algod_client/src/models/application-state-operation.js +47 -0
  151. package/packages/algod_client/src/models/application-state-operation.js.map +1 -0
  152. package/packages/algod_client/src/models/application-state-operation.mjs +47 -0
  153. package/packages/algod_client/src/models/application-state-operation.mjs.map +1 -0
  154. package/packages/algod_client/src/models/application-state-schema.d.ts +17 -0
  155. package/packages/algod_client/src/models/application-state-schema.js +22 -0
  156. package/packages/algod_client/src/models/application-state-schema.js.map +1 -0
  157. package/packages/algod_client/src/models/application-state-schema.mjs +22 -0
  158. package/packages/algod_client/src/models/application-state-schema.mjs.map +1 -0
  159. package/packages/algod_client/src/models/application.d.ts +17 -0
  160. package/packages/algod_client/src/models/application.js +24 -0
  161. package/packages/algod_client/src/models/application.js.map +1 -0
  162. package/packages/algod_client/src/models/application.mjs +24 -0
  163. package/packages/algod_client/src/models/application.mjs.map +1 -0
  164. package/packages/algod_client/src/models/asset-holding-reference.d.ts +20 -0
  165. package/packages/algod_client/src/models/asset-holding-reference.js +23 -0
  166. package/packages/algod_client/src/models/asset-holding-reference.js.map +1 -0
  167. package/packages/algod_client/src/models/asset-holding-reference.mjs +23 -0
  168. package/packages/algod_client/src/models/asset-holding-reference.mjs.map +1 -0
  169. package/packages/algod_client/src/models/asset-holding.d.ts +24 -0
  170. package/packages/algod_client/src/models/asset-holding.js +32 -0
  171. package/packages/algod_client/src/models/asset-holding.js.map +1 -0
  172. package/packages/algod_client/src/models/asset-holding.mjs +32 -0
  173. package/packages/algod_client/src/models/asset-holding.mjs.map +1 -0
  174. package/packages/algod_client/src/models/asset-params.d.ts +74 -0
  175. package/packages/algod_client/src/models/asset-params.js +107 -0
  176. package/packages/algod_client/src/models/asset-params.js.map +1 -0
  177. package/packages/algod_client/src/models/asset-params.mjs +107 -0
  178. package/packages/algod_client/src/models/asset-params.mjs.map +1 -0
  179. package/packages/algod_client/src/models/asset.d.ts +17 -0
  180. package/packages/algod_client/src/models/asset.js +24 -0
  181. package/packages/algod_client/src/models/asset.js.map +1 -0
  182. package/packages/algod_client/src/models/asset.mjs +24 -0
  183. package/packages/algod_client/src/models/asset.mjs.map +1 -0
  184. package/packages/algod_client/src/models/avm-key-value.d.ts +14 -0
  185. package/packages/algod_client/src/models/avm-key-value.js +24 -0
  186. package/packages/algod_client/src/models/avm-key-value.js.map +1 -0
  187. package/packages/algod_client/src/models/avm-key-value.mjs +24 -0
  188. package/packages/algod_client/src/models/avm-key-value.mjs.map +1 -0
  189. package/packages/algod_client/src/models/avm-value.d.ts +21 -0
  190. package/packages/algod_client/src/models/avm-value.js +33 -0
  191. package/packages/algod_client/src/models/avm-value.js.map +1 -0
  192. package/packages/algod_client/src/models/avm-value.mjs +33 -0
  193. package/packages/algod_client/src/models/avm-value.mjs.map +1 -0
  194. package/packages/algod_client/src/models/block-hash-response.d.ts +10 -0
  195. package/packages/algod_client/src/models/block-hash-response.js +17 -0
  196. package/packages/algod_client/src/models/block-hash-response.js.map +1 -0
  197. package/packages/algod_client/src/models/block-hash-response.mjs +17 -0
  198. package/packages/algod_client/src/models/block-hash-response.mjs.map +1 -0
  199. package/packages/algod_client/src/models/block-response.d.ts +12 -0
  200. package/packages/algod_client/src/models/block-response.js +25 -0
  201. package/packages/algod_client/src/models/block-response.js.map +1 -0
  202. package/packages/algod_client/src/models/block-response.mjs +25 -0
  203. package/packages/algod_client/src/models/block-response.mjs.map +1 -0
  204. package/packages/algod_client/src/models/block-txids-response.d.ts +10 -0
  205. package/packages/algod_client/src/models/block-txids-response.js +17 -0
  206. package/packages/algod_client/src/models/block-txids-response.js.map +1 -0
  207. package/packages/algod_client/src/models/block-txids-response.mjs +17 -0
  208. package/packages/algod_client/src/models/block-txids-response.mjs.map +1 -0
  209. package/packages/algod_client/src/models/block.d.ts +146 -0
  210. package/packages/algod_client/src/models/block.js +415 -0
  211. package/packages/algod_client/src/models/block.js.map +1 -0
  212. package/packages/algod_client/src/models/block.mjs +415 -0
  213. package/packages/algod_client/src/models/block.mjs.map +1 -0
  214. package/packages/algod_client/src/models/box-descriptor.d.ts +13 -0
  215. package/packages/algod_client/src/models/box-descriptor.js +17 -0
  216. package/packages/algod_client/src/models/box-descriptor.js.map +1 -0
  217. package/packages/algod_client/src/models/box-descriptor.mjs +17 -0
  218. package/packages/algod_client/src/models/box-descriptor.mjs.map +1 -0
  219. package/packages/algod_client/src/models/box-reference.d.ts +17 -0
  220. package/packages/algod_client/src/models/box-reference.js +23 -0
  221. package/packages/algod_client/src/models/box-reference.js.map +1 -0
  222. package/packages/algod_client/src/models/box-reference.mjs +23 -0
  223. package/packages/algod_client/src/models/box-reference.mjs.map +1 -0
  224. package/packages/algod_client/src/models/box.d.ts +21 -0
  225. package/packages/algod_client/src/models/box.js +32 -0
  226. package/packages/algod_client/src/models/box.js.map +1 -0
  227. package/packages/algod_client/src/models/box.mjs +32 -0
  228. package/packages/algod_client/src/models/box.mjs.map +1 -0
  229. package/packages/algod_client/src/models/boxes-response.d.ts +9 -0
  230. package/packages/algod_client/src/models/boxes-response.js +19 -0
  231. package/packages/algod_client/src/models/boxes-response.js.map +1 -0
  232. package/packages/algod_client/src/models/boxes-response.mjs +19 -0
  233. package/packages/algod_client/src/models/boxes-response.mjs.map +1 -0
  234. package/packages/algod_client/src/models/build-version.d.ts +12 -0
  235. package/packages/algod_client/src/models/build-version.js +50 -0
  236. package/packages/algod_client/src/models/build-version.js.map +1 -0
  237. package/packages/algod_client/src/models/build-version.mjs +50 -0
  238. package/packages/algod_client/src/models/build-version.mjs.map +1 -0
  239. package/packages/algod_client/src/models/compile-response.d.ts +17 -0
  240. package/packages/algod_client/src/models/compile-response.js +33 -0
  241. package/packages/algod_client/src/models/compile-response.js.map +1 -0
  242. package/packages/algod_client/src/models/compile-response.mjs +33 -0
  243. package/packages/algod_client/src/models/compile-response.mjs.map +1 -0
  244. package/packages/algod_client/src/models/disassemble-response.d.ts +10 -0
  245. package/packages/algod_client/src/models/disassemble-response.js +17 -0
  246. package/packages/algod_client/src/models/disassemble-response.js.map +1 -0
  247. package/packages/algod_client/src/models/disassemble-response.mjs +17 -0
  248. package/packages/algod_client/src/models/disassemble-response.mjs.map +1 -0
  249. package/packages/algod_client/src/models/eval-delta-key-value.d.ts +14 -0
  250. package/packages/algod_client/src/models/eval-delta-key-value.js +24 -0
  251. package/packages/algod_client/src/models/eval-delta-key-value.js.map +1 -0
  252. package/packages/algod_client/src/models/eval-delta-key-value.mjs +24 -0
  253. package/packages/algod_client/src/models/eval-delta-key-value.mjs.map +1 -0
  254. package/packages/algod_client/src/models/eval-delta.d.ts +21 -0
  255. package/packages/algod_client/src/models/eval-delta.js +33 -0
  256. package/packages/algod_client/src/models/eval-delta.js.map +1 -0
  257. package/packages/algod_client/src/models/eval-delta.mjs +33 -0
  258. package/packages/algod_client/src/models/eval-delta.mjs.map +1 -0
  259. package/packages/algod_client/src/models/genesis-allocation.d.ts +18 -0
  260. package/packages/algod_client/src/models/genesis-allocation.js +88 -0
  261. package/packages/algod_client/src/models/genesis-allocation.js.map +1 -0
  262. package/packages/algod_client/src/models/genesis-allocation.mjs +88 -0
  263. package/packages/algod_client/src/models/genesis-allocation.mjs.map +1 -0
  264. package/packages/algod_client/src/models/genesis.d.ts +17 -0
  265. package/packages/algod_client/src/models/genesis.js +72 -0
  266. package/packages/algod_client/src/models/genesis.js.map +1 -0
  267. package/packages/algod_client/src/models/genesis.mjs +72 -0
  268. package/packages/algod_client/src/models/genesis.mjs.map +1 -0
  269. package/packages/algod_client/src/models/get-block-time-stamp-offset-response.d.ts +10 -0
  270. package/packages/algod_client/src/models/get-block-time-stamp-offset-response.js +17 -0
  271. package/packages/algod_client/src/models/get-block-time-stamp-offset-response.js.map +1 -0
  272. package/packages/algod_client/src/models/get-block-time-stamp-offset-response.mjs +17 -0
  273. package/packages/algod_client/src/models/get-block-time-stamp-offset-response.mjs.map +1 -0
  274. package/packages/algod_client/src/models/get-sync-round-response.d.ts +10 -0
  275. package/packages/algod_client/src/models/get-sync-round-response.js +17 -0
  276. package/packages/algod_client/src/models/get-sync-round-response.js.map +1 -0
  277. package/packages/algod_client/src/models/get-sync-round-response.mjs +17 -0
  278. package/packages/algod_client/src/models/get-sync-round-response.mjs.map +1 -0
  279. package/packages/algod_client/src/models/ledger-state-delta-for-transaction-group.d.ts +14 -0
  280. package/packages/algod_client/src/models/ledger-state-delta-for-transaction-group.js +24 -0
  281. package/packages/algod_client/src/models/ledger-state-delta-for-transaction-group.js.map +1 -0
  282. package/packages/algod_client/src/models/ledger-state-delta-for-transaction-group.mjs +24 -0
  283. package/packages/algod_client/src/models/ledger-state-delta-for-transaction-group.mjs.map +1 -0
  284. package/packages/algod_client/src/models/ledger-state-delta.d.ts +351 -0
  285. package/packages/algod_client/src/models/ledger-state-delta.js +688 -0
  286. package/packages/algod_client/src/models/ledger-state-delta.js.map +1 -0
  287. package/packages/algod_client/src/models/ledger-state-delta.mjs +688 -0
  288. package/packages/algod_client/src/models/ledger-state-delta.mjs.map +1 -0
  289. package/packages/algod_client/src/models/light-block-header-proof.d.ts +21 -0
  290. package/packages/algod_client/src/models/light-block-header-proof.js +32 -0
  291. package/packages/algod_client/src/models/light-block-header-proof.js.map +1 -0
  292. package/packages/algod_client/src/models/light-block-header-proof.mjs +32 -0
  293. package/packages/algod_client/src/models/light-block-header-proof.mjs.map +1 -0
  294. package/packages/algod_client/src/models/node-status-response.d.ts +113 -0
  295. package/packages/algod_client/src/models/node-status-response.js +172 -0
  296. package/packages/algod_client/src/models/node-status-response.js.map +1 -0
  297. package/packages/algod_client/src/models/node-status-response.mjs +172 -0
  298. package/packages/algod_client/src/models/node-status-response.mjs.map +1 -0
  299. package/packages/algod_client/src/models/pending-transaction-response.d.ts +67 -0
  300. package/packages/algod_client/src/models/pending-transaction-response.js +104 -0
  301. package/packages/algod_client/src/models/pending-transaction-response.js.map +1 -0
  302. package/packages/algod_client/src/models/pending-transaction-response.mjs +104 -0
  303. package/packages/algod_client/src/models/pending-transaction-response.mjs.map +1 -0
  304. package/packages/algod_client/src/models/pending-transactions-response.d.ts +20 -0
  305. package/packages/algod_client/src/models/pending-transactions-response.js +25 -0
  306. package/packages/algod_client/src/models/pending-transactions-response.js.map +1 -0
  307. package/packages/algod_client/src/models/pending-transactions-response.mjs +25 -0
  308. package/packages/algod_client/src/models/pending-transactions-response.mjs.map +1 -0
  309. package/packages/algod_client/src/models/post-transactions-response.d.ts +10 -0
  310. package/packages/algod_client/src/models/post-transactions-response.js +17 -0
  311. package/packages/algod_client/src/models/post-transactions-response.js.map +1 -0
  312. package/packages/algod_client/src/models/post-transactions-response.mjs +17 -0
  313. package/packages/algod_client/src/models/post-transactions-response.mjs.map +1 -0
  314. package/packages/algod_client/src/models/scratch-change.d.ts +17 -0
  315. package/packages/algod_client/src/models/scratch-change.js +24 -0
  316. package/packages/algod_client/src/models/scratch-change.js.map +1 -0
  317. package/packages/algod_client/src/models/scratch-change.mjs +24 -0
  318. package/packages/algod_client/src/models/scratch-change.mjs.map +1 -0
  319. package/packages/algod_client/src/models/simulate-initial-states.d.ts +16 -0
  320. package/packages/algod_client/src/models/simulate-initial-states.js +19 -0
  321. package/packages/algod_client/src/models/simulate-initial-states.js.map +1 -0
  322. package/packages/algod_client/src/models/simulate-initial-states.mjs +19 -0
  323. package/packages/algod_client/src/models/simulate-initial-states.mjs.map +1 -0
  324. package/packages/algod_client/src/models/simulate-request-transaction-group.d.ts +16 -0
  325. package/packages/algod_client/src/models/simulate-request-transaction-group.js +19 -0
  326. package/packages/algod_client/src/models/simulate-request-transaction-group.js.map +1 -0
  327. package/packages/algod_client/src/models/simulate-request-transaction-group.mjs +19 -0
  328. package/packages/algod_client/src/models/simulate-request-transaction-group.mjs.map +1 -0
  329. package/packages/algod_client/src/models/simulate-request.d.ts +42 -0
  330. package/packages/algod_client/src/models/simulate-request.js +67 -0
  331. package/packages/algod_client/src/models/simulate-request.js.map +1 -0
  332. package/packages/algod_client/src/models/simulate-request.mjs +67 -0
  333. package/packages/algod_client/src/models/simulate-request.mjs.map +1 -0
  334. package/packages/algod_client/src/models/simulate-response.d.ts +26 -0
  335. package/packages/algod_client/src/models/simulate-response.js +56 -0
  336. package/packages/algod_client/src/models/simulate-response.js.map +1 -0
  337. package/packages/algod_client/src/models/simulate-response.mjs +56 -0
  338. package/packages/algod_client/src/models/simulate-response.mjs.map +1 -0
  339. package/packages/algod_client/src/models/simulate-trace-config.d.ts +25 -0
  340. package/packages/algod_client/src/models/simulate-trace-config.js +37 -0
  341. package/packages/algod_client/src/models/simulate-trace-config.js.map +1 -0
  342. package/packages/algod_client/src/models/simulate-trace-config.mjs +37 -0
  343. package/packages/algod_client/src/models/simulate-trace-config.mjs.map +1 -0
  344. package/packages/algod_client/src/models/simulate-transaction-group-result.d.ts +34 -0
  345. package/packages/algod_client/src/models/simulate-transaction-group-result.js +54 -0
  346. package/packages/algod_client/src/models/simulate-transaction-group-result.js.map +1 -0
  347. package/packages/algod_client/src/models/simulate-transaction-group-result.mjs +54 -0
  348. package/packages/algod_client/src/models/simulate-transaction-group-result.mjs.map +1 -0
  349. package/packages/algod_client/src/models/simulate-transaction-result.d.ts +30 -0
  350. package/packages/algod_client/src/models/simulate-transaction-result.js +54 -0
  351. package/packages/algod_client/src/models/simulate-transaction-result.js.map +1 -0
  352. package/packages/algod_client/src/models/simulate-transaction-result.mjs +54 -0
  353. package/packages/algod_client/src/models/simulate-transaction-result.mjs.map +1 -0
  354. package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.d.ts +43 -0
  355. package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.js +60 -0
  356. package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.js.map +1 -0
  357. package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.mjs +60 -0
  358. package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.mjs.map +1 -0
  359. package/packages/algod_client/src/models/simulation-eval-overrides.d.ts +33 -0
  360. package/packages/algod_client/src/models/simulation-eval-overrides.js +50 -0
  361. package/packages/algod_client/src/models/simulation-eval-overrides.js.map +1 -0
  362. package/packages/algod_client/src/models/simulation-eval-overrides.mjs +50 -0
  363. package/packages/algod_client/src/models/simulation-eval-overrides.mjs.map +1 -0
  364. package/packages/algod_client/src/models/simulation-opcode-trace-unit.d.ts +38 -0
  365. package/packages/algod_client/src/models/simulation-opcode-trace-unit.js +54 -0
  366. package/packages/algod_client/src/models/simulation-opcode-trace-unit.js.map +1 -0
  367. package/packages/algod_client/src/models/simulation-opcode-trace-unit.mjs +54 -0
  368. package/packages/algod_client/src/models/simulation-opcode-trace-unit.mjs.map +1 -0
  369. package/packages/algod_client/src/models/simulation-transaction-exec-trace.d.ts +48 -0
  370. package/packages/algod_client/src/models/simulation-transaction-exec-trace.js +72 -0
  371. package/packages/algod_client/src/models/simulation-transaction-exec-trace.js.map +1 -0
  372. package/packages/algod_client/src/models/simulation-transaction-exec-trace.mjs +72 -0
  373. package/packages/algod_client/src/models/simulation-transaction-exec-trace.mjs.map +1 -0
  374. package/packages/algod_client/src/models/source-map.d.ts +22 -0
  375. package/packages/algod_client/src/models/source-map.js +39 -0
  376. package/packages/algod_client/src/models/source-map.js.map +1 -0
  377. package/packages/algod_client/src/models/source-map.mjs +39 -0
  378. package/packages/algod_client/src/models/source-map.mjs.map +1 -0
  379. package/packages/algod_client/src/models/state-delta.d.ts +11 -0
  380. package/packages/algod_client/src/models/state-delta.js +14 -0
  381. package/packages/algod_client/src/models/state-delta.js.map +1 -0
  382. package/packages/algod_client/src/models/state-delta.mjs +14 -0
  383. package/packages/algod_client/src/models/state-delta.mjs.map +1 -0
  384. package/packages/algod_client/src/models/state-proof-message.d.ts +29 -0
  385. package/packages/algod_client/src/models/state-proof-message.js +44 -0
  386. package/packages/algod_client/src/models/state-proof-message.js.map +1 -0
  387. package/packages/algod_client/src/models/state-proof-message.mjs +44 -0
  388. package/packages/algod_client/src/models/state-proof-message.mjs.map +1 -0
  389. package/packages/algod_client/src/models/state-proof.d.ts +17 -0
  390. package/packages/algod_client/src/models/state-proof.js +24 -0
  391. package/packages/algod_client/src/models/state-proof.js.map +1 -0
  392. package/packages/algod_client/src/models/state-proof.mjs +24 -0
  393. package/packages/algod_client/src/models/state-proof.mjs.map +1 -0
  394. package/packages/algod_client/src/models/suggested-params.d.ts +14 -0
  395. package/packages/algod_client/src/models/supply-response.d.ts +21 -0
  396. package/packages/algod_client/src/models/supply-response.js +31 -0
  397. package/packages/algod_client/src/models/supply-response.js.map +1 -0
  398. package/packages/algod_client/src/models/supply-response.mjs +31 -0
  399. package/packages/algod_client/src/models/supply-response.mjs.map +1 -0
  400. package/packages/algod_client/src/models/teal-key-value-store.d.ts +11 -0
  401. package/packages/algod_client/src/models/teal-key-value-store.js +14 -0
  402. package/packages/algod_client/src/models/teal-key-value-store.js.map +1 -0
  403. package/packages/algod_client/src/models/teal-key-value-store.mjs +14 -0
  404. package/packages/algod_client/src/models/teal-key-value-store.mjs.map +1 -0
  405. package/packages/algod_client/src/models/teal-key-value.d.ts +14 -0
  406. package/packages/algod_client/src/models/teal-key-value.js +24 -0
  407. package/packages/algod_client/src/models/teal-key-value.js.map +1 -0
  408. package/packages/algod_client/src/models/teal-key-value.mjs +24 -0
  409. package/packages/algod_client/src/models/teal-key-value.mjs.map +1 -0
  410. package/packages/algod_client/src/models/teal-value.d.ts +21 -0
  411. package/packages/algod_client/src/models/teal-value.js +33 -0
  412. package/packages/algod_client/src/models/teal-value.js.map +1 -0
  413. package/packages/algod_client/src/models/teal-value.mjs +33 -0
  414. package/packages/algod_client/src/models/teal-value.mjs.map +1 -0
  415. package/packages/algod_client/src/models/transaction-group-ledger-state-deltas-for-round-response.d.ts +9 -0
  416. package/packages/algod_client/src/models/transaction-group-ledger-state-deltas-for-round-response.js +19 -0
  417. package/packages/algod_client/src/models/transaction-group-ledger-state-deltas-for-round-response.js.map +1 -0
  418. package/packages/algod_client/src/models/transaction-group-ledger-state-deltas-for-round-response.mjs +19 -0
  419. package/packages/algod_client/src/models/transaction-group-ledger-state-deltas-for-round-response.mjs.map +1 -0
  420. package/packages/algod_client/src/models/transaction-parameters-response.d.ts +39 -0
  421. package/packages/algod_client/src/models/transaction-parameters-response.js +51 -0
  422. package/packages/algod_client/src/models/transaction-parameters-response.js.map +1 -0
  423. package/packages/algod_client/src/models/transaction-parameters-response.mjs +51 -0
  424. package/packages/algod_client/src/models/transaction-parameters-response.mjs.map +1 -0
  425. package/packages/algod_client/src/models/transaction-proof.d.ts +31 -0
  426. package/packages/algod_client/src/models/transaction-proof.js +45 -0
  427. package/packages/algod_client/src/models/transaction-proof.js.map +1 -0
  428. package/packages/algod_client/src/models/transaction-proof.mjs +45 -0
  429. package/packages/algod_client/src/models/transaction-proof.mjs.map +1 -0
  430. package/packages/algod_client/src/models/version.d.ts +16 -0
  431. package/packages/algod_client/src/models/version.js +41 -0
  432. package/packages/algod_client/src/models/version.js.map +1 -0
  433. package/packages/algod_client/src/models/version.mjs +41 -0
  434. package/packages/algod_client/src/models/version.mjs.map +1 -0
  435. package/packages/common/src/address.d.ts +71 -0
  436. package/packages/common/src/address.js +156 -0
  437. package/packages/common/src/address.js.map +1 -0
  438. package/packages/common/src/address.mjs +144 -0
  439. package/packages/common/src/address.mjs.map +1 -0
  440. package/packages/common/src/array.js +21 -0
  441. package/packages/common/src/array.js.map +1 -0
  442. package/packages/common/src/array.mjs +19 -0
  443. package/packages/common/src/array.mjs.map +1 -0
  444. package/packages/common/src/codecs/codec.d.ts +71 -0
  445. package/packages/common/src/codecs/codec.js +87 -0
  446. package/packages/common/src/codecs/codec.js.map +1 -0
  447. package/packages/common/src/codecs/codec.mjs +86 -0
  448. package/packages/common/src/codecs/codec.mjs.map +1 -0
  449. package/packages/common/src/codecs/composite/array.js +45 -0
  450. package/packages/common/src/codecs/composite/array.js.map +1 -0
  451. package/packages/common/src/codecs/composite/array.mjs +40 -0
  452. package/packages/common/src/codecs/composite/array.mjs.map +1 -0
  453. package/packages/common/src/codecs/composite/map.js +65 -0
  454. package/packages/common/src/codecs/composite/map.js.map +1 -0
  455. package/packages/common/src/codecs/composite/map.mjs +65 -0
  456. package/packages/common/src/codecs/composite/map.mjs.map +1 -0
  457. package/packages/common/src/codecs/composite/record.js +41 -0
  458. package/packages/common/src/codecs/composite/record.js.map +1 -0
  459. package/packages/common/src/codecs/composite/record.mjs +39 -0
  460. package/packages/common/src/codecs/composite/record.mjs.map +1 -0
  461. package/packages/common/src/codecs/models/array-model.js +36 -0
  462. package/packages/common/src/codecs/models/array-model.js.map +1 -0
  463. package/packages/common/src/codecs/models/array-model.mjs +36 -0
  464. package/packages/common/src/codecs/models/array-model.mjs.map +1 -0
  465. package/packages/common/src/codecs/models/object-model.d.ts +22 -0
  466. package/packages/common/src/codecs/models/object-model.js +87 -0
  467. package/packages/common/src/codecs/models/object-model.js.map +1 -0
  468. package/packages/common/src/codecs/models/object-model.mjs +87 -0
  469. package/packages/common/src/codecs/models/object-model.mjs.map +1 -0
  470. package/packages/common/src/codecs/models/primitive-model.js +36 -0
  471. package/packages/common/src/codecs/models/primitive-model.js.map +1 -0
  472. package/packages/common/src/codecs/models/primitive-model.mjs +36 -0
  473. package/packages/common/src/codecs/models/primitive-model.mjs.map +1 -0
  474. package/packages/common/src/codecs/primitives/address.js +33 -0
  475. package/packages/common/src/codecs/primitives/address.js.map +1 -0
  476. package/packages/common/src/codecs/primitives/address.mjs +31 -0
  477. package/packages/common/src/codecs/primitives/address.mjs.map +1 -0
  478. package/packages/common/src/codecs/primitives/bigint.js +18 -0
  479. package/packages/common/src/codecs/primitives/bigint.js.map +1 -0
  480. package/packages/common/src/codecs/primitives/bigint.mjs +18 -0
  481. package/packages/common/src/codecs/primitives/bigint.mjs.map +1 -0
  482. package/packages/common/src/codecs/primitives/boolean.js +13 -0
  483. package/packages/common/src/codecs/primitives/boolean.js.map +1 -0
  484. package/packages/common/src/codecs/primitives/boolean.mjs +13 -0
  485. package/packages/common/src/codecs/primitives/boolean.mjs.map +1 -0
  486. package/packages/common/src/codecs/primitives/bytes.js +28 -0
  487. package/packages/common/src/codecs/primitives/bytes.js.map +1 -0
  488. package/packages/common/src/codecs/primitives/bytes.mjs +26 -0
  489. package/packages/common/src/codecs/primitives/bytes.mjs.map +1 -0
  490. package/packages/common/src/codecs/primitives/fixed-bytes.js +37 -0
  491. package/packages/common/src/codecs/primitives/fixed-bytes.js.map +1 -0
  492. package/packages/common/src/codecs/primitives/fixed-bytes.mjs +33 -0
  493. package/packages/common/src/codecs/primitives/fixed-bytes.mjs.map +1 -0
  494. package/packages/common/src/codecs/primitives/number.js +16 -0
  495. package/packages/common/src/codecs/primitives/number.js.map +1 -0
  496. package/packages/common/src/codecs/primitives/number.mjs +16 -0
  497. package/packages/common/src/codecs/primitives/number.mjs.map +1 -0
  498. package/packages/common/src/codecs/primitives/string.js +17 -0
  499. package/packages/common/src/codecs/primitives/string.js.map +1 -0
  500. package/packages/common/src/codecs/primitives/string.mjs +17 -0
  501. package/packages/common/src/codecs/primitives/string.mjs.map +1 -0
  502. package/packages/common/src/codecs/primitives/unknown.js +58 -0
  503. package/packages/common/src/codecs/primitives/unknown.js.map +1 -0
  504. package/packages/common/src/codecs/primitives/unknown.mjs +58 -0
  505. package/packages/common/src/codecs/primitives/unknown.mjs.map +1 -0
  506. package/packages/common/src/codecs/types.d.ts +27 -0
  507. package/packages/common/src/codecs/wire.d.ts +15 -0
  508. package/packages/common/src/codecs/wire.js +24 -0
  509. package/packages/common/src/codecs/wire.js.map +1 -0
  510. package/packages/common/src/codecs/wire.mjs +21 -0
  511. package/packages/common/src/codecs/wire.mjs.map +1 -0
  512. package/packages/common/src/constants.js +63 -0
  513. package/packages/common/src/constants.js.map +1 -0
  514. package/packages/common/src/constants.mjs +34 -0
  515. package/packages/common/src/constants.mjs.map +1 -0
  516. package/packages/common/src/crypto.js +13 -0
  517. package/packages/common/src/crypto.js.map +1 -0
  518. package/packages/common/src/crypto.mjs +11 -0
  519. package/packages/common/src/crypto.mjs.map +1 -0
  520. package/packages/common/src/expand.d.ts +9 -0
  521. package/packages/common/src/json.js +38 -0
  522. package/packages/common/src/json.js.map +1 -0
  523. package/packages/common/src/json.mjs +35 -0
  524. package/packages/common/src/json.mjs.map +1 -0
  525. package/packages/common/src/logger.d.ts +12 -0
  526. package/packages/common/src/msgpack.js +26 -0
  527. package/packages/common/src/msgpack.js.map +1 -0
  528. package/packages/common/src/msgpack.mjs +23 -0
  529. package/packages/common/src/msgpack.mjs.map +1 -0
  530. package/packages/indexer_client/src/apis/api-service.d.ts +251 -0
  531. package/packages/indexer_client/src/apis/api-service.js +482 -0
  532. package/packages/indexer_client/src/apis/api-service.js.map +1 -0
  533. package/packages/indexer_client/src/apis/api-service.mjs +482 -0
  534. package/packages/indexer_client/src/apis/api-service.mjs.map +1 -0
  535. package/packages/indexer_client/src/client.d.ts +10 -0
  536. package/packages/indexer_client/src/client.js +13 -0
  537. package/packages/indexer_client/src/client.js.map +1 -0
  538. package/packages/indexer_client/src/client.mjs +13 -0
  539. package/packages/indexer_client/src/client.mjs.map +1 -0
  540. package/packages/indexer_client/src/core/api-error.d.ts +10 -0
  541. package/packages/indexer_client/src/core/api-error.js +17 -0
  542. package/packages/indexer_client/src/core/api-error.js.map +1 -0
  543. package/packages/indexer_client/src/core/api-error.mjs +16 -0
  544. package/packages/indexer_client/src/core/api-error.mjs.map +1 -0
  545. package/packages/indexer_client/src/core/base-http-request.d.ts +25 -0
  546. package/packages/indexer_client/src/core/base-http-request.js +16 -0
  547. package/packages/indexer_client/src/core/base-http-request.js.map +1 -0
  548. package/packages/indexer_client/src/core/base-http-request.mjs +14 -0
  549. package/packages/indexer_client/src/core/base-http-request.mjs.map +1 -0
  550. package/packages/indexer_client/src/core/client-config.d.ts +17 -0
  551. package/packages/indexer_client/src/core/fetch-http-request.d.ts +10 -0
  552. package/packages/indexer_client/src/core/fetch-http-request.js +85 -0
  553. package/packages/indexer_client/src/core/fetch-http-request.js.map +1 -0
  554. package/packages/indexer_client/src/core/fetch-http-request.mjs +85 -0
  555. package/packages/indexer_client/src/core/fetch-http-request.mjs.map +1 -0
  556. package/packages/indexer_client/src/core/model-runtime.d.ts +10 -0
  557. package/packages/indexer_client/src/core/model-runtime.js +25 -0
  558. package/packages/indexer_client/src/core/model-runtime.js.map +1 -0
  559. package/packages/indexer_client/src/core/model-runtime.mjs +22 -0
  560. package/packages/indexer_client/src/core/model-runtime.mjs.map +1 -0
  561. package/packages/indexer_client/src/core/request.js +62 -0
  562. package/packages/indexer_client/src/core/request.js.map +1 -0
  563. package/packages/indexer_client/src/core/request.mjs +62 -0
  564. package/packages/indexer_client/src/core/request.mjs.map +1 -0
  565. package/packages/indexer_client/src/models/account-participation.d.ts +33 -0
  566. package/packages/indexer_client/src/models/account-participation.js +50 -0
  567. package/packages/indexer_client/src/models/account-participation.js.map +1 -0
  568. package/packages/indexer_client/src/models/account-participation.mjs +50 -0
  569. package/packages/indexer_client/src/models/account-participation.mjs.map +1 -0
  570. package/packages/indexer_client/src/models/account-response.d.ts +13 -0
  571. package/packages/indexer_client/src/models/account-response.js +24 -0
  572. package/packages/indexer_client/src/models/account-response.js.map +1 -0
  573. package/packages/indexer_client/src/models/account-response.mjs +24 -0
  574. package/packages/indexer_client/src/models/account-response.mjs.map +1 -0
  575. package/packages/indexer_client/src/models/account-state-delta.d.ts +14 -0
  576. package/packages/indexer_client/src/models/account-state-delta.js +24 -0
  577. package/packages/indexer_client/src/models/account-state-delta.js.map +1 -0
  578. package/packages/indexer_client/src/models/account-state-delta.mjs +24 -0
  579. package/packages/indexer_client/src/models/account-state-delta.mjs.map +1 -0
  580. package/packages/indexer_client/src/models/account.d.ts +152 -0
  581. package/packages/indexer_client/src/models/account.js +205 -0
  582. package/packages/indexer_client/src/models/account.js.map +1 -0
  583. package/packages/indexer_client/src/models/account.mjs +205 -0
  584. package/packages/indexer_client/src/models/account.mjs.map +1 -0
  585. package/packages/indexer_client/src/models/accounts-response.d.ts +17 -0
  586. package/packages/indexer_client/src/models/accounts-response.js +35 -0
  587. package/packages/indexer_client/src/models/accounts-response.js.map +1 -0
  588. package/packages/indexer_client/src/models/accounts-response.mjs +35 -0
  589. package/packages/indexer_client/src/models/accounts-response.mjs.map +1 -0
  590. package/packages/indexer_client/src/models/application-local-state.d.ts +31 -0
  591. package/packages/indexer_client/src/models/application-local-state.js +54 -0
  592. package/packages/indexer_client/src/models/application-local-state.js.map +1 -0
  593. package/packages/indexer_client/src/models/application-local-state.mjs +54 -0
  594. package/packages/indexer_client/src/models/application-local-state.mjs.map +1 -0
  595. package/packages/indexer_client/src/models/application-local-states-response.d.ts +17 -0
  596. package/packages/indexer_client/src/models/application-local-states-response.js +35 -0
  597. package/packages/indexer_client/src/models/application-local-states-response.js.map +1 -0
  598. package/packages/indexer_client/src/models/application-local-states-response.mjs +35 -0
  599. package/packages/indexer_client/src/models/application-local-states-response.mjs.map +1 -0
  600. package/packages/indexer_client/src/models/application-log-data.d.ts +17 -0
  601. package/packages/indexer_client/src/models/application-log-data.js +23 -0
  602. package/packages/indexer_client/src/models/application-log-data.js.map +1 -0
  603. package/packages/indexer_client/src/models/application-log-data.mjs +23 -0
  604. package/packages/indexer_client/src/models/application-log-data.mjs.map +1 -0
  605. package/packages/indexer_client/src/models/application-logs-response.d.ts +21 -0
  606. package/packages/indexer_client/src/models/application-logs-response.js +41 -0
  607. package/packages/indexer_client/src/models/application-logs-response.js.map +1 -0
  608. package/packages/indexer_client/src/models/application-logs-response.mjs +41 -0
  609. package/packages/indexer_client/src/models/application-logs-response.mjs.map +1 -0
  610. package/packages/indexer_client/src/models/application-params.d.ts +37 -0
  611. package/packages/indexer_client/src/models/application-params.js +67 -0
  612. package/packages/indexer_client/src/models/application-params.js.map +1 -0
  613. package/packages/indexer_client/src/models/application-params.mjs +67 -0
  614. package/packages/indexer_client/src/models/application-params.mjs.map +1 -0
  615. package/packages/indexer_client/src/models/application-response.d.ts +13 -0
  616. package/packages/indexer_client/src/models/application-response.js +24 -0
  617. package/packages/indexer_client/src/models/application-response.js.map +1 -0
  618. package/packages/indexer_client/src/models/application-response.mjs +24 -0
  619. package/packages/indexer_client/src/models/application-response.mjs.map +1 -0
  620. package/packages/indexer_client/src/models/application-state-schema.d.ts +17 -0
  621. package/packages/indexer_client/src/models/application-state-schema.js +22 -0
  622. package/packages/indexer_client/src/models/application-state-schema.js.map +1 -0
  623. package/packages/indexer_client/src/models/application-state-schema.mjs +22 -0
  624. package/packages/indexer_client/src/models/application-state-schema.mjs.map +1 -0
  625. package/packages/indexer_client/src/models/application.d.ts +29 -0
  626. package/packages/indexer_client/src/models/application.js +46 -0
  627. package/packages/indexer_client/src/models/application.js.map +1 -0
  628. package/packages/indexer_client/src/models/application.mjs +46 -0
  629. package/packages/indexer_client/src/models/application.mjs.map +1 -0
  630. package/packages/indexer_client/src/models/applications-response.d.ts +17 -0
  631. package/packages/indexer_client/src/models/applications-response.js +35 -0
  632. package/packages/indexer_client/src/models/applications-response.js.map +1 -0
  633. package/packages/indexer_client/src/models/applications-response.mjs +35 -0
  634. package/packages/indexer_client/src/models/applications-response.mjs.map +1 -0
  635. package/packages/indexer_client/src/models/asset-balances-response.d.ts +17 -0
  636. package/packages/indexer_client/src/models/asset-balances-response.js +35 -0
  637. package/packages/indexer_client/src/models/asset-balances-response.js.map +1 -0
  638. package/packages/indexer_client/src/models/asset-balances-response.mjs +35 -0
  639. package/packages/indexer_client/src/models/asset-balances-response.mjs.map +1 -0
  640. package/packages/indexer_client/src/models/asset-holding.d.ts +36 -0
  641. package/packages/indexer_client/src/models/asset-holding.js +50 -0
  642. package/packages/indexer_client/src/models/asset-holding.js.map +1 -0
  643. package/packages/indexer_client/src/models/asset-holding.mjs +50 -0
  644. package/packages/indexer_client/src/models/asset-holding.mjs.map +1 -0
  645. package/packages/indexer_client/src/models/asset-holdings-response.d.ts +17 -0
  646. package/packages/indexer_client/src/models/asset-holdings-response.js +35 -0
  647. package/packages/indexer_client/src/models/asset-holdings-response.js.map +1 -0
  648. package/packages/indexer_client/src/models/asset-holdings-response.mjs +35 -0
  649. package/packages/indexer_client/src/models/asset-holdings-response.mjs.map +1 -0
  650. package/packages/indexer_client/src/models/asset-params.d.ts +74 -0
  651. package/packages/indexer_client/src/models/asset-params.js +107 -0
  652. package/packages/indexer_client/src/models/asset-params.js.map +1 -0
  653. package/packages/indexer_client/src/models/asset-params.mjs +107 -0
  654. package/packages/indexer_client/src/models/asset-params.mjs.map +1 -0
  655. package/packages/indexer_client/src/models/asset-response.d.ts +13 -0
  656. package/packages/indexer_client/src/models/asset-response.js +24 -0
  657. package/packages/indexer_client/src/models/asset-response.js.map +1 -0
  658. package/packages/indexer_client/src/models/asset-response.mjs +24 -0
  659. package/packages/indexer_client/src/models/asset-response.mjs.map +1 -0
  660. package/packages/indexer_client/src/models/asset.d.ts +29 -0
  661. package/packages/indexer_client/src/models/asset.js +46 -0
  662. package/packages/indexer_client/src/models/asset.js.map +1 -0
  663. package/packages/indexer_client/src/models/asset.mjs +46 -0
  664. package/packages/indexer_client/src/models/asset.mjs.map +1 -0
  665. package/packages/indexer_client/src/models/assets-response.d.ts +17 -0
  666. package/packages/indexer_client/src/models/assets-response.js +35 -0
  667. package/packages/indexer_client/src/models/assets-response.js.map +1 -0
  668. package/packages/indexer_client/src/models/assets-response.mjs +35 -0
  669. package/packages/indexer_client/src/models/assets-response.mjs.map +1 -0
  670. package/packages/indexer_client/src/models/block-headers-response.d.ts +17 -0
  671. package/packages/indexer_client/src/models/block-headers-response.js +35 -0
  672. package/packages/indexer_client/src/models/block-headers-response.js.map +1 -0
  673. package/packages/indexer_client/src/models/block-headers-response.mjs +35 -0
  674. package/packages/indexer_client/src/models/block-headers-response.mjs.map +1 -0
  675. package/packages/indexer_client/src/models/block-rewards.d.ts +33 -0
  676. package/packages/indexer_client/src/models/block-rewards.js +50 -0
  677. package/packages/indexer_client/src/models/block-rewards.js.map +1 -0
  678. package/packages/indexer_client/src/models/block-rewards.mjs +50 -0
  679. package/packages/indexer_client/src/models/block-rewards.mjs.map +1 -0
  680. package/packages/indexer_client/src/models/block-upgrade-state.d.ts +29 -0
  681. package/packages/indexer_client/src/models/block-upgrade-state.js +45 -0
  682. package/packages/indexer_client/src/models/block-upgrade-state.js.map +1 -0
  683. package/packages/indexer_client/src/models/block-upgrade-state.mjs +45 -0
  684. package/packages/indexer_client/src/models/block-upgrade-state.mjs.map +1 -0
  685. package/packages/indexer_client/src/models/block-upgrade-vote.d.ts +21 -0
  686. package/packages/indexer_client/src/models/block-upgrade-vote.js +33 -0
  687. package/packages/indexer_client/src/models/block-upgrade-vote.js.map +1 -0
  688. package/packages/indexer_client/src/models/block-upgrade-vote.mjs +33 -0
  689. package/packages/indexer_client/src/models/block-upgrade-vote.mjs.map +1 -0
  690. package/packages/indexer_client/src/models/block.d.ts +95 -0
  691. package/packages/indexer_client/src/models/block.js +151 -0
  692. package/packages/indexer_client/src/models/block.js.map +1 -0
  693. package/packages/indexer_client/src/models/block.mjs +151 -0
  694. package/packages/indexer_client/src/models/block.mjs.map +1 -0
  695. package/packages/indexer_client/src/models/box-descriptor.d.ts +13 -0
  696. package/packages/indexer_client/src/models/box-descriptor.js +17 -0
  697. package/packages/indexer_client/src/models/box-descriptor.js.map +1 -0
  698. package/packages/indexer_client/src/models/box-descriptor.mjs +17 -0
  699. package/packages/indexer_client/src/models/box-descriptor.mjs.map +1 -0
  700. package/packages/indexer_client/src/models/box-reference.d.ts +17 -0
  701. package/packages/indexer_client/src/models/box-reference.js +23 -0
  702. package/packages/indexer_client/src/models/box-reference.js.map +1 -0
  703. package/packages/indexer_client/src/models/box-reference.mjs +23 -0
  704. package/packages/indexer_client/src/models/box-reference.mjs.map +1 -0
  705. package/packages/indexer_client/src/models/box.d.ts +21 -0
  706. package/packages/indexer_client/src/models/box.js +32 -0
  707. package/packages/indexer_client/src/models/box.js.map +1 -0
  708. package/packages/indexer_client/src/models/box.mjs +32 -0
  709. package/packages/indexer_client/src/models/box.mjs.map +1 -0
  710. package/packages/indexer_client/src/models/boxes-response.d.ts +17 -0
  711. package/packages/indexer_client/src/models/boxes-response.js +35 -0
  712. package/packages/indexer_client/src/models/boxes-response.js.map +1 -0
  713. package/packages/indexer_client/src/models/boxes-response.mjs +35 -0
  714. package/packages/indexer_client/src/models/boxes-response.mjs.map +1 -0
  715. package/packages/indexer_client/src/models/eval-delta-key-value.d.ts +14 -0
  716. package/packages/indexer_client/src/models/eval-delta-key-value.js +24 -0
  717. package/packages/indexer_client/src/models/eval-delta-key-value.js.map +1 -0
  718. package/packages/indexer_client/src/models/eval-delta-key-value.mjs +24 -0
  719. package/packages/indexer_client/src/models/eval-delta-key-value.mjs.map +1 -0
  720. package/packages/indexer_client/src/models/eval-delta.d.ts +21 -0
  721. package/packages/indexer_client/src/models/eval-delta.js +33 -0
  722. package/packages/indexer_client/src/models/eval-delta.js.map +1 -0
  723. package/packages/indexer_client/src/models/eval-delta.mjs +33 -0
  724. package/packages/indexer_client/src/models/eval-delta.mjs.map +1 -0
  725. package/packages/indexer_client/src/models/hash-factory.d.ts +10 -0
  726. package/packages/indexer_client/src/models/hash-factory.js +17 -0
  727. package/packages/indexer_client/src/models/hash-factory.js.map +1 -0
  728. package/packages/indexer_client/src/models/hash-factory.mjs +17 -0
  729. package/packages/indexer_client/src/models/hash-factory.mjs.map +1 -0
  730. package/packages/indexer_client/src/models/hb-proof-fields.d.ts +29 -0
  731. package/packages/indexer_client/src/models/hb-proof-fields.js +43 -0
  732. package/packages/indexer_client/src/models/hb-proof-fields.js.map +1 -0
  733. package/packages/indexer_client/src/models/hb-proof-fields.mjs +43 -0
  734. package/packages/indexer_client/src/models/hb-proof-fields.mjs.map +1 -0
  735. package/packages/indexer_client/src/models/health-check.d.ts +19 -0
  736. package/packages/indexer_client/src/models/health-check.js +60 -0
  737. package/packages/indexer_client/src/models/health-check.js.map +1 -0
  738. package/packages/indexer_client/src/models/health-check.mjs +60 -0
  739. package/packages/indexer_client/src/models/health-check.mjs.map +1 -0
  740. package/packages/indexer_client/src/models/holding-ref.d.ts +20 -0
  741. package/packages/indexer_client/src/models/holding-ref.js +23 -0
  742. package/packages/indexer_client/src/models/holding-ref.js.map +1 -0
  743. package/packages/indexer_client/src/models/holding-ref.mjs +23 -0
  744. package/packages/indexer_client/src/models/holding-ref.mjs.map +1 -0
  745. package/packages/indexer_client/src/models/indexer-state-proof-message.d.ts +26 -0
  746. package/packages/indexer_client/src/models/indexer-state-proof-message.js +44 -0
  747. package/packages/indexer_client/src/models/indexer-state-proof-message.js.map +1 -0
  748. package/packages/indexer_client/src/models/indexer-state-proof-message.mjs +44 -0
  749. package/packages/indexer_client/src/models/indexer-state-proof-message.mjs.map +1 -0
  750. package/packages/indexer_client/src/models/locals-ref.d.ts +20 -0
  751. package/packages/indexer_client/src/models/locals-ref.js +23 -0
  752. package/packages/indexer_client/src/models/locals-ref.js.map +1 -0
  753. package/packages/indexer_client/src/models/locals-ref.mjs +23 -0
  754. package/packages/indexer_client/src/models/locals-ref.mjs.map +1 -0
  755. package/packages/indexer_client/src/models/merkle-array-proof.d.ts +17 -0
  756. package/packages/indexer_client/src/models/merkle-array-proof.js +34 -0
  757. package/packages/indexer_client/src/models/merkle-array-proof.js.map +1 -0
  758. package/packages/indexer_client/src/models/merkle-array-proof.mjs +34 -0
  759. package/packages/indexer_client/src/models/merkle-array-proof.mjs.map +1 -0
  760. package/packages/indexer_client/src/models/mini-asset-holding.d.ts +24 -0
  761. package/packages/indexer_client/src/models/mini-asset-holding.js +51 -0
  762. package/packages/indexer_client/src/models/mini-asset-holding.js.map +1 -0
  763. package/packages/indexer_client/src/models/mini-asset-holding.mjs +51 -0
  764. package/packages/indexer_client/src/models/mini-asset-holding.mjs.map +1 -0
  765. package/packages/indexer_client/src/models/on-completion.d.ts +16 -0
  766. package/packages/indexer_client/src/models/on-completion.js +12 -0
  767. package/packages/indexer_client/src/models/on-completion.js.map +1 -0
  768. package/packages/indexer_client/src/models/on-completion.mjs +12 -0
  769. package/packages/indexer_client/src/models/on-completion.mjs.map +1 -0
  770. package/packages/indexer_client/src/models/participation-updates.d.ts +17 -0
  771. package/packages/indexer_client/src/models/participation-updates.js +22 -0
  772. package/packages/indexer_client/src/models/participation-updates.js.map +1 -0
  773. package/packages/indexer_client/src/models/participation-updates.mjs +22 -0
  774. package/packages/indexer_client/src/models/participation-updates.mjs.map +1 -0
  775. package/packages/indexer_client/src/models/resource-ref.d.ts +32 -0
  776. package/packages/indexer_client/src/models/resource-ref.js +54 -0
  777. package/packages/indexer_client/src/models/resource-ref.js.map +1 -0
  778. package/packages/indexer_client/src/models/resource-ref.mjs +54 -0
  779. package/packages/indexer_client/src/models/resource-ref.mjs.map +1 -0
  780. package/packages/indexer_client/src/models/state-delta.d.ts +11 -0
  781. package/packages/indexer_client/src/models/state-delta.js +14 -0
  782. package/packages/indexer_client/src/models/state-delta.js.map +1 -0
  783. package/packages/indexer_client/src/models/state-delta.mjs +14 -0
  784. package/packages/indexer_client/src/models/state-delta.mjs.map +1 -0
  785. package/packages/indexer_client/src/models/state-proof-fields.d.ts +38 -0
  786. package/packages/indexer_client/src/models/state-proof-fields.js +61 -0
  787. package/packages/indexer_client/src/models/state-proof-fields.js.map +1 -0
  788. package/packages/indexer_client/src/models/state-proof-fields.mjs +61 -0
  789. package/packages/indexer_client/src/models/state-proof-fields.mjs.map +1 -0
  790. package/packages/indexer_client/src/models/state-proof-participant.d.ts +13 -0
  791. package/packages/indexer_client/src/models/state-proof-participant.js +24 -0
  792. package/packages/indexer_client/src/models/state-proof-participant.js.map +1 -0
  793. package/packages/indexer_client/src/models/state-proof-participant.mjs +24 -0
  794. package/packages/indexer_client/src/models/state-proof-participant.mjs.map +1 -0
  795. package/packages/indexer_client/src/models/state-proof-reveal.d.ts +15 -0
  796. package/packages/indexer_client/src/models/state-proof-reveal.js +34 -0
  797. package/packages/indexer_client/src/models/state-proof-reveal.js.map +1 -0
  798. package/packages/indexer_client/src/models/state-proof-reveal.mjs +34 -0
  799. package/packages/indexer_client/src/models/state-proof-reveal.mjs.map +1 -0
  800. package/packages/indexer_client/src/models/state-proof-sig-slot.d.ts +13 -0
  801. package/packages/indexer_client/src/models/state-proof-sig-slot.js +24 -0
  802. package/packages/indexer_client/src/models/state-proof-sig-slot.js.map +1 -0
  803. package/packages/indexer_client/src/models/state-proof-sig-slot.mjs +24 -0
  804. package/packages/indexer_client/src/models/state-proof-sig-slot.mjs.map +1 -0
  805. package/packages/indexer_client/src/models/state-proof-signature.d.ts +15 -0
  806. package/packages/indexer_client/src/models/state-proof-signature.js +40 -0
  807. package/packages/indexer_client/src/models/state-proof-signature.js.map +1 -0
  808. package/packages/indexer_client/src/models/state-proof-signature.mjs +40 -0
  809. package/packages/indexer_client/src/models/state-proof-signature.mjs.map +1 -0
  810. package/packages/indexer_client/src/models/state-proof-tracking.d.ts +22 -0
  811. package/packages/indexer_client/src/models/state-proof-tracking.js +39 -0
  812. package/packages/indexer_client/src/models/state-proof-tracking.js.map +1 -0
  813. package/packages/indexer_client/src/models/state-proof-tracking.mjs +39 -0
  814. package/packages/indexer_client/src/models/state-proof-tracking.mjs.map +1 -0
  815. package/packages/indexer_client/src/models/state-proof-verifier.d.ts +14 -0
  816. package/packages/indexer_client/src/models/state-proof-verifier.js +23 -0
  817. package/packages/indexer_client/src/models/state-proof-verifier.js.map +1 -0
  818. package/packages/indexer_client/src/models/state-proof-verifier.mjs +23 -0
  819. package/packages/indexer_client/src/models/state-proof-verifier.mjs.map +1 -0
  820. package/packages/indexer_client/src/models/state-schema.d.ts +17 -0
  821. package/packages/indexer_client/src/models/state-schema.js +22 -0
  822. package/packages/indexer_client/src/models/state-schema.js.map +1 -0
  823. package/packages/indexer_client/src/models/state-schema.mjs +22 -0
  824. package/packages/indexer_client/src/models/state-schema.mjs.map +1 -0
  825. package/packages/indexer_client/src/models/teal-key-value-store.d.ts +11 -0
  826. package/packages/indexer_client/src/models/teal-key-value-store.js +14 -0
  827. package/packages/indexer_client/src/models/teal-key-value-store.js.map +1 -0
  828. package/packages/indexer_client/src/models/teal-key-value-store.mjs +14 -0
  829. package/packages/indexer_client/src/models/teal-key-value-store.mjs.map +1 -0
  830. package/packages/indexer_client/src/models/teal-key-value.d.ts +14 -0
  831. package/packages/indexer_client/src/models/teal-key-value.js +24 -0
  832. package/packages/indexer_client/src/models/teal-key-value.js.map +1 -0
  833. package/packages/indexer_client/src/models/teal-key-value.mjs +24 -0
  834. package/packages/indexer_client/src/models/teal-key-value.mjs.map +1 -0
  835. package/packages/indexer_client/src/models/teal-value.d.ts +21 -0
  836. package/packages/indexer_client/src/models/teal-value.js +33 -0
  837. package/packages/indexer_client/src/models/teal-value.js.map +1 -0
  838. package/packages/indexer_client/src/models/teal-value.mjs +33 -0
  839. package/packages/indexer_client/src/models/teal-value.mjs.map +1 -0
  840. package/packages/indexer_client/src/models/transaction-application.d.ts +66 -0
  841. package/packages/indexer_client/src/models/transaction-application.js +106 -0
  842. package/packages/indexer_client/src/models/transaction-application.js.map +1 -0
  843. package/packages/indexer_client/src/models/transaction-application.mjs +106 -0
  844. package/packages/indexer_client/src/models/transaction-application.mjs.map +1 -0
  845. package/packages/indexer_client/src/models/transaction-asset-config.d.ts +24 -0
  846. package/packages/indexer_client/src/models/transaction-asset-config.js +24 -0
  847. package/packages/indexer_client/src/models/transaction-asset-config.js.map +1 -0
  848. package/packages/indexer_client/src/models/transaction-asset-config.mjs +24 -0
  849. package/packages/indexer_client/src/models/transaction-asset-config.mjs.map +1 -0
  850. package/packages/indexer_client/src/models/transaction-asset-freeze.d.ts +24 -0
  851. package/packages/indexer_client/src/models/transaction-asset-freeze.js +33 -0
  852. package/packages/indexer_client/src/models/transaction-asset-freeze.js.map +1 -0
  853. package/packages/indexer_client/src/models/transaction-asset-freeze.mjs +33 -0
  854. package/packages/indexer_client/src/models/transaction-asset-freeze.mjs.map +1 -0
  855. package/packages/indexer_client/src/models/transaction-asset-transfer.d.ts +36 -0
  856. package/packages/indexer_client/src/models/transaction-asset-transfer.js +50 -0
  857. package/packages/indexer_client/src/models/transaction-asset-transfer.js.map +1 -0
  858. package/packages/indexer_client/src/models/transaction-asset-transfer.mjs +50 -0
  859. package/packages/indexer_client/src/models/transaction-asset-transfer.mjs.map +1 -0
  860. package/packages/indexer_client/src/models/transaction-heartbeat.d.ts +32 -0
  861. package/packages/indexer_client/src/models/transaction-heartbeat.js +47 -0
  862. package/packages/indexer_client/src/models/transaction-heartbeat.js.map +1 -0
  863. package/packages/indexer_client/src/models/transaction-heartbeat.mjs +47 -0
  864. package/packages/indexer_client/src/models/transaction-heartbeat.mjs.map +1 -0
  865. package/packages/indexer_client/src/models/transaction-keyreg.d.ts +40 -0
  866. package/packages/indexer_client/src/models/transaction-keyreg.js +57 -0
  867. package/packages/indexer_client/src/models/transaction-keyreg.js.map +1 -0
  868. package/packages/indexer_client/src/models/transaction-keyreg.mjs +57 -0
  869. package/packages/indexer_client/src/models/transaction-keyreg.mjs.map +1 -0
  870. package/packages/indexer_client/src/models/transaction-payment.d.ts +28 -0
  871. package/packages/indexer_client/src/models/transaction-payment.js +38 -0
  872. package/packages/indexer_client/src/models/transaction-payment.js.map +1 -0
  873. package/packages/indexer_client/src/models/transaction-payment.mjs +38 -0
  874. package/packages/indexer_client/src/models/transaction-payment.mjs.map +1 -0
  875. package/packages/indexer_client/src/models/transaction-response.d.ts +13 -0
  876. package/packages/indexer_client/src/models/transaction-response.js +24 -0
  877. package/packages/indexer_client/src/models/transaction-response.js.map +1 -0
  878. package/packages/indexer_client/src/models/transaction-response.mjs +24 -0
  879. package/packages/indexer_client/src/models/transaction-response.mjs.map +1 -0
  880. package/packages/indexer_client/src/models/transaction-signature-logicsig.d.ts +29 -0
  881. package/packages/indexer_client/src/models/transaction-signature-logicsig.js +46 -0
  882. package/packages/indexer_client/src/models/transaction-signature-logicsig.js.map +1 -0
  883. package/packages/indexer_client/src/models/transaction-signature-logicsig.mjs +46 -0
  884. package/packages/indexer_client/src/models/transaction-signature-logicsig.mjs.map +1 -0
  885. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.d.ts +14 -0
  886. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.js +22 -0
  887. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.js.map +1 -0
  888. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.mjs +22 -0
  889. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.mjs.map +1 -0
  890. package/packages/indexer_client/src/models/transaction-signature-multisig.d.ts +27 -0
  891. package/packages/indexer_client/src/models/transaction-signature-multisig.js +34 -0
  892. package/packages/indexer_client/src/models/transaction-signature-multisig.js.map +1 -0
  893. package/packages/indexer_client/src/models/transaction-signature-multisig.mjs +34 -0
  894. package/packages/indexer_client/src/models/transaction-signature-multisig.mjs.map +1 -0
  895. package/packages/indexer_client/src/models/transaction-signature.d.ts +19 -0
  896. package/packages/indexer_client/src/models/transaction-signature.js +34 -0
  897. package/packages/indexer_client/src/models/transaction-signature.js.map +1 -0
  898. package/packages/indexer_client/src/models/transaction-signature.mjs +34 -0
  899. package/packages/indexer_client/src/models/transaction-signature.mjs.map +1 -0
  900. package/packages/indexer_client/src/models/transaction-state-proof.d.ts +22 -0
  901. package/packages/indexer_client/src/models/transaction-state-proof.js +34 -0
  902. package/packages/indexer_client/src/models/transaction-state-proof.js.map +1 -0
  903. package/packages/indexer_client/src/models/transaction-state-proof.mjs +34 -0
  904. package/packages/indexer_client/src/models/transaction-state-proof.mjs.map +1 -0
  905. package/packages/indexer_client/src/models/transaction.d.ts +147 -0
  906. package/packages/indexer_client/src/models/transaction.js +241 -0
  907. package/packages/indexer_client/src/models/transaction.js.map +1 -0
  908. package/packages/indexer_client/src/models/transaction.mjs +241 -0
  909. package/packages/indexer_client/src/models/transaction.mjs.map +1 -0
  910. package/packages/indexer_client/src/models/transactions-response.d.ts +17 -0
  911. package/packages/indexer_client/src/models/transactions-response.js +35 -0
  912. package/packages/indexer_client/src/models/transactions-response.js.map +1 -0
  913. package/packages/indexer_client/src/models/transactions-response.mjs +35 -0
  914. package/packages/indexer_client/src/models/transactions-response.mjs.map +1 -0
  915. package/packages/kmd_client/src/apis/api-service.d.ts +152 -0
  916. package/packages/kmd_client/src/apis/api-service.js +517 -0
  917. package/packages/kmd_client/src/apis/api-service.js.map +1 -0
  918. package/packages/kmd_client/src/apis/api-service.mjs +517 -0
  919. package/packages/kmd_client/src/apis/api-service.mjs.map +1 -0
  920. package/packages/kmd_client/src/client.d.ts +10 -0
  921. package/packages/kmd_client/src/client.js +13 -0
  922. package/packages/kmd_client/src/client.js.map +1 -0
  923. package/packages/kmd_client/src/client.mjs +13 -0
  924. package/packages/kmd_client/src/client.mjs.map +1 -0
  925. package/packages/kmd_client/src/core/api-error.d.ts +10 -0
  926. package/packages/kmd_client/src/core/api-error.js +17 -0
  927. package/packages/kmd_client/src/core/api-error.js.map +1 -0
  928. package/packages/kmd_client/src/core/api-error.mjs +16 -0
  929. package/packages/kmd_client/src/core/api-error.mjs.map +1 -0
  930. package/packages/kmd_client/src/core/base-http-request.d.ts +25 -0
  931. package/packages/kmd_client/src/core/base-http-request.js +16 -0
  932. package/packages/kmd_client/src/core/base-http-request.js.map +1 -0
  933. package/packages/kmd_client/src/core/base-http-request.mjs +14 -0
  934. package/packages/kmd_client/src/core/base-http-request.mjs.map +1 -0
  935. package/packages/kmd_client/src/core/client-config.d.ts +17 -0
  936. package/packages/kmd_client/src/core/fetch-http-request.d.ts +10 -0
  937. package/packages/kmd_client/src/core/fetch-http-request.js +85 -0
  938. package/packages/kmd_client/src/core/fetch-http-request.js.map +1 -0
  939. package/packages/kmd_client/src/core/fetch-http-request.mjs +85 -0
  940. package/packages/kmd_client/src/core/fetch-http-request.mjs.map +1 -0
  941. package/packages/kmd_client/src/core/model-runtime.d.ts +10 -0
  942. package/packages/kmd_client/src/core/model-runtime.js +25 -0
  943. package/packages/kmd_client/src/core/model-runtime.js.map +1 -0
  944. package/packages/kmd_client/src/core/model-runtime.mjs +22 -0
  945. package/packages/kmd_client/src/core/model-runtime.mjs.map +1 -0
  946. package/packages/kmd_client/src/core/request.js +62 -0
  947. package/packages/kmd_client/src/core/request.js.map +1 -0
  948. package/packages/kmd_client/src/core/request.mjs +62 -0
  949. package/packages/kmd_client/src/core/request.mjs.map +1 -0
  950. package/packages/kmd_client/src/models/create-wallet-request.d.ts +13 -0
  951. package/packages/kmd_client/src/models/create-wallet-request.js +38 -0
  952. package/packages/kmd_client/src/models/create-wallet-request.js.map +1 -0
  953. package/packages/kmd_client/src/models/create-wallet-request.mjs +38 -0
  954. package/packages/kmd_client/src/models/create-wallet-request.mjs.map +1 -0
  955. package/packages/kmd_client/src/models/create-wallet-response.d.ts +13 -0
  956. package/packages/kmd_client/src/models/create-wallet-response.js +18 -0
  957. package/packages/kmd_client/src/models/create-wallet-response.js.map +1 -0
  958. package/packages/kmd_client/src/models/create-wallet-response.mjs +18 -0
  959. package/packages/kmd_client/src/models/create-wallet-response.mjs.map +1 -0
  960. package/packages/kmd_client/src/models/delete-key-request.d.ts +15 -0
  961. package/packages/kmd_client/src/models/delete-key-request.js +32 -0
  962. package/packages/kmd_client/src/models/delete-key-request.js.map +1 -0
  963. package/packages/kmd_client/src/models/delete-key-request.mjs +32 -0
  964. package/packages/kmd_client/src/models/delete-key-request.mjs.map +1 -0
  965. package/packages/kmd_client/src/models/delete-multisig-request.d.ts +15 -0
  966. package/packages/kmd_client/src/models/delete-multisig-request.js +32 -0
  967. package/packages/kmd_client/src/models/delete-multisig-request.js.map +1 -0
  968. package/packages/kmd_client/src/models/delete-multisig-request.mjs +32 -0
  969. package/packages/kmd_client/src/models/delete-multisig-request.mjs.map +1 -0
  970. package/packages/kmd_client/src/models/export-key-request.d.ts +15 -0
  971. package/packages/kmd_client/src/models/export-key-request.js +32 -0
  972. package/packages/kmd_client/src/models/export-key-request.js.map +1 -0
  973. package/packages/kmd_client/src/models/export-key-request.mjs +32 -0
  974. package/packages/kmd_client/src/models/export-key-request.mjs.map +1 -0
  975. package/packages/kmd_client/src/models/export-key-response.d.ts +10 -0
  976. package/packages/kmd_client/src/models/export-key-response.js +17 -0
  977. package/packages/kmd_client/src/models/export-key-response.js.map +1 -0
  978. package/packages/kmd_client/src/models/export-key-response.mjs +17 -0
  979. package/packages/kmd_client/src/models/export-key-response.mjs.map +1 -0
  980. package/packages/kmd_client/src/models/export-master-key-request.d.ts +11 -0
  981. package/packages/kmd_client/src/models/export-master-key-request.js +22 -0
  982. package/packages/kmd_client/src/models/export-master-key-request.js.map +1 -0
  983. package/packages/kmd_client/src/models/export-master-key-request.mjs +22 -0
  984. package/packages/kmd_client/src/models/export-master-key-request.mjs.map +1 -0
  985. package/packages/kmd_client/src/models/export-master-key-response.d.ts +10 -0
  986. package/packages/kmd_client/src/models/export-master-key-response.js +17 -0
  987. package/packages/kmd_client/src/models/export-master-key-response.js.map +1 -0
  988. package/packages/kmd_client/src/models/export-master-key-response.mjs +17 -0
  989. package/packages/kmd_client/src/models/export-master-key-response.mjs.map +1 -0
  990. package/packages/kmd_client/src/models/export-multisig-request.d.ts +14 -0
  991. package/packages/kmd_client/src/models/export-multisig-request.js +23 -0
  992. package/packages/kmd_client/src/models/export-multisig-request.js.map +1 -0
  993. package/packages/kmd_client/src/models/export-multisig-request.mjs +23 -0
  994. package/packages/kmd_client/src/models/export-multisig-request.mjs.map +1 -0
  995. package/packages/kmd_client/src/models/export-multisig-response.d.ts +12 -0
  996. package/packages/kmd_client/src/models/export-multisig-response.js +32 -0
  997. package/packages/kmd_client/src/models/export-multisig-response.js.map +1 -0
  998. package/packages/kmd_client/src/models/export-multisig-response.mjs +32 -0
  999. package/packages/kmd_client/src/models/export-multisig-response.mjs.map +1 -0
  1000. package/packages/kmd_client/src/models/generate-key-request.d.ts +10 -0
  1001. package/packages/kmd_client/src/models/generate-key-request.js +17 -0
  1002. package/packages/kmd_client/src/models/generate-key-request.js.map +1 -0
  1003. package/packages/kmd_client/src/models/generate-key-request.mjs +17 -0
  1004. package/packages/kmd_client/src/models/generate-key-request.mjs.map +1 -0
  1005. package/packages/kmd_client/src/models/generate-key-response.d.ts +13 -0
  1006. package/packages/kmd_client/src/models/generate-key-response.js +17 -0
  1007. package/packages/kmd_client/src/models/generate-key-response.js.map +1 -0
  1008. package/packages/kmd_client/src/models/generate-key-response.mjs +17 -0
  1009. package/packages/kmd_client/src/models/generate-key-response.mjs.map +1 -0
  1010. package/packages/kmd_client/src/models/import-key-request.d.ts +11 -0
  1011. package/packages/kmd_client/src/models/import-key-request.js +23 -0
  1012. package/packages/kmd_client/src/models/import-key-request.js.map +1 -0
  1013. package/packages/kmd_client/src/models/import-key-request.mjs +23 -0
  1014. package/packages/kmd_client/src/models/import-key-request.mjs.map +1 -0
  1015. package/packages/kmd_client/src/models/import-key-response.d.ts +13 -0
  1016. package/packages/kmd_client/src/models/import-key-response.js +17 -0
  1017. package/packages/kmd_client/src/models/import-key-response.js.map +1 -0
  1018. package/packages/kmd_client/src/models/import-key-response.mjs +17 -0
  1019. package/packages/kmd_client/src/models/import-key-response.mjs.map +1 -0
  1020. package/packages/kmd_client/src/models/import-multisig-request.d.ts +13 -0
  1021. package/packages/kmd_client/src/models/import-multisig-request.js +39 -0
  1022. package/packages/kmd_client/src/models/import-multisig-request.js.map +1 -0
  1023. package/packages/kmd_client/src/models/import-multisig-request.mjs +39 -0
  1024. package/packages/kmd_client/src/models/import-multisig-request.mjs.map +1 -0
  1025. package/packages/kmd_client/src/models/import-multisig-response.d.ts +13 -0
  1026. package/packages/kmd_client/src/models/import-multisig-response.js +17 -0
  1027. package/packages/kmd_client/src/models/import-multisig-response.js.map +1 -0
  1028. package/packages/kmd_client/src/models/import-multisig-response.mjs +17 -0
  1029. package/packages/kmd_client/src/models/import-multisig-response.mjs.map +1 -0
  1030. package/packages/kmd_client/src/models/init-wallet-handle-token-request.d.ts +11 -0
  1031. package/packages/kmd_client/src/models/init-wallet-handle-token-request.js +22 -0
  1032. package/packages/kmd_client/src/models/init-wallet-handle-token-request.js.map +1 -0
  1033. package/packages/kmd_client/src/models/init-wallet-handle-token-request.mjs +22 -0
  1034. package/packages/kmd_client/src/models/init-wallet-handle-token-request.mjs.map +1 -0
  1035. package/packages/kmd_client/src/models/init-wallet-handle-token-response.d.ts +10 -0
  1036. package/packages/kmd_client/src/models/init-wallet-handle-token-response.js +17 -0
  1037. package/packages/kmd_client/src/models/init-wallet-handle-token-response.js.map +1 -0
  1038. package/packages/kmd_client/src/models/init-wallet-handle-token-response.mjs +17 -0
  1039. package/packages/kmd_client/src/models/init-wallet-handle-token-response.mjs.map +1 -0
  1040. package/packages/kmd_client/src/models/list-keys-request.d.ts +10 -0
  1041. package/packages/kmd_client/src/models/list-keys-request.js +17 -0
  1042. package/packages/kmd_client/src/models/list-keys-request.js.map +1 -0
  1043. package/packages/kmd_client/src/models/list-keys-request.mjs +17 -0
  1044. package/packages/kmd_client/src/models/list-keys-request.mjs.map +1 -0
  1045. package/packages/kmd_client/src/models/list-keys-response.d.ts +13 -0
  1046. package/packages/kmd_client/src/models/list-keys-response.js +17 -0
  1047. package/packages/kmd_client/src/models/list-keys-response.js.map +1 -0
  1048. package/packages/kmd_client/src/models/list-keys-response.mjs +17 -0
  1049. package/packages/kmd_client/src/models/list-keys-response.mjs.map +1 -0
  1050. package/packages/kmd_client/src/models/list-multisig-request.d.ts +10 -0
  1051. package/packages/kmd_client/src/models/list-multisig-request.js +17 -0
  1052. package/packages/kmd_client/src/models/list-multisig-request.js.map +1 -0
  1053. package/packages/kmd_client/src/models/list-multisig-request.mjs +17 -0
  1054. package/packages/kmd_client/src/models/list-multisig-request.mjs.map +1 -0
  1055. package/packages/kmd_client/src/models/list-multisig-response.d.ts +13 -0
  1056. package/packages/kmd_client/src/models/list-multisig-response.js +17 -0
  1057. package/packages/kmd_client/src/models/list-multisig-response.js.map +1 -0
  1058. package/packages/kmd_client/src/models/list-multisig-response.mjs +17 -0
  1059. package/packages/kmd_client/src/models/list-multisig-response.mjs.map +1 -0
  1060. package/packages/kmd_client/src/models/list-wallets-response.d.ts +13 -0
  1061. package/packages/kmd_client/src/models/list-wallets-response.js +19 -0
  1062. package/packages/kmd_client/src/models/list-wallets-response.js.map +1 -0
  1063. package/packages/kmd_client/src/models/list-wallets-response.mjs +19 -0
  1064. package/packages/kmd_client/src/models/list-wallets-response.mjs.map +1 -0
  1065. package/packages/kmd_client/src/models/multisig-sig.d.ts +15 -0
  1066. package/packages/kmd_client/src/models/multisig-sig.js +34 -0
  1067. package/packages/kmd_client/src/models/multisig-sig.js.map +1 -0
  1068. package/packages/kmd_client/src/models/multisig-sig.mjs +34 -0
  1069. package/packages/kmd_client/src/models/multisig-sig.mjs.map +1 -0
  1070. package/packages/kmd_client/src/models/multisig-subsig.d.ts +12 -0
  1071. package/packages/kmd_client/src/models/multisig-subsig.js +22 -0
  1072. package/packages/kmd_client/src/models/multisig-subsig.js.map +1 -0
  1073. package/packages/kmd_client/src/models/multisig-subsig.mjs +22 -0
  1074. package/packages/kmd_client/src/models/multisig-subsig.mjs.map +1 -0
  1075. package/packages/kmd_client/src/models/release-wallet-handle-token-request.d.ts +10 -0
  1076. package/packages/kmd_client/src/models/release-wallet-handle-token-request.js +17 -0
  1077. package/packages/kmd_client/src/models/release-wallet-handle-token-request.js.map +1 -0
  1078. package/packages/kmd_client/src/models/release-wallet-handle-token-request.mjs +17 -0
  1079. package/packages/kmd_client/src/models/release-wallet-handle-token-request.mjs.map +1 -0
  1080. package/packages/kmd_client/src/models/rename-wallet-request.d.ts +12 -0
  1081. package/packages/kmd_client/src/models/rename-wallet-request.js +31 -0
  1082. package/packages/kmd_client/src/models/rename-wallet-request.js.map +1 -0
  1083. package/packages/kmd_client/src/models/rename-wallet-request.mjs +31 -0
  1084. package/packages/kmd_client/src/models/rename-wallet-request.mjs.map +1 -0
  1085. package/packages/kmd_client/src/models/rename-wallet-response.d.ts +13 -0
  1086. package/packages/kmd_client/src/models/rename-wallet-response.js +18 -0
  1087. package/packages/kmd_client/src/models/rename-wallet-response.js.map +1 -0
  1088. package/packages/kmd_client/src/models/rename-wallet-response.mjs +18 -0
  1089. package/packages/kmd_client/src/models/rename-wallet-response.mjs.map +1 -0
  1090. package/packages/kmd_client/src/models/renew-wallet-handle-token-request.d.ts +10 -0
  1091. package/packages/kmd_client/src/models/renew-wallet-handle-token-request.js +17 -0
  1092. package/packages/kmd_client/src/models/renew-wallet-handle-token-request.js.map +1 -0
  1093. package/packages/kmd_client/src/models/renew-wallet-handle-token-request.mjs +17 -0
  1094. package/packages/kmd_client/src/models/renew-wallet-handle-token-request.mjs.map +1 -0
  1095. package/packages/kmd_client/src/models/renew-wallet-handle-token-response.d.ts +13 -0
  1096. package/packages/kmd_client/src/models/renew-wallet-handle-token-response.js +18 -0
  1097. package/packages/kmd_client/src/models/renew-wallet-handle-token-response.js.map +1 -0
  1098. package/packages/kmd_client/src/models/renew-wallet-handle-token-response.mjs +18 -0
  1099. package/packages/kmd_client/src/models/renew-wallet-handle-token-response.mjs.map +1 -0
  1100. package/packages/kmd_client/src/models/sign-multisig-request.d.ts +11 -0
  1101. package/packages/kmd_client/src/models/sign-multisig-response.d.ts +10 -0
  1102. package/packages/kmd_client/src/models/sign-multisig-response.js +17 -0
  1103. package/packages/kmd_client/src/models/sign-multisig-response.js.map +1 -0
  1104. package/packages/kmd_client/src/models/sign-multisig-response.mjs +17 -0
  1105. package/packages/kmd_client/src/models/sign-multisig-response.mjs.map +1 -0
  1106. package/packages/kmd_client/src/models/sign-multisig-txn-request.d.ts +18 -0
  1107. package/packages/kmd_client/src/models/sign-multisig-txn-request.js +52 -0
  1108. package/packages/kmd_client/src/models/sign-multisig-txn-request.js.map +1 -0
  1109. package/packages/kmd_client/src/models/sign-multisig-txn-request.mjs +52 -0
  1110. package/packages/kmd_client/src/models/sign-multisig-txn-request.mjs.map +1 -0
  1111. package/packages/kmd_client/src/models/sign-program-multisig-request.d.ts +20 -0
  1112. package/packages/kmd_client/src/models/sign-program-multisig-request.js +60 -0
  1113. package/packages/kmd_client/src/models/sign-program-multisig-request.js.map +1 -0
  1114. package/packages/kmd_client/src/models/sign-program-multisig-request.mjs +60 -0
  1115. package/packages/kmd_client/src/models/sign-program-multisig-request.mjs.map +1 -0
  1116. package/packages/kmd_client/src/models/sign-program-multisig-response.d.ts +10 -0
  1117. package/packages/kmd_client/src/models/sign-program-multisig-response.js +17 -0
  1118. package/packages/kmd_client/src/models/sign-program-multisig-response.js.map +1 -0
  1119. package/packages/kmd_client/src/models/sign-program-multisig-response.mjs +17 -0
  1120. package/packages/kmd_client/src/models/sign-program-multisig-response.mjs.map +1 -0
  1121. package/packages/kmd_client/src/models/sign-program-request.d.ts +16 -0
  1122. package/packages/kmd_client/src/models/sign-program-request.js +39 -0
  1123. package/packages/kmd_client/src/models/sign-program-request.js.map +1 -0
  1124. package/packages/kmd_client/src/models/sign-program-request.mjs +39 -0
  1125. package/packages/kmd_client/src/models/sign-program-request.mjs.map +1 -0
  1126. package/packages/kmd_client/src/models/sign-program-response.d.ts +10 -0
  1127. package/packages/kmd_client/src/models/sign-program-response.js +17 -0
  1128. package/packages/kmd_client/src/models/sign-program-response.js.map +1 -0
  1129. package/packages/kmd_client/src/models/sign-program-response.mjs +17 -0
  1130. package/packages/kmd_client/src/models/sign-program-response.mjs.map +1 -0
  1131. package/packages/kmd_client/src/models/sign-transaction-request.d.ts +11 -0
  1132. package/packages/kmd_client/src/models/sign-transaction-response.d.ts +10 -0
  1133. package/packages/kmd_client/src/models/sign-transaction-response.js +17 -0
  1134. package/packages/kmd_client/src/models/sign-transaction-response.js.map +1 -0
  1135. package/packages/kmd_client/src/models/sign-transaction-response.mjs +17 -0
  1136. package/packages/kmd_client/src/models/sign-transaction-response.mjs.map +1 -0
  1137. package/packages/kmd_client/src/models/sign-txn-request.d.ts +19 -0
  1138. package/packages/kmd_client/src/models/sign-txn-request.js +38 -0
  1139. package/packages/kmd_client/src/models/sign-txn-request.js.map +1 -0
  1140. package/packages/kmd_client/src/models/sign-txn-request.mjs +38 -0
  1141. package/packages/kmd_client/src/models/sign-txn-request.mjs.map +1 -0
  1142. package/packages/kmd_client/src/models/tx-type.d.ts +8 -0
  1143. package/packages/kmd_client/src/models/tx-type.js +12 -0
  1144. package/packages/kmd_client/src/models/tx-type.js.map +1 -0
  1145. package/packages/kmd_client/src/models/tx-type.mjs +12 -0
  1146. package/packages/kmd_client/src/models/tx-type.mjs.map +1 -0
  1147. package/packages/kmd_client/src/models/versions-response.d.ts +11 -0
  1148. package/packages/kmd_client/src/models/versions-response.js +17 -0
  1149. package/packages/kmd_client/src/models/versions-response.js.map +1 -0
  1150. package/packages/kmd_client/src/models/versions-response.mjs +17 -0
  1151. package/packages/kmd_client/src/models/versions-response.mjs.map +1 -0
  1152. package/packages/kmd_client/src/models/wallet-handle.d.ts +15 -0
  1153. package/packages/kmd_client/src/models/wallet-handle.js +24 -0
  1154. package/packages/kmd_client/src/models/wallet-handle.js.map +1 -0
  1155. package/packages/kmd_client/src/models/wallet-handle.mjs +24 -0
  1156. package/packages/kmd_client/src/models/wallet-handle.mjs.map +1 -0
  1157. package/packages/kmd_client/src/models/wallet-info-request.d.ts +10 -0
  1158. package/packages/kmd_client/src/models/wallet-info-request.js +17 -0
  1159. package/packages/kmd_client/src/models/wallet-info-request.js.map +1 -0
  1160. package/packages/kmd_client/src/models/wallet-info-request.mjs +17 -0
  1161. package/packages/kmd_client/src/models/wallet-info-request.mjs.map +1 -0
  1162. package/packages/kmd_client/src/models/wallet-info-response.d.ts +13 -0
  1163. package/packages/kmd_client/src/models/wallet-info-response.js +18 -0
  1164. package/packages/kmd_client/src/models/wallet-info-response.js.map +1 -0
  1165. package/packages/kmd_client/src/models/wallet-info-response.mjs +18 -0
  1166. package/packages/kmd_client/src/models/wallet-info-response.mjs.map +1 -0
  1167. package/packages/kmd_client/src/models/wallet.d.ts +18 -0
  1168. package/packages/kmd_client/src/models/wallet.js +54 -0
  1169. package/packages/kmd_client/src/models/wallet.js.map +1 -0
  1170. package/packages/kmd_client/src/models/wallet.mjs +54 -0
  1171. package/packages/kmd_client/src/models/wallet.mjs.map +1 -0
  1172. package/packages/sdk/src/convert.d.ts +17 -0
  1173. package/packages/sdk/src/convert.js +28 -0
  1174. package/packages/sdk/src/convert.js.map +1 -0
  1175. package/packages/sdk/src/convert.mjs +25 -0
  1176. package/packages/sdk/src/convert.mjs.map +1 -0
  1177. package/packages/sdk/src/encoding/binarydata.d.ts +34 -0
  1178. package/packages/sdk/src/encoding/binarydata.js +65 -0
  1179. package/packages/sdk/src/encoding/binarydata.js.map +1 -0
  1180. package/packages/sdk/src/encoding/binarydata.mjs +60 -0
  1181. package/packages/sdk/src/encoding/binarydata.mjs.map +1 -0
  1182. package/packages/sdk/src/encoding/encoding.d.ts +237 -0
  1183. package/packages/sdk/src/encoding/encoding.js +302 -0
  1184. package/packages/sdk/src/encoding/encoding.js.map +1 -0
  1185. package/packages/sdk/src/encoding/encoding.mjs +287 -0
  1186. package/packages/sdk/src/encoding/encoding.mjs.map +1 -0
  1187. package/packages/sdk/src/encoding/schema/array.js +35 -0
  1188. package/packages/sdk/src/encoding/schema/array.js.map +1 -0
  1189. package/packages/sdk/src/encoding/schema/array.mjs +35 -0
  1190. package/packages/sdk/src/encoding/schema/array.mjs.map +1 -0
  1191. package/packages/sdk/src/encoding/schema/bytearray.js +49 -0
  1192. package/packages/sdk/src/encoding/schema/bytearray.js.map +1 -0
  1193. package/packages/sdk/src/encoding/schema/bytearray.mjs +49 -0
  1194. package/packages/sdk/src/encoding/schema/bytearray.mjs.map +1 -0
  1195. package/packages/sdk/src/encoding/schema/map.d.ts +58 -0
  1196. package/packages/sdk/src/encoding/schema/map.js +110 -0
  1197. package/packages/sdk/src/encoding/schema/map.js.map +1 -0
  1198. package/packages/sdk/src/encoding/schema/map.mjs +107 -0
  1199. package/packages/sdk/src/encoding/schema/map.mjs.map +1 -0
  1200. package/packages/sdk/src/encoding/schema/optional.js +46 -0
  1201. package/packages/sdk/src/encoding/schema/optional.js.map +1 -0
  1202. package/packages/sdk/src/encoding/schema/optional.mjs +46 -0
  1203. package/packages/sdk/src/encoding/schema/optional.mjs.map +1 -0
  1204. package/packages/sdk/src/encoding/schema/uint64.js +30 -0
  1205. package/packages/sdk/src/encoding/schema/uint64.js.map +1 -0
  1206. package/packages/sdk/src/encoding/schema/uint64.mjs +30 -0
  1207. package/packages/sdk/src/encoding/schema/uint64.mjs.map +1 -0
  1208. package/packages/sdk/src/encoding/uint64.d.ts +34 -0
  1209. package/packages/sdk/src/encoding/uint64.js +34 -0
  1210. package/packages/sdk/src/encoding/uint64.js.map +1 -0
  1211. package/packages/sdk/src/encoding/uint64.mjs +33 -0
  1212. package/packages/sdk/src/encoding/uint64.mjs.map +1 -0
  1213. package/packages/sdk/src/index.d.ts +44 -0
  1214. package/packages/sdk/src/index.js +62 -0
  1215. package/packages/sdk/src/index.js.map +1 -0
  1216. package/packages/sdk/src/index.mjs +58 -0
  1217. package/packages/sdk/src/index.mjs.map +1 -0
  1218. package/packages/sdk/src/logic/sourcemap.d.ts +55 -0
  1219. package/packages/sdk/src/logic/sourcemap.js +88 -0
  1220. package/packages/sdk/src/logic/sourcemap.js.map +1 -0
  1221. package/packages/sdk/src/logic/sourcemap.mjs +86 -0
  1222. package/packages/sdk/src/logic/sourcemap.mjs.map +1 -0
  1223. package/packages/sdk/src/nacl/naclWrappers.js +14 -0
  1224. package/packages/sdk/src/nacl/naclWrappers.js.map +1 -0
  1225. package/packages/sdk/src/nacl/naclWrappers.mjs +11 -0
  1226. package/packages/sdk/src/nacl/naclWrappers.mjs.map +1 -0
  1227. package/packages/sdk/src/types/intDecoding.d.ts +28 -0
  1228. package/packages/sdk/src/types/intDecoding.js +32 -0
  1229. package/packages/sdk/src/types/intDecoding.js.map +1 -0
  1230. package/packages/sdk/src/types/intDecoding.mjs +31 -0
  1231. package/packages/sdk/src/types/intDecoding.mjs.map +1 -0
  1232. package/packages/sdk/src/types/transactions/encoded.d.ts +40 -0
  1233. package/packages/sdk/src/types/transactions/encoded.js +64 -0
  1234. package/packages/sdk/src/types/transactions/encoded.js.map +1 -0
  1235. package/packages/sdk/src/types/transactions/encoded.mjs +59 -0
  1236. package/packages/sdk/src/types/transactions/encoded.mjs.map +1 -0
  1237. package/packages/sdk/src/utils/utils.d.ts +64 -0
  1238. package/packages/sdk/src/utils/utils.js +140 -0
  1239. package/packages/sdk/src/utils/utils.js.map +1 -0
  1240. package/packages/sdk/src/utils/utils.mjs +128 -0
  1241. package/packages/sdk/src/utils/utils.mjs.map +1 -0
  1242. package/packages/transact/src/logicsig.d.ts +47 -0
  1243. package/packages/transact/src/logicsig.js +118 -0
  1244. package/packages/transact/src/logicsig.js.map +1 -0
  1245. package/packages/transact/src/logicsig.mjs +116 -0
  1246. package/packages/transact/src/logicsig.mjs.map +1 -0
  1247. package/packages/transact/src/multisig.d.ts +153 -0
  1248. package/packages/transact/src/multisig.js +388 -0
  1249. package/packages/transact/src/multisig.js.map +1 -0
  1250. package/packages/transact/src/multisig.mjs +368 -0
  1251. package/packages/transact/src/multisig.mjs.map +1 -0
  1252. package/packages/transact/src/signer.d.ts +47 -0
  1253. package/packages/transact/src/signer.js +71 -0
  1254. package/packages/transact/src/signer.js.map +1 -0
  1255. package/packages/transact/src/signer.mjs +70 -0
  1256. package/packages/transact/src/signer.mjs.map +1 -0
  1257. package/packages/transact/src/transactions/app-call.d.ts +209 -0
  1258. package/packages/transact/src/transactions/app-call.js +251 -0
  1259. package/packages/transact/src/transactions/app-call.js.map +1 -0
  1260. package/packages/transact/src/transactions/app-call.mjs +250 -0
  1261. package/packages/transact/src/transactions/app-call.mjs.map +1 -0
  1262. package/packages/transact/src/transactions/asset-config.d.ts +131 -0
  1263. package/packages/transact/src/transactions/asset-config.js +101 -0
  1264. package/packages/transact/src/transactions/asset-config.js.map +1 -0
  1265. package/packages/transact/src/transactions/asset-config.mjs +101 -0
  1266. package/packages/transact/src/transactions/asset-config.mjs.map +1 -0
  1267. package/packages/transact/src/transactions/asset-freeze.d.ts +35 -0
  1268. package/packages/transact/src/transactions/asset-freeze.js +18 -0
  1269. package/packages/transact/src/transactions/asset-freeze.js.map +1 -0
  1270. package/packages/transact/src/transactions/asset-freeze.mjs +18 -0
  1271. package/packages/transact/src/transactions/asset-freeze.mjs.map +1 -0
  1272. package/packages/transact/src/transactions/asset-transfer.d.ts +56 -0
  1273. package/packages/transact/src/transactions/asset-transfer.js +18 -0
  1274. package/packages/transact/src/transactions/asset-transfer.js.map +1 -0
  1275. package/packages/transact/src/transactions/asset-transfer.mjs +18 -0
  1276. package/packages/transact/src/transactions/asset-transfer.mjs.map +1 -0
  1277. package/packages/transact/src/transactions/common.d.ts +37 -0
  1278. package/packages/transact/src/transactions/common.js +24 -0
  1279. package/packages/transact/src/transactions/common.js.map +1 -0
  1280. package/packages/transact/src/transactions/common.mjs +22 -0
  1281. package/packages/transact/src/transactions/common.mjs.map +1 -0
  1282. package/packages/transact/src/transactions/heartbeat.d.ts +37 -0
  1283. package/packages/transact/src/transactions/key-registration.d.ts +45 -0
  1284. package/packages/transact/src/transactions/key-registration.js +54 -0
  1285. package/packages/transact/src/transactions/key-registration.js.map +1 -0
  1286. package/packages/transact/src/transactions/key-registration.mjs +54 -0
  1287. package/packages/transact/src/transactions/key-registration.mjs.map +1 -0
  1288. package/packages/transact/src/transactions/payment.d.ts +32 -0
  1289. package/packages/transact/src/transactions/signed-transaction-meta.d.ts +12 -0
  1290. package/packages/transact/src/transactions/signed-transaction-meta.js +132 -0
  1291. package/packages/transact/src/transactions/signed-transaction-meta.js.map +1 -0
  1292. package/packages/transact/src/transactions/signed-transaction-meta.mjs +129 -0
  1293. package/packages/transact/src/transactions/signed-transaction-meta.mjs.map +1 -0
  1294. package/packages/transact/src/transactions/signed-transaction.d.ts +126 -0
  1295. package/packages/transact/src/transactions/signed-transaction.js +67 -0
  1296. package/packages/transact/src/transactions/signed-transaction.js.map +1 -0
  1297. package/packages/transact/src/transactions/signed-transaction.mjs +64 -0
  1298. package/packages/transact/src/transactions/signed-transaction.mjs.map +1 -0
  1299. package/packages/transact/src/transactions/state-proof.d.ts +64 -0
  1300. package/packages/transact/src/transactions/transaction-meta.d.ts +14 -0
  1301. package/packages/transact/src/transactions/transaction-meta.js +1007 -0
  1302. package/packages/transact/src/transactions/transaction-meta.js.map +1 -0
  1303. package/packages/transact/src/transactions/transaction-meta.mjs +1006 -0
  1304. package/packages/transact/src/transactions/transaction-meta.mjs.map +1 -0
  1305. package/packages/transact/src/transactions/transaction-type.d.ts +47 -0
  1306. package/packages/transact/src/transactions/transaction-type.js +50 -0
  1307. package/packages/transact/src/transactions/transaction-type.js.map +1 -0
  1308. package/packages/transact/src/transactions/transaction-type.mjs +49 -0
  1309. package/packages/transact/src/transactions/transaction-type.mjs.map +1 -0
  1310. package/packages/transact/src/transactions/transaction.d.ts +312 -0
  1311. package/packages/transact/src/transactions/transaction.js +351 -0
  1312. package/packages/transact/src/transactions/transaction.js.map +1 -0
  1313. package/packages/transact/src/transactions/transaction.mjs +337 -0
  1314. package/packages/transact/src/transactions/transaction.mjs.map +1 -0
  1315. package/sdk/index.d.ts +10 -0
  1316. package/sdk/index.js +59 -0
  1317. package/sdk/index.mjs +11 -0
  1318. package/testing/account.d.ts +14 -9
  1319. package/testing/account.js +27 -31
  1320. package/testing/account.js.map +1 -1
  1321. package/testing/account.mjs +27 -29
  1322. package/testing/account.mjs.map +1 -1
  1323. package/testing/fixtures/algokit-log-capture-fixture.d.ts +8 -2
  1324. package/testing/fixtures/algokit-log-capture-fixture.js +35 -39
  1325. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  1326. package/testing/fixtures/algokit-log-capture-fixture.mjs +35 -37
  1327. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  1328. package/testing/fixtures/algorand-fixture.d.ts +11 -5
  1329. package/testing/fixtures/algorand-fixture.js +66 -60
  1330. package/testing/fixtures/algorand-fixture.js.map +1 -1
  1331. package/testing/fixtures/algorand-fixture.mjs +65 -57
  1332. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  1333. package/testing/index.d.ts +7 -5
  1334. package/testing/index.js +13 -18
  1335. package/testing/index.mjs +8 -7
  1336. package/testing/indexer.d.ts +5 -1
  1337. package/testing/indexer.js +27 -35
  1338. package/testing/indexer.js.map +1 -1
  1339. package/testing/indexer.mjs +27 -34
  1340. package/testing/indexer.mjs.map +1 -1
  1341. package/testing/test-logger.d.ts +42 -36
  1342. package/testing/test-logger.js +70 -74
  1343. package/testing/test-logger.js.map +1 -1
  1344. package/testing/test-logger.mjs +70 -72
  1345. package/testing/test-logger.mjs.map +1 -1
  1346. package/testing/transaction-logger.d.ts +33 -28
  1347. package/testing/transaction-logger.js +73 -91
  1348. package/testing/transaction-logger.js.map +1 -1
  1349. package/testing/transaction-logger.mjs +73 -89
  1350. package/testing/transaction-logger.mjs.map +1 -1
  1351. package/transact/index.d.ts +17 -0
  1352. package/transact/index.js +66 -0
  1353. package/transact/index.mjs +15 -0
  1354. package/transaction/perform-transaction-composer-simulate.d.ts +20 -0
  1355. package/transaction/perform-transaction-composer-simulate.js +33 -0
  1356. package/transaction/perform-transaction-composer-simulate.js.map +1 -0
  1357. package/transaction/perform-transaction-composer-simulate.mjs +32 -0
  1358. package/transaction/perform-transaction-composer-simulate.mjs.map +1 -0
  1359. package/transaction/transaction.d.ts +37 -163
  1360. package/transaction/transaction.js +115 -970
  1361. package/transaction/transaction.js.map +1 -1
  1362. package/transaction/transaction.mjs +115 -953
  1363. package/transaction/transaction.mjs.map +1 -1
  1364. package/transactions/app-call.d.ts +78 -0
  1365. package/transactions/app-call.js +333 -0
  1366. package/transactions/app-call.js.map +1 -0
  1367. package/transactions/app-call.mjs +329 -0
  1368. package/transactions/app-call.mjs.map +1 -0
  1369. package/transactions/asset-config.d.ts +177 -0
  1370. package/transactions/asset-config.js +64 -0
  1371. package/transactions/asset-config.js.map +1 -0
  1372. package/transactions/asset-config.mjs +61 -0
  1373. package/transactions/asset-config.mjs.map +1 -0
  1374. package/transactions/asset-transfer.d.ts +44 -0
  1375. package/transactions/asset-transfer.js +50 -0
  1376. package/transactions/asset-transfer.js.map +1 -0
  1377. package/transactions/asset-transfer.mjs +48 -0
  1378. package/transactions/asset-transfer.mjs.map +1 -0
  1379. package/transactions/common.d.ts +48 -0
  1380. package/transactions/common.js +31 -0
  1381. package/transactions/common.js.map +1 -0
  1382. package/transactions/common.mjs +30 -0
  1383. package/transactions/common.mjs.map +1 -0
  1384. package/transactions/fee-coverage.js +115 -0
  1385. package/transactions/fee-coverage.js.map +1 -0
  1386. package/transactions/fee-coverage.mjs +112 -0
  1387. package/transactions/fee-coverage.mjs.map +1 -0
  1388. package/transactions/key-registration.d.ts +27 -0
  1389. package/transactions/key-registration.js +30 -0
  1390. package/transactions/key-registration.js.map +1 -0
  1391. package/transactions/key-registration.mjs +30 -0
  1392. package/transactions/key-registration.mjs.map +1 -0
  1393. package/transactions/method-call.d.ts +45 -0
  1394. package/transactions/method-call.js +326 -0
  1395. package/transactions/method-call.js.map +1 -0
  1396. package/transactions/method-call.mjs +322 -0
  1397. package/transactions/method-call.mjs.map +1 -0
  1398. package/transactions/payment.d.ts +21 -0
  1399. package/transactions/payment.js +21 -0
  1400. package/transactions/payment.js.map +1 -0
  1401. package/transactions/payment.mjs +21 -0
  1402. package/transactions/payment.mjs.map +1 -0
  1403. package/types/account-manager.d.ts +434 -428
  1404. package/types/account-manager.js +606 -600
  1405. package/types/account-manager.js.map +1 -1
  1406. package/types/account-manager.mjs +604 -598
  1407. package/types/account-manager.mjs.map +1 -1
  1408. package/types/account.d.ts +149 -212
  1409. package/types/account.js +6 -90
  1410. package/types/account.js.map +1 -1
  1411. package/types/account.mjs +7 -88
  1412. package/types/account.mjs.map +1 -1
  1413. package/types/algorand-client-transaction-creator.d.ts +1087 -761
  1414. package/types/algorand-client-transaction-creator.js +723 -722
  1415. package/types/algorand-client-transaction-creator.js.map +1 -1
  1416. package/types/algorand-client-transaction-creator.mjs +723 -721
  1417. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  1418. package/types/algorand-client-transaction-sender.d.ts +1298 -1268
  1419. package/types/algorand-client-transaction-sender.js +920 -951
  1420. package/types/algorand-client-transaction-sender.js.map +1 -1
  1421. package/types/algorand-client-transaction-sender.mjs +918 -949
  1422. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  1423. package/types/algorand-client.d.ts +242 -236
  1424. package/types/algorand-client.js +321 -318
  1425. package/types/algorand-client.js.map +1 -1
  1426. package/types/algorand-client.mjs +321 -316
  1427. package/types/algorand-client.mjs.map +1 -1
  1428. package/types/amount.d.ts +47 -43
  1429. package/types/amount.js +62 -68
  1430. package/types/amount.js.map +1 -1
  1431. package/types/amount.mjs +62 -66
  1432. package/types/amount.mjs.map +1 -1
  1433. package/types/app-client.d.ts +2018 -1972
  1434. package/types/app-client.js +900 -1794
  1435. package/types/app-client.js.map +1 -1
  1436. package/types/app-client.mjs +899 -1792
  1437. package/types/app-client.mjs.map +1 -1
  1438. package/types/app-deployer.d.ts +149 -141
  1439. package/types/app-deployer.js +349 -382
  1440. package/types/app-deployer.js.map +1 -1
  1441. package/types/app-deployer.mjs +349 -380
  1442. package/types/app-deployer.mjs.map +1 -1
  1443. package/types/app-factory.d.ts +931 -914
  1444. package/types/app-factory.js +444 -486
  1445. package/types/app-factory.js.map +1 -1
  1446. package/types/app-factory.mjs +444 -484
  1447. package/types/app-factory.mjs.map +1 -1
  1448. package/types/app-manager.d.ts +299 -325
  1449. package/types/app-manager.js +447 -498
  1450. package/types/app-manager.js.map +1 -1
  1451. package/types/app-manager.mjs +448 -496
  1452. package/types/app-manager.mjs.map +1 -1
  1453. package/types/app-spec.d.ts +154 -117
  1454. package/types/app-spec.js +124 -133
  1455. package/types/app-spec.js.map +1 -1
  1456. package/types/app-spec.mjs +124 -131
  1457. package/types/app-spec.mjs.map +1 -1
  1458. package/types/app.d.ts +186 -291
  1459. package/types/app.js +34 -26
  1460. package/types/app.js.map +1 -1
  1461. package/types/app.mjs +32 -25
  1462. package/types/app.mjs.map +1 -1
  1463. package/types/asset-manager.d.ts +206 -199
  1464. package/types/asset-manager.js +162 -172
  1465. package/types/asset-manager.js.map +1 -1
  1466. package/types/asset-manager.mjs +162 -170
  1467. package/types/asset-manager.mjs.map +1 -1
  1468. package/types/async-event-emitter.d.ts +18 -13
  1469. package/types/async-event-emitter.js +35 -47
  1470. package/types/async-event-emitter.js.map +1 -1
  1471. package/types/async-event-emitter.mjs +35 -46
  1472. package/types/async-event-emitter.mjs.map +1 -1
  1473. package/types/client-manager.d.ts +455 -451
  1474. package/types/client-manager.js +612 -596
  1475. package/types/client-manager.js.map +1 -1
  1476. package/types/client-manager.mjs +612 -594
  1477. package/types/client-manager.mjs.map +1 -1
  1478. package/types/composer.d.ts +920 -1312
  1479. package/types/composer.js +1558 -1469
  1480. package/types/composer.js.map +1 -1
  1481. package/types/composer.mjs +1557 -1467
  1482. package/types/composer.mjs.map +1 -1
  1483. package/types/config.d.ts +53 -48
  1484. package/types/config.js +76 -75
  1485. package/types/config.js.map +1 -1
  1486. package/types/config.mjs +76 -73
  1487. package/types/config.mjs.map +1 -1
  1488. package/types/debugging.d.ts +26 -23
  1489. package/types/debugging.js +7 -9
  1490. package/types/debugging.js.map +1 -1
  1491. package/types/debugging.mjs +7 -8
  1492. package/types/debugging.mjs.map +1 -1
  1493. package/types/dispenser-client.d.ts +57 -52
  1494. package/types/dispenser-client.js +122 -139
  1495. package/types/dispenser-client.js.map +1 -1
  1496. package/types/dispenser-client.mjs +122 -137
  1497. package/types/dispenser-client.mjs.map +1 -1
  1498. package/types/expand.d.ts +5 -3
  1499. package/types/expand.js +0 -3
  1500. package/types/expand.mjs +0 -2
  1501. package/types/indexer.d.ts +32 -160
  1502. package/types/indexer.js +34 -29
  1503. package/types/indexer.js.map +1 -1
  1504. package/types/indexer.mjs +30 -28
  1505. package/types/indexer.mjs.map +1 -1
  1506. package/types/instance-of.d.ts +5 -3
  1507. package/types/instance-of.js +0 -3
  1508. package/types/instance-of.mjs +0 -2
  1509. package/types/kmd-account-manager.d.ts +70 -70
  1510. package/types/kmd-account-manager.js +152 -182
  1511. package/types/kmd-account-manager.js.map +1 -1
  1512. package/types/kmd-account-manager.mjs +150 -180
  1513. package/types/kmd-account-manager.mjs.map +1 -1
  1514. package/types/lifecycle-events.d.ts +13 -8
  1515. package/types/lifecycle-events.js +10 -7
  1516. package/types/lifecycle-events.js.map +1 -1
  1517. package/types/lifecycle-events.mjs +8 -6
  1518. package/types/lifecycle-events.mjs.map +1 -1
  1519. package/types/logging.d.ts +11 -13
  1520. package/types/logging.js +28 -29
  1521. package/types/logging.js.map +1 -1
  1522. package/types/logging.mjs +28 -28
  1523. package/types/logging.mjs.map +1 -1
  1524. package/types/logic-error.d.ts +33 -29
  1525. package/types/logic-error.js +48 -47
  1526. package/types/logic-error.js.map +1 -1
  1527. package/types/logic-error.mjs +48 -46
  1528. package/types/logic-error.mjs.map +1 -1
  1529. package/types/network-client.d.ts +32 -27
  1530. package/types/network-client.js +8 -7
  1531. package/types/network-client.js.map +1 -1
  1532. package/types/network-client.mjs +8 -6
  1533. package/types/network-client.mjs.map +1 -1
  1534. package/types/testing.d.ts +138 -132
  1535. package/types/testing.js +0 -3
  1536. package/types/testing.mjs +0 -2
  1537. package/types/transaction.d.ts +108 -123
  1538. package/types/transaction.js +0 -3
  1539. package/types/transaction.mjs +0 -2
  1540. package/util.js +51 -125
  1541. package/util.js.map +1 -1
  1542. package/util.mjs +52 -121
  1543. package/util.mjs.map +1 -1
  1544. package/account/account.d.ts +0 -144
  1545. package/account/account.js +0 -182
  1546. package/account/account.js.map +0 -1
  1547. package/account/account.mjs +0 -172
  1548. package/account/account.mjs.map +0 -1
  1549. package/account/get-account-config-from-environment.d.ts +0 -12
  1550. package/account/get-account-config-from-environment.js +0 -25
  1551. package/account/get-account-config-from-environment.js.map +0 -1
  1552. package/account/get-account-config-from-environment.mjs +0 -23
  1553. package/account/get-account-config-from-environment.mjs.map +0 -1
  1554. package/account/get-account.d.ts +0 -65
  1555. package/account/get-account.js +0 -63
  1556. package/account/get-account.js.map +0 -1
  1557. package/account/get-account.mjs +0 -61
  1558. package/account/get-account.mjs.map +0 -1
  1559. package/account/get-dispenser-account.d.ts +0 -17
  1560. package/account/get-dispenser-account.js +0 -22
  1561. package/account/get-dispenser-account.js.map +0 -1
  1562. package/account/get-dispenser-account.mjs +0 -20
  1563. package/account/get-dispenser-account.mjs.map +0 -1
  1564. package/account/index.d.ts +0 -5
  1565. package/account/mnemonic-account.d.ts +0 -13
  1566. package/account/mnemonic-account.js +0 -21
  1567. package/account/mnemonic-account.js.map +0 -1
  1568. package/account/mnemonic-account.mjs +0 -19
  1569. package/account/mnemonic-account.mjs.map +0 -1
  1570. package/app-client.d.ts +0 -86
  1571. package/app-client.js +0 -98
  1572. package/app-client.js.map +0 -1
  1573. package/app-client.mjs +0 -94
  1574. package/app-client.mjs.map +0 -1
  1575. package/app-deploy.d.ts +0 -120
  1576. package/app-deploy.js +0 -285
  1577. package/app-deploy.js.map +0 -1
  1578. package/app-deploy.mjs +0 -276
  1579. package/app-deploy.mjs.map +0 -1
  1580. package/app.d.ts +0 -205
  1581. package/app.js +0 -349
  1582. package/app.js.map +0 -1
  1583. package/app.mjs +0 -329
  1584. package/app.mjs.map +0 -1
  1585. package/asset.d.ts +0 -74
  1586. package/asset.js +0 -142
  1587. package/asset.js.map +0 -1
  1588. package/asset.mjs +0 -136
  1589. package/asset.mjs.map +0 -1
  1590. package/debugging/debugging.d.ts +0 -8
  1591. package/debugging/debugging.js +0 -15
  1592. package/debugging/debugging.js.map +0 -1
  1593. package/debugging/debugging.mjs +0 -13
  1594. package/debugging/debugging.mjs.map +0 -1
  1595. package/debugging/index.d.ts +0 -1
  1596. package/dispenser-client.d.ts +0 -20
  1597. package/dispenser-client.js +0 -28
  1598. package/dispenser-client.js.map +0 -1
  1599. package/dispenser-client.mjs +0 -26
  1600. package/dispenser-client.mjs.map +0 -1
  1601. package/index.js.map +0 -1
  1602. package/index.mjs.map +0 -1
  1603. package/localnet/get-kmd-wallet-account.d.ts +0 -27
  1604. package/localnet/get-kmd-wallet-account.js +0 -30
  1605. package/localnet/get-kmd-wallet-account.js.map +0 -1
  1606. package/localnet/get-kmd-wallet-account.mjs +0 -28
  1607. package/localnet/get-kmd-wallet-account.mjs.map +0 -1
  1608. package/localnet/get-localnet-dispenser-account.d.ts +0 -13
  1609. package/localnet/get-localnet-dispenser-account.js +0 -19
  1610. package/localnet/get-localnet-dispenser-account.js.map +0 -1
  1611. package/localnet/get-localnet-dispenser-account.mjs +0 -17
  1612. package/localnet/get-localnet-dispenser-account.mjs.map +0 -1
  1613. package/localnet/get-or-create-kmd-wallet-account.d.ts +0 -28
  1614. package/localnet/get-or-create-kmd-wallet-account.js +0 -30
  1615. package/localnet/get-or-create-kmd-wallet-account.js.map +0 -1
  1616. package/localnet/get-or-create-kmd-wallet-account.mjs +0 -28
  1617. package/localnet/get-or-create-kmd-wallet-account.mjs.map +0 -1
  1618. package/localnet/index.d.ts +0 -4
  1619. package/localnet/is-localnet.d.ts +0 -7
  1620. package/localnet/is-localnet.js +0 -14
  1621. package/localnet/is-localnet.js.map +0 -1
  1622. package/localnet/is-localnet.mjs +0 -12
  1623. package/localnet/is-localnet.mjs.map +0 -1
  1624. package/network-client.d.ts +0 -125
  1625. package/network-client.js +0 -156
  1626. package/network-client.js.map +0 -1
  1627. package/network-client.mjs +0 -145
  1628. package/network-client.mjs.map +0 -1
  1629. package/testing/_asset.d.ts +0 -3
  1630. package/testing/fixtures/index.d.ts +0 -2
  1631. package/testing/index.js.map +0 -1
  1632. package/testing/index.mjs.map +0 -1
  1633. package/transaction/index.d.ts +0 -2
  1634. package/transaction/legacy-bridge.d.ts +0 -35
  1635. package/transaction/legacy-bridge.js +0 -129
  1636. package/transaction/legacy-bridge.js.map +0 -1
  1637. package/transaction/legacy-bridge.mjs +0 -124
  1638. package/transaction/legacy-bridge.mjs.map +0 -1
  1639. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +0 -13
  1640. package/transaction/perform-atomic-transaction-composer-simulate.js +0 -40
  1641. package/transaction/perform-atomic-transaction-composer-simulate.js.map +0 -1
  1642. package/transaction/perform-atomic-transaction-composer-simulate.mjs +0 -38
  1643. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +0 -1
  1644. package/transfer/index.d.ts +0 -2
  1645. package/transfer/transfer-algos.d.ts +0 -18
  1646. package/transfer/transfer-algos.js +0 -31
  1647. package/transfer/transfer-algos.js.map +0 -1
  1648. package/transfer/transfer-algos.mjs +0 -29
  1649. package/transfer/transfer-algos.mjs.map +0 -1
  1650. package/transfer/transfer.d.ts +0 -52
  1651. package/transfer/transfer.js +0 -112
  1652. package/transfer/transfer.js.map +0 -1
  1653. package/transfer/transfer.mjs +0 -108
  1654. package/transfer/transfer.mjs.map +0 -1
  1655. package/types/algo-http-client-with-retry.d.ts +0 -12
  1656. package/types/algo-http-client-with-retry.js +0 -94
  1657. package/types/algo-http-client-with-retry.js.map +0 -1
  1658. package/types/algo-http-client-with-retry.mjs +0 -92
  1659. package/types/algo-http-client-with-retry.mjs.map +0 -1
  1660. package/types/app-arc56.d.ts +0 -359
  1661. package/types/app-arc56.js +0 -200
  1662. package/types/app-arc56.js.map +0 -1
  1663. package/types/app-arc56.mjs +0 -191
  1664. package/types/app-arc56.mjs.map +0 -1
  1665. package/types/asset.d.ts +0 -99
  1666. package/types/asset.js +0 -3
  1667. package/types/asset.js.map +0 -1
  1668. package/types/asset.mjs +0 -2
  1669. package/types/asset.mjs.map +0 -1
  1670. package/types/expand.js.map +0 -1
  1671. package/types/expand.mjs.map +0 -1
  1672. package/types/instance-of.js.map +0 -1
  1673. package/types/instance-of.mjs.map +0 -1
  1674. package/types/testing.js.map +0 -1
  1675. package/types/testing.mjs.map +0 -1
  1676. package/types/transaction.js.map +0 -1
  1677. package/types/transaction.mjs.map +0 -1
  1678. package/types/transfer.d.ts +0 -76
  1679. package/types/transfer.js +0 -3
  1680. package/types/transfer.js.map +0 -1
  1681. package/types/transfer.mjs +0 -2
  1682. package/types/transfer.mjs.map +0 -1
  1683. package/util.d.ts +0 -48
@@ -1,1804 +1,910 @@
1
- 'use strict';
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
+ const require_address = require('../packages/common/src/address.js');
3
+ const require_app_call = require('../packages/transact/src/transactions/app-call.js');
4
+ const require_sourcemap = require('../packages/sdk/src/logic/sourcemap.js');
5
+ const require_config = require('../config.js');
6
+ const require_util = require('../util.js');
7
+ const require_abi_method = require('../packages/abi/src/abi-method.js');
8
+ const require_arc56_contract = require('../packages/abi/src/arc56-contract.js');
9
+ const require_lifecycle_events = require('./lifecycle-events.js');
10
+ const require_app_spec = require('./app-spec.js');
11
+ const require_logic_error = require('./logic-error.js');
12
+ let buffer = require("buffer");
13
+ buffer = require_rolldown_runtime.__toESM(buffer);
2
14
 
3
- var algosdk = require('algosdk');
4
- var buffer = require('buffer');
5
- var app = require('../app.js');
6
- var appDeploy = require('../app-deploy.js');
7
- var config = require('../config.js');
8
- var legacyBridge = require('../transaction/legacy-bridge.js');
9
- var transaction = require('../transaction/transaction.js');
10
- var util = require('../util.js');
11
- var types_app = require('./app.js');
12
- var types_appArc56 = require('./app-arc56.js');
13
- var types_appSpec = require('./app-spec.js');
14
- var types_lifecycleEvents = require('./lifecycle-events.js');
15
- var types_logicError = require('./logic-error.js');
16
-
17
- var ABIMethod = algosdk.ABIMethod;
18
- var AtomicTransactionComposer = algosdk.AtomicTransactionComposer;
19
- var getApplicationAddress = algosdk.getApplicationAddress;
20
- var Indexer = algosdk.Indexer;
21
- var OnApplicationComplete = algosdk.OnApplicationComplete;
22
- var SourceMap = algosdk.ProgramSourceMap;
15
+ //#region src/types/app-client.ts
23
16
  /** The maximum opcode budget for a simulate call as per https://github.com/algorand/go-algorand/blob/807b29a91c371d225e12b9287c5d56e9b33c4e4c/ledger/simulation/trace.go#L104 */
24
- const MAX_SIMULATE_OPCODE_BUDGET = 20000 * 16;
25
- /**
26
- * Determines deploy time control (UPDATABLE, DELETABLE) value by inspecting application specification
27
- * @param approval TEAL Approval program, not the base64 version found on the appSpec
28
- * @param appSpec Application Specification
29
- * @param templateVariableName Template variable
30
- * @param callConfigKey Call config type
31
- * @returns true if applicable call config is found, false if not found or undefined if variable not present
32
- */
33
- function getDeployTimeControl(approval, appSpec, templateVariableName, callConfigKey) {
34
- // variable not present, so unknown control value
35
- if (!approval.includes(templateVariableName))
36
- return undefined;
37
- // a bare call for specified CallConfig is present and configured
38
- const bareCallConfig = appSpec.bare_call_config[callConfigKey];
39
- if (!!bareCallConfig && bareCallConfig !== 'NEVER')
40
- return true;
41
- // an ABI call for specified CallConfig is present and configured
42
- return Object.values(appSpec.hints).some((h) => {
43
- const abiCallConfig = h.call_config[callConfigKey];
44
- return !!abiCallConfig && abiCallConfig !== 'NEVER';
45
- });
46
- }
17
+ const MAX_SIMULATE_OPCODE_BUDGET = 2e4 * 16;
47
18
  const BYTE_CBLOCK = 38;
48
19
  const INT_CBLOCK = 32;
49
20
  /**
50
- * Get the offset of the last constant block at the beginning of the program
51
- * This value is used to calculate the program counter for an ARC56 program that has a pcOffsetMethod of "cblocks"
52
- *
53
- * @param program The program to parse
54
- * @returns The PC value of the opcode after the last constant block
55
- */
21
+ * Get the offset of the last constant block at the beginning of the program
22
+ * This value is used to calculate the program counter for an ARC56 program that has a pcOffsetMethod of "cblocks"
23
+ *
24
+ * @param program The program to parse
25
+ * @returns The PC value of the opcode after the last constant block
26
+ */
56
27
  function getConstantBlockOffset(program) {
57
- const bytes = [...program];
58
- const programSize = bytes.length;
59
- bytes.shift(); // remove version
60
- /** The PC of the opcode after the bytecblock */
61
- let bytecblockOffset;
62
- /** The PC of the opcode after the intcblock */
63
- let intcblockOffset;
64
- while (bytes.length > 0) {
65
- /** The current byte from the beginning of the byte array */
66
- const byte = bytes.shift();
67
- // If the byte is a constant block...
68
- if (byte === BYTE_CBLOCK || byte === INT_CBLOCK) {
69
- const isBytecblock = byte === BYTE_CBLOCK;
70
- /** The byte following the opcode is the number of values in the constant block */
71
- const valuesRemaining = bytes.shift();
72
- // Iterate over all the values in the constant block
73
- for (let i = 0; i < valuesRemaining; i++) {
74
- if (isBytecblock) {
75
- /** The byte following the opcode is the length of the next element */
76
- const length = bytes.shift();
77
- bytes.splice(0, length);
78
- }
79
- else {
80
- // intcblock is a uvarint, so we need to keep reading until we find the end (MSB is not set)
81
- while ((bytes.shift() & 0x80) !== 0) {
82
- // Do nothing...
83
- }
84
- }
85
- }
86
- if (isBytecblock)
87
- bytecblockOffset = programSize - bytes.length - 1;
88
- else
89
- intcblockOffset = programSize - bytes.length - 1;
90
- if (bytes[0] !== BYTE_CBLOCK && bytes[0] !== INT_CBLOCK) {
91
- // if the next opcode isn't a constant block, we're done
92
- break;
93
- }
94
- }
95
- }
96
- return Math.max(bytecblockOffset ?? 0, intcblockOffset ?? 0);
28
+ const bytes = [...program];
29
+ const programSize = bytes.length;
30
+ bytes.shift();
31
+ /** The PC of the opcode after the bytecblock */
32
+ let bytecblockOffset;
33
+ /** The PC of the opcode after the intcblock */
34
+ let intcblockOffset;
35
+ while (bytes.length > 0) {
36
+ /** The current byte from the beginning of the byte array */
37
+ const byte = bytes.shift();
38
+ if (byte === BYTE_CBLOCK || byte === INT_CBLOCK) {
39
+ const isBytecblock = byte === BYTE_CBLOCK;
40
+ /** The byte following the opcode is the number of values in the constant block */
41
+ const valuesRemaining = bytes.shift();
42
+ for (let i = 0; i < valuesRemaining; i++) if (isBytecblock) {
43
+ /** The byte following the opcode is the length of the next element */
44
+ const length = bytes.shift();
45
+ bytes.splice(0, length);
46
+ } else while ((bytes.shift() & 128) !== 0);
47
+ if (isBytecblock) bytecblockOffset = programSize - bytes.length - 1;
48
+ else intcblockOffset = programSize - bytes.length - 1;
49
+ if (bytes[0] !== BYTE_CBLOCK && bytes[0] !== INT_CBLOCK) break;
50
+ }
51
+ }
52
+ return Math.max(bytecblockOffset ?? 0, intcblockOffset ?? 0);
97
53
  }
98
54
  /** ARC-56/ARC-32 application client that allows you to manage calls and
99
- * state for a specific deployed instance of an app (with a known app ID). */
100
- class AppClient {
101
- /**
102
- * Create a new app client.
103
- * @param params The parameters to create the app client
104
- * @returns The `AppClient` instance
105
- * @example
106
- * ```typescript
107
- * const appClient = new AppClient({
108
- * appId: 12345678n,
109
- * appSpec: appSpec,
110
- * algorand: AlgorandClient.mainNet(),
111
- * })
112
- */
113
- constructor(params) {
114
- /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */
115
- this.handleCallErrors = async (e) => {
116
- // We can't use the app ID in an error to identify new apps, so instead we check the programs
117
- // to identify if this is the correct app
118
- if (this.appId === 0n) {
119
- if (e.sentTransactions === undefined)
120
- return e;
121
- const txns = e.sentTransactions;
122
- const txn = txns.find((t) => e.message.includes(t.txID()));
123
- const programsDefinedAndEqual = (a, b) => {
124
- if (a === undefined || b === undefined)
125
- return false;
126
- if (a.length !== b.length)
127
- return false;
128
- for (let i = 0; i < a.length; i++) {
129
- if (a[i] !== b[i])
130
- return false;
131
- }
132
- return true;
133
- };
134
- if (!programsDefinedAndEqual(txn?.applicationCall?.clearProgram, this._lastCompiled.clear) ||
135
- !programsDefinedAndEqual(txn?.applicationCall?.approvalProgram, this._lastCompiled?.approval)) {
136
- return e;
137
- }
138
- }
139
- else {
140
- // Only handle errors for this app.
141
- const appIdString = `app=${this._appId.toString()}`;
142
- if (!e.message.includes(appIdString))
143
- return e;
144
- }
145
- const logicError = await this.exposeLogicError(e);
146
- if (logicError instanceof types_logicError.LogicError) {
147
- let currentLine = logicError.teal_line - logicError.lines - 1;
148
- const stackWithLines = logicError.stack
149
- ?.split('\n')
150
- .map((line) => `${(currentLine += 1)}: ${line}`)
151
- .join('\n');
152
- config.Config.logger.error(`${logicError.message}\n\n${stackWithLines}`);
153
- }
154
- return logicError;
155
- };
156
- this._appId = params.appId;
157
- this._appAddress = algosdk.getApplicationAddress(this._appId);
158
- this._appSpec = AppClient.normaliseAppSpec(params.appSpec);
159
- this._appName = params.appName ?? this._appSpec.name;
160
- this._algorand = params.algorand;
161
- this._algorand.registerErrorTransformer(this.handleCallErrors);
162
- this._defaultSender = typeof params.defaultSender === 'string' ? algosdk.Address.fromString(params.defaultSender) : params.defaultSender;
163
- this._defaultSigner = params.defaultSigner;
164
- this._lastCompiled = {};
165
- this._approvalSourceMap = params.approvalSourceMap;
166
- this._clearSourceMap = params.clearSourceMap;
167
- this._localStateMethods = (address) => this.getStateMethods(() => this.getLocalState(address), () => this._appSpec.state.keys.local, () => this._appSpec.state.maps.local);
168
- this._globalStateMethods = this.getStateMethods(() => this.getGlobalState(), () => this._appSpec.state.keys.global, () => this._appSpec.state.maps.global);
169
- this._boxStateMethods = this.getBoxMethods();
170
- this._paramsMethods = {
171
- ...this.getMethodCallParamsMethods(),
172
- /** Get parameters to define bare (raw) transactions to the current app */
173
- bare: this.getBareParamsMethods(),
174
- };
175
- this._createTransactionsMethods = {
176
- ...this.getMethodCallCreateTransactionMethods(),
177
- /** Get transactions for bare (raw) calls to the current app */
178
- bare: this.getBareCreateTransactionMethods(),
179
- };
180
- this._sendMethods = {
181
- ...this.getMethodCallSendMethods(),
182
- /** Send bare (raw) transactions to the current app */
183
- bare: this.getBareSendMethods(),
184
- };
185
- }
186
- /**
187
- * Clone this app client with different params
188
- *
189
- * @param params The params to use for the the cloned app client. Omit a param to keep the original value. Set a param to override the original value. Setting to undefined will clear the original value.
190
- * @returns A new app client with the altered params
191
- * @example
192
- * ```typescript
193
- * const appClient2 = appClient.clone({ defaultSender: 'NEW_SENDER_ADDRESS' })
194
- * ```
195
- */
196
- clone(params) {
197
- return new AppClient({
198
- appId: this._appId,
199
- appSpec: this._appSpec,
200
- algorand: this._algorand,
201
- appName: this._appName,
202
- defaultSender: this._defaultSender,
203
- defaultSigner: this._defaultSigner,
204
- approvalSourceMap: this._approvalSourceMap,
205
- clearSourceMap: this._clearSourceMap,
206
- ...params,
207
- });
208
- }
209
- /**
210
- * Returns a new `AppClient` client, resolving the app by creator address and name
211
- * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
212
- * @param params The parameters to create the app client
213
- * @returns The `AppClient` instance
214
- * @example
215
- * ```typescript
216
- * const appClient = await AppClient.fromCreatorAndName({
217
- * creatorAddress: 'CREATOR_ADDRESS',
218
- * name: 'APP_NAME',
219
- * appSpec: appSpec,
220
- * algorand: AlgorandClient.mainNet(),
221
- * })
222
- */
223
- static async fromCreatorAndName(params) {
224
- const appSpec = AppClient.normaliseAppSpec(params.appSpec);
225
- const appLookup = params.appLookupCache ?? (await params.algorand.appDeployer.getCreatorAppsByName(params.creatorAddress, params.ignoreCache));
226
- const appMetadata = appLookup.apps[params.appName ?? appSpec.name];
227
- if (!appMetadata) {
228
- throw new Error(`App not found for creator ${params.creatorAddress} and name ${params.appName ?? appSpec.name}`);
229
- }
230
- return new AppClient({
231
- ...params,
232
- algorand: params.algorand,
233
- appId: appMetadata.appId,
234
- });
235
- }
236
- /**
237
- * Returns an `AppClient` instance for the current network based on
238
- * pre-determined network-specific app IDs specified in the ARC-56 app spec.
239
- *
240
- * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
241
- * @param params The parameters to create the app client
242
- * @returns The `AppClient` instance
243
- * @example
244
- * ```typescript
245
- * const appClient = await AppClient.fromNetwork({
246
- * appSpec: appSpec,
247
- * algorand: AlgorandClient.mainNet(),
248
- * })
249
- */
250
- static async fromNetwork(params) {
251
- const network = await params.algorand.client.network();
252
- const appSpec = AppClient.normaliseAppSpec(params.appSpec);
253
- const networkNames = [network.genesisHash];
254
- if (network.isLocalNet)
255
- networkNames.push('localnet');
256
- if (network.isTestNet)
257
- networkNames.push('testnet');
258
- if (network.isMainNet)
259
- networkNames.push('mainnet');
260
- const availableAppSpecNetworks = Object.keys(appSpec.networks ?? {});
261
- const networkIndex = availableAppSpecNetworks.findIndex((n) => networkNames.includes(n));
262
- if (networkIndex === -1) {
263
- throw new Error(`No app ID found for network ${util.asJson(networkNames)} in the app spec`);
264
- }
265
- const appId = BigInt(appSpec.networks[networkIndex].appID);
266
- return new AppClient({ ...params, appId, appSpec });
267
- }
268
- /**
269
- * Takes a string or parsed JSON object that could be ARC-32 or ARC-56 format and
270
- * normalises it into a parsed ARC-56 contract object.
271
- * @param spec The spec to normalise
272
- * @returns The normalised ARC-56 contract object
273
- * @example
274
- * ```typescript
275
- * const arc56AppSpec = AppClient.normaliseAppSpec(appSpec)
276
- * ```
277
- */
278
- static normaliseAppSpec(spec) {
279
- const parsedSpec = typeof spec === 'string' ? JSON.parse(spec) : spec;
280
- const appSpec = 'hints' in parsedSpec ? types_appSpec.arc32ToArc56(parsedSpec) : parsedSpec;
281
- return appSpec;
282
- }
283
- /** The ID of the app instance this client is linked to. */
284
- get appId() {
285
- return this._appId;
286
- }
287
- /** The app address of the app instance this client is linked to. */
288
- get appAddress() {
289
- return this._appAddress;
290
- }
291
- /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */
292
- get appName() {
293
- return this._appName;
294
- }
295
- /** The ARC-56 app spec being used */
296
- get appSpec() {
297
- return this._appSpec;
298
- }
299
- /** A reference to the underlying `AlgorandClient` this app client is using. */
300
- get algorand() {
301
- return this._algorand;
302
- }
303
- /** Get parameters to create transactions for the current app.
304
- *
305
- * A good mental model for this is that these parameters represent a deferred transaction creation.
306
- * @example Create a transaction in the future using Algorand Client
307
- * ```typescript
308
- * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})
309
- * // ...
310
- * await algorand.send.AppMethodCall(myMethodCall)
311
- * ```
312
- * @example Define a nested transaction as an ABI argument
313
- * ```typescript
314
- * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})
315
- * await appClient.send.call({method: 'my_method2', args: [myMethodCall]})
316
- * ```
317
- */
318
- get params() {
319
- return this._paramsMethods;
320
- }
321
- /** Create transactions for the current app */
322
- get createTransaction() {
323
- return this._createTransactionsMethods;
324
- }
325
- /** Send transactions to the current app */
326
- get send() {
327
- return this._sendMethods;
328
- }
329
- /** Get state (local, global, box) from the current app */
330
- get state() {
331
- return {
332
- /**
333
- * Methods to access local state for the current app
334
- * @param address The address of the account to get the local state for
335
- */
336
- local: this._localStateMethods,
337
- /**
338
- * Methods to access global state for the current app
339
- */
340
- global: this._globalStateMethods,
341
- /**
342
- * Methods to access box storage for the current app
343
- */
344
- box: this._boxStateMethods,
345
- };
346
- }
347
- /**
348
- * Funds Algo into the app account for this app.
349
- *
350
- * An alias for `appClient.send.fundAppAccount(params)`.
351
- * @param params The parameters for the funding transaction
352
- * @returns The result of the funding
353
- * @example
354
- * ```typescript
355
- * await appClient.fundAppAccount({ amount: algo(1) })
356
- * ```
357
- */
358
- async fundAppAccount(params) {
359
- return this.send.fundAppAccount(params);
360
- }
361
- /**
362
- * Returns raw global state for the current app.
363
- * @returns The global state
364
- * @example
365
- * ```typescript
366
- * const globalState = await appClient.getGlobalState()
367
- * ```
368
- */
369
- async getGlobalState() {
370
- return await this._algorand.app.getGlobalState(this.appId);
371
- }
372
- /**
373
- * Returns raw local state for the given account address.
374
- * @param address The address of the account to get the local state for
375
- * @returns The local state
376
- * @example
377
- * ```typescript
378
- * const localState = await appClient.getLocalState('ACCOUNT_ADDRESS')
379
- * ```
380
- */
381
- async getLocalState(address) {
382
- return await this._algorand.app.getLocalState(this.appId, address);
383
- }
384
- /**
385
- * Returns the names of all current boxes for the current app.
386
- * @returns The names of the boxes
387
- * @example
388
- * ```typescript
389
- * const boxNames = await appClient.getBoxNames()
390
- * ```
391
- */
392
- async getBoxNames() {
393
- return await this._algorand.app.getBoxNames(this.appId);
394
- }
395
- /**
396
- * Returns the value of the given box for the current app.
397
- * @param name The identifier of the box to return
398
- * @returns The current box value as a byte array
399
- * @example
400
- * ```typescript
401
- * const boxValue = await appClient.getBoxValue('boxName')
402
- * ```
403
- */
404
- async getBoxValue(name) {
405
- return await this._algorand.app.getBoxValue(this.appId, name);
406
- }
407
- /**
408
- * Returns the value of the given box for the current app.
409
- * @param name The identifier of the box to return
410
- * @param type
411
- * @returns The current box value as a byte array
412
- * @example
413
- * ```typescript
414
- * const boxValue = await appClient.getBoxValueFromABIType('boxName', new ABIUintType(32))
415
- * ```
416
- */
417
- async getBoxValueFromABIType(name, type) {
418
- return await this._algorand.app.getBoxValueFromABIType({
419
- appId: this.appId,
420
- boxName: name,
421
- type,
422
- });
423
- }
424
- /**
425
- * Returns the values of all current boxes for the current app.
426
- * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
427
- * @param filter Optional filter to filter which boxes' values are returned
428
- * @returns The (name, value) pair of the boxes with values as raw byte arrays
429
- * @example
430
- * ```typescript
431
- * const boxValues = await appClient.getBoxValues()
432
- * ```
433
- */
434
- async getBoxValues(filter) {
435
- const names = (await this.getBoxNames()).filter(filter ?? ((_) => true));
436
- const values = await this._algorand.app.getBoxValues(this.appId, names.map((name) => name.nameRaw));
437
- return names.map((name, i) => ({ name, value: values[i] }));
438
- }
439
- /**
440
- * Returns the values of all current boxes for the current app decoded using an ABI Type.
441
- * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
442
- * @param type The ABI type to decode the values with
443
- * @param filter Optional filter to filter which boxes' values are returned
444
- * @returns The (name, value) pair of the boxes with values as the ABI Value
445
- * @example
446
- * ```typescript
447
- * const boxValues = await appClient.getBoxValuesFromABIType(new ABIUintType(32))
448
- * ```
449
- */
450
- async getBoxValuesFromABIType(type, filter) {
451
- const names = (await this.getBoxNames()).filter(filter ?? ((_) => true));
452
- const values = await this._algorand.app.getBoxValuesFromABIType({
453
- appId: this.appId,
454
- boxNames: names.map((name) => name.nameRaw),
455
- type,
456
- });
457
- return names.map((name, i) => ({ name, value: values[i] }));
458
- }
459
- /**
460
- * Takes an error that may include a logic error from a call to the current app and re-exposes the
461
- * error to include source code information via the source map and ARC-56 spec.
462
- * @param e The error to parse
463
- * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program)
464
- * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
465
- */
466
- async exposeLogicError(e, isClearStateProgram) {
467
- const pcOffsetMethod = this._appSpec.sourceInfo?.[isClearStateProgram ? 'clear' : 'approval']?.pcOffsetMethod;
468
- let program;
469
- if (pcOffsetMethod === 'cblocks') {
470
- // TODO: Cache this if we deploy the app and it's not updateable
471
- const appInfo = await this._algorand.app.getById(this.appId);
472
- program = isClearStateProgram ? appInfo.clearStateProgram : appInfo.approvalProgram;
473
- }
474
- return AppClient.exposeLogicError(e, this._appSpec, {
475
- isClearStateProgram,
476
- approvalSourceMap: this._approvalSourceMap,
477
- clearSourceMap: this._clearSourceMap,
478
- program,
479
- });
480
- }
481
- /**
482
- * Export the current source maps for the app.
483
- * @returns The source maps
484
- */
485
- exportSourceMaps() {
486
- if (!this._approvalSourceMap || !this._clearSourceMap) {
487
- throw new Error("Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first");
488
- }
489
- return {
490
- approvalSourceMap: this._approvalSourceMap,
491
- clearSourceMap: this._clearSourceMap,
492
- };
493
- }
494
- /**
495
- * Import source maps for the app.
496
- * @param sourceMaps The source maps to import
497
- */
498
- importSourceMaps(sourceMaps) {
499
- this._approvalSourceMap = new SourceMap(sourceMaps.approvalSourceMap);
500
- this._clearSourceMap = new SourceMap(sourceMaps.clearSourceMap);
501
- }
502
- /**
503
- * Returns the ABI Method spec for the given method string for the app represented by this application client instance
504
- * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
505
- * e.g. `my_method` or `my_method(unit64,string)bytes`
506
- * @returns A tuple with: [ARC-56 `Method`, algosdk `ABIMethod`]
507
- */
508
- getABIMethod(methodNameOrSignature) {
509
- return types_appArc56.getArc56Method(methodNameOrSignature, this._appSpec);
510
- }
511
- /**
512
- * Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type
513
- * on the ARC-56 method, replacing the `return` property with the decoded type.
514
- *
515
- * If the return type is an ARC-56 struct then the struct will be returned.
516
- *
517
- * @param result The SendAppTransactionResult to be mapped
518
- * @param method The method that was called
519
- * @returns The smart contract response with an updated return value
520
- */
521
- async processMethodCallReturn(result, method) {
522
- const resultValue = await result;
523
- return { ...resultValue, return: types_appArc56.getArc56ReturnValue(resultValue.return, method, this._appSpec.structs) };
524
- }
525
- /**
526
- * Compiles the approval and clear state programs (if TEAL templates provided),
527
- * performing any provided deploy-time parameter replacement and stores
528
- * the source maps.
529
- *
530
- * If no TEAL templates provided it will use any byte code provided in the app spec.
531
- *
532
- * Will store any generated source maps for later use in debugging.
533
- * @param compilation Any compilation parameters to use
534
- * @returns The compiled code and any compilation results (including source maps)
535
- */
536
- async compile(compilation) {
537
- const result = await AppClient.compile(this._appSpec, this._algorand.app, compilation);
538
- if (result.compiledApproval) {
539
- this._approvalSourceMap = result.compiledApproval.sourceMap;
540
- this._lastCompiled.approval = result.compiledApproval.compiledBase64ToBytes;
541
- }
542
- if (result.compiledClear) {
543
- this._clearSourceMap = result.compiledClear.sourceMap;
544
- this._lastCompiled.clear = result.compiledClear.compiledBase64ToBytes;
545
- }
546
- return result;
547
- }
548
- /**
549
- * Takes an error that may include a logic error from a call to the current app and re-exposes the
550
- * error to include source code information via the source map and ARC-56 spec.
551
- * @param e The error to parse
552
- * @param appSpec The app spec for the app
553
- * @param details Additional information to inform the error
554
- * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
555
- */
556
- static exposeLogicError(e, appSpec, details) {
557
- const { isClearStateProgram, approvalSourceMap, clearSourceMap, program } = details;
558
- const sourceMap = isClearStateProgram ? clearSourceMap : approvalSourceMap;
559
- const errorDetails = types_logicError.LogicError.parseLogicError(e);
560
- // Return the error if we don't have a PC
561
- if (errorDetails === undefined || errorDetails?.pc === undefined)
562
- return e;
563
- /** The PC value to find in the ARC56 SourceInfo */
564
- let arc56Pc = errorDetails?.pc;
565
- const programSourceInfo = isClearStateProgram ? appSpec.sourceInfo?.clear : appSpec.sourceInfo?.approval;
566
- /** The offset to apply to the PC if using the cblocks pc offset method */
567
- let cblocksOffset = 0;
568
- // If the program uses cblocks offset, then we need to adjust the PC accordingly
569
- if (programSourceInfo?.pcOffsetMethod === 'cblocks') {
570
- if (program === undefined)
571
- throw new Error('Program bytes are required to calculate the ARC56 cblocks PC offset');
572
- cblocksOffset = getConstantBlockOffset(program);
573
- arc56Pc = errorDetails.pc - cblocksOffset;
574
- }
575
- // Find the source info for this PC and get the error message
576
- const sourceInfo = programSourceInfo?.sourceInfo.find((s) => s.pc.includes(arc56Pc));
577
- const errorMessage = sourceInfo?.errorMessage;
578
- // If we have the source we can display the TEAL in the error message
579
- if (appSpec.source) {
580
- let getLineForPc = (inputPc) => sourceMap?.getLocationForPc?.(inputPc)?.line;
581
- // If the SourceMap is not defined, we need to provide our own function for going from a PC to TEAL based on ARC56 SourceInfo[]
582
- if (sourceMap === undefined) {
583
- getLineForPc = (inputPc) => {
584
- const teal = programSourceInfo?.sourceInfo.find((s) => s.pc.includes(inputPc - cblocksOffset))?.teal;
585
- if (teal === undefined)
586
- return undefined;
587
- return teal - 1;
588
- };
589
- }
590
- e = new types_logicError.LogicError(errorDetails, buffer.Buffer.from(isClearStateProgram ? appSpec.source.clear : appSpec.source.approval, 'base64')
591
- .toString()
592
- .split('\n'), getLineForPc);
593
- }
594
- if (errorMessage) {
595
- const appId = util.asJson(e).match(/(?<=app=)\d+/)?.[0] || '';
596
- const txId = util.asJson(e).match(/(?<=transaction )\S+(?=:)/)?.[0];
597
- const error = new Error(`Runtime error when executing ${appSpec.name} (appId: ${appId}) in transaction ${txId}: ${errorMessage}`);
598
- error.cause = e;
599
- return error;
600
- }
601
- return e;
602
- }
603
- /**
604
- * Compiles the approval and clear state programs (if TEAL templates provided),
605
- * performing any provided deploy-time parameter replacement and returns
606
- * the compiled code and any compilation results (including source maps).
607
- *
608
- * If no TEAL templates provided it will use any byte code provided in the app spec.
609
- *
610
- * Will store any generated source maps for later use in debugging.
611
- * @param appSpec The app spec for the app
612
- * @param appManager The app manager to use for compilation
613
- * @param compilation Any compilation parameters to use
614
- * @returns The compiled code and any compilation results (including source maps)
615
- */
616
- static async compile(appSpec, appManager, compilation) {
617
- const { deployTimeParams, updatable, deletable } = compilation ?? {};
618
- if (!appSpec.source) {
619
- if (!appSpec.byteCode?.approval || !appSpec.byteCode?.clear) {
620
- throw new Error(`Attempt to compile app ${appSpec.name} without source or byteCode`);
621
- }
622
- return {
623
- approvalProgram: buffer.Buffer.from(appSpec.byteCode.approval, 'base64'),
624
- clearStateProgram: buffer.Buffer.from(appSpec.byteCode.clear, 'base64'),
625
- };
626
- }
627
- const approvalTemplate = buffer.Buffer.from(appSpec.source.approval, 'base64').toString('utf-8');
628
- const compiledApproval = await appManager.compileTealTemplate(approvalTemplate, deployTimeParams, {
629
- updatable,
630
- deletable,
631
- });
632
- const clearTemplate = buffer.Buffer.from(appSpec.source.clear, 'base64').toString('utf-8');
633
- const compiledClear = await appManager.compileTealTemplate(clearTemplate, deployTimeParams);
634
- if (config.Config.debug) {
635
- await config.Config.events.emitAsync(types_lifecycleEvents.EventType.AppCompiled, {
636
- sources: [
637
- { compiledTeal: compiledApproval, appName: appSpec.name, fileName: 'approval' },
638
- { compiledTeal: compiledClear, appName: appSpec.name, fileName: 'clear' },
639
- ],
640
- });
641
- }
642
- return {
643
- approvalProgram: compiledApproval.compiledBase64ToBytes,
644
- compiledApproval,
645
- clearStateProgram: compiledClear.compiledBase64ToBytes,
646
- compiledClear,
647
- };
648
- }
649
- /**
650
- * Returns ABI method arguments ready for a method call params object with default values populated
651
- * and structs replaced with tuples.
652
- *
653
- * It does this by replacing any `undefined` values with the equivalent default value from the given ARC-56 app spec.
654
- * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
655
- * e.g. `my_method` or `my_method(unit64,string)bytes`
656
- * @param args The arguments to the method with `undefined` for any that should be populated with a default value
657
- */
658
- async getABIArgsWithDefaultValues(methodNameOrSignature, args, sender) {
659
- const m = types_appArc56.getArc56Method(methodNameOrSignature, this._appSpec);
660
- return await Promise.all(args?.map(async (a, i) => {
661
- const arg = m.args[i];
662
- if (!arg) {
663
- throw new Error(`Unexpected arg at position ${i}. ${m.name} only expects ${m.args.length} args`);
664
- }
665
- if (a !== undefined) {
666
- // If a struct then convert to tuple for the underlying call
667
- return arg.struct && typeof a === 'object' && !Array.isArray(a)
668
- ? types_appArc56.getABITupleFromABIStruct(a, this._appSpec.structs[arg.struct], this._appSpec.structs)
669
- : a;
670
- }
671
- const defaultValue = arg.defaultValue;
672
- if (defaultValue) {
673
- switch (defaultValue.source) {
674
- case 'literal':
675
- return types_appArc56.getABIDecodedValue(buffer.Buffer.from(defaultValue.data, 'base64'), m.method.args[i].defaultValue?.type ?? m.method.args[i].type, this._appSpec.structs);
676
- case 'method': {
677
- const method = this.getABIMethod(defaultValue.data);
678
- const result = await this.send.call({
679
- method: defaultValue.data,
680
- args: method.args.map(() => undefined),
681
- sender,
682
- });
683
- if (result.return === undefined) {
684
- throw new Error('Default value method call did not return a value');
685
- }
686
- if (typeof result.return === 'object' &&
687
- !(result.return instanceof Uint8Array) &&
688
- !Array.isArray(result.return) &&
689
- !(result.return instanceof algosdk.Address)) {
690
- return types_appArc56.getABITupleFromABIStruct(result.return, this._appSpec.structs[method.returns.struct], this._appSpec.structs);
691
- }
692
- return result.return;
693
- }
694
- case 'local':
695
- case 'global': {
696
- const state = defaultValue.source === 'global' ? await this.getGlobalState() : await this.getLocalState(sender);
697
- const value = Object.values(state).find((s) => s.keyBase64 === defaultValue.data);
698
- if (!value) {
699
- throw new Error(`Preparing default value for argument ${arg.name ?? `arg${i + 1}`} resulted in the failure: The key '${defaultValue.data}' could not be found in ${defaultValue.source} storage`);
700
- }
701
- return 'valueRaw' in value
702
- ? types_appArc56.getABIDecodedValue(value.valueRaw, m.method.args[i].defaultValue?.type ?? m.method.args[i].type, this._appSpec.structs)
703
- : value.value;
704
- }
705
- case 'box': {
706
- const value = await this.getBoxValue(buffer.Buffer.from(defaultValue.data, 'base64'));
707
- return types_appArc56.getABIDecodedValue(value, m.method.args[i].defaultValue?.type ?? m.method.args[i].type, this._appSpec.structs);
708
- }
709
- }
710
- }
711
- if (!algosdk.abiTypeIsTransaction(arg.type)) {
712
- throw new Error(`No value provided for required argument ${arg.name ?? `arg${i + 1}`} in call to method ${m.name}`);
713
- }
714
- }) ?? []);
715
- }
716
- getBareParamsMethods() {
717
- return {
718
- /** Return params for an update call, including deploy-time TEAL template replacements and compilation if provided */
719
- update: async (params) => {
720
- return this.getBareParams({
721
- ...params,
722
- ...(await this.compile(params)),
723
- }, OnApplicationComplete.UpdateApplicationOC);
724
- },
725
- /** Return params for an opt-in call */
726
- optIn: (params) => {
727
- return this.getBareParams(params, OnApplicationComplete.OptInOC);
728
- },
729
- /** Return params for a delete call */
730
- delete: (params) => {
731
- return this.getBareParams(params, OnApplicationComplete.DeleteApplicationOC);
732
- },
733
- /** Return params for a clear state call */
734
- clearState: (params) => {
735
- return this.getBareParams(params, OnApplicationComplete.ClearStateOC);
736
- },
737
- /** Return params for a close out call */
738
- closeOut: (params) => {
739
- return this.getBareParams(params, OnApplicationComplete.CloseOutOC);
740
- },
741
- /** Return params for a call (defaults to no-op) */
742
- call: (params) => {
743
- return this.getBareParams(params, params?.onComplete ?? OnApplicationComplete.NoOpOC);
744
- },
745
- };
746
- }
747
- getBareCreateTransactionMethods() {
748
- return {
749
- /** Returns a transaction for an update call, including deploy-time TEAL template replacements and compilation if provided */
750
- update: async (params) => {
751
- return this._algorand.createTransaction.appUpdate(await this.params.bare.update(params));
752
- },
753
- /** Returns a transaction for an opt-in call */
754
- optIn: (params) => {
755
- return this._algorand.createTransaction.appCall(this.params.bare.optIn(params));
756
- },
757
- /** Returns a transaction for a delete call */
758
- delete: (params) => {
759
- return this._algorand.createTransaction.appDelete(this.params.bare.delete(params));
760
- },
761
- /** Returns a transaction for a clear state call */
762
- clearState: (params) => {
763
- return this._algorand.createTransaction.appCall(this.params.bare.clearState(params));
764
- },
765
- /** Returns a transaction for a close out call */
766
- closeOut: (params) => {
767
- return this._algorand.createTransaction.appCall(this.params.bare.closeOut(params));
768
- },
769
- /** Returns a transaction for a call (defaults to no-op) */
770
- call: (params) => {
771
- return this._algorand.createTransaction.appCall(this.params.bare.call(params));
772
- },
773
- };
774
- }
775
- getBareSendMethods() {
776
- return {
777
- /** Signs and sends an update call, including deploy-time TEAL template replacements and compilation if provided */
778
- update: async (params) => {
779
- const compiled = await this.compile(params);
780
- return {
781
- ...(await this._algorand.send.appUpdate(await this.params.bare.update(params))),
782
- ...compiled,
783
- };
784
- },
785
- /** Signs and sends an opt-in call */
786
- optIn: (params) => {
787
- return this._algorand.send.appCall(this.params.bare.optIn(params));
788
- },
789
- /** Signs and sends a delete call */
790
- delete: (params) => {
791
- return this._algorand.send.appDelete(this.params.bare.delete(params));
792
- },
793
- /** Signs and sends a clear state call */
794
- clearState: (params) => {
795
- return this._algorand.send.appCall(this.params.bare.clearState(params));
796
- },
797
- /** Signs and sends a close out call */
798
- closeOut: (params) => {
799
- return this._algorand.send.appCall(this.params.bare.closeOut(params));
800
- },
801
- /** Signs and sends a call (defaults to no-op) */
802
- call: (params) => {
803
- return this._algorand.send.appCall(this.params.bare.call(params));
804
- },
805
- };
806
- }
807
- getMethodCallParamsMethods() {
808
- return {
809
- /**
810
- * Return params for a payment transaction to fund the app account
811
- * @param params The parameters for the fund app accont payment transaction
812
- * @returns The parameters which can be used to create a fund app account payment transaction
813
- */
814
- fundAppAccount: (params) => {
815
- return {
816
- ...params,
817
- sender: this.getSender(params.sender),
818
- signer: this.getSigner(params.sender, params.signer),
819
- receiver: this.appAddress,
820
- };
821
- },
822
- /**
823
- * Return params for an update ABI call, including deploy-time TEAL template replacements and compilation if provided
824
- * @param params The parameters for the update ABI method call
825
- * @returns The parameters which can be used to create an update ABI method call
826
- */
827
- update: async (params) => {
828
- return (await this.getABIParams({
829
- ...params,
830
- ...(await this.compile(params)),
831
- }, OnApplicationComplete.UpdateApplicationOC));
832
- },
833
- /**
834
- * Return params for an opt-in ABI call
835
- * @param params The parameters for the opt-in ABI method call
836
- * @returns The parameters which can be used to create an opt-in ABI method call
837
- */
838
- optIn: async (params) => {
839
- return (await this.getABIParams(params, OnApplicationComplete.OptInOC));
840
- },
841
- /**
842
- * Return params for an delete ABI call
843
- * @param params The parameters for the delete ABI method call
844
- * @returns The parameters which can be used to create a delete ABI method call
845
- */
846
- delete: async (params) => {
847
- return (await this.getABIParams(params, OnApplicationComplete.DeleteApplicationOC));
848
- },
849
- /** Return params for an close out ABI call
850
- * @param params The parameters for the close out ABI method call
851
- * @returns The parameters which can be used to create a close out ABI method call
852
- */
853
- closeOut: async (params) => {
854
- return (await this.getABIParams(params, OnApplicationComplete.CloseOutOC));
855
- },
856
- /** Return params for an ABI call
857
- * @param params The parameters for the ABI method call
858
- * @returns The parameters which can be used to create an ABI method call
859
- */
860
- call: async (params) => {
861
- return (await this.getABIParams(params, params.onComplete ?? OnApplicationComplete.NoOpOC));
862
- },
863
- };
864
- }
865
- getMethodCallSendMethods() {
866
- return {
867
- /** Sign and send transactions for a payment transaction to fund the app account
868
- * @param params The parameters for the fund app account payment transaction
869
- * @returns The result of send the fund app account payment transaction
870
- */
871
- fundAppAccount: (params) => {
872
- return this._algorand.send.payment(this.params.fundAppAccount(params));
873
- },
874
- /**
875
- * Sign and send transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided
876
- * @param params The parameters for the update ABI method call
877
- * @returns The result of sending the update ABI method call
878
- */
879
- update: async (params) => {
880
- const compiled = await this.compile(params);
881
- return {
882
- ...(await this.processMethodCallReturn(this._algorand.send.appUpdateMethodCall(await this.params.update({ ...params })), types_appArc56.getArc56Method(params.method, this._appSpec))),
883
- ...compiled,
884
- };
885
- },
886
- /**
887
- * Sign and send transactions for an opt-in ABI call
888
- * @param params The parameters for the opt-in ABI method call
889
- * @returns The result of sending the opt-in ABI method call
890
- */
891
- optIn: async (params) => {
892
- return this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.optIn(params)), types_appArc56.getArc56Method(params.method, this._appSpec));
893
- },
894
- /**
895
- * Sign and send transactions for a delete ABI call
896
- * @param params The parameters for the delete ABI method call
897
- * @returns The result of sending the delete ABI method call
898
- */
899
- delete: async (params) => {
900
- return this.processMethodCallReturn(this._algorand.send.appDeleteMethodCall(await this.params.delete(params)), types_appArc56.getArc56Method(params.method, this._appSpec));
901
- },
902
- /**
903
- * Sign and send transactions for a close out ABI call
904
- * @param params The parameters for the close out ABI method call
905
- * @returns The result of sending the close out ABI method call
906
- */
907
- closeOut: async (params) => {
908
- return this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.closeOut(params)), types_appArc56.getArc56Method(params.method, this._appSpec));
909
- },
910
- /**
911
- * Sign and send transactions for a call (defaults to no-op)
912
- * @param params The parameters for the ABI method call
913
- * @returns The result of sending the ABI method call
914
- */
915
- call: async (params) => {
916
- // Read-only call - do it via simulate
917
- if ((params.onComplete === OnApplicationComplete.NoOpOC || !params.onComplete) &&
918
- types_appArc56.getArc56Method(params.method, this._appSpec).method.readonly) {
919
- const readonlyParams = {
920
- ...params,
921
- };
922
- // Read-only calls do not require fees to be paid, as they are only simulated on the network.
923
- // With maximum opcode budget provided, ensure_budget (and similar op-up utilities) won't need to create inner transactions,
924
- // so fee coverage for op-up inner transactions does not need to be accounted for in readonly calls.
925
- // If max_fee is provided, use it as static_fee, as there may still be inner transactions sent which need to be covered by the outermost transaction,
926
- // even though ARC-22 specifies that readonly methods should not send inner transactions.
927
- if (params.coverAppCallInnerTransactionFees && params.maxFee) {
928
- readonlyParams.staticFee = params.maxFee;
929
- readonlyParams.extraFee = undefined;
930
- }
931
- try {
932
- const result = await this._algorand
933
- .newGroup()
934
- .addAppCallMethodCall(await this.params.call(readonlyParams))
935
- .simulate({
936
- allowUnnamedResources: params.populateAppCallResources ?? true,
937
- // Simulate calls for a readonly method shouldn't invoke signing
938
- skipSignatures: true,
939
- // Simulate calls for a readonly method can use the max opcode budget
940
- extraOpcodeBudget: MAX_SIMULATE_OPCODE_BUDGET,
941
- });
942
- return this.processMethodCallReturn({
943
- ...result,
944
- transaction: result.transactions.at(-1),
945
- confirmation: result.confirmations.at(-1),
946
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
947
- return: (result.returns?.length ?? 0 > 0) ? result.returns?.at(-1) : undefined,
948
- }, types_appArc56.getArc56Method(params.method, this._appSpec));
949
- }
950
- catch (e) {
951
- const error = e;
952
- // For read-only calls with max opcode budget, fee issues should be rare
953
- // but we can still provide helpful error message if they occur
954
- if (params.coverAppCallInnerTransactionFees && error && error.message && error.message.match(/fee too small/)) {
955
- throw Error(`Fees were too small. You may need to increase the transaction maxFee.`);
956
- }
957
- throw e;
958
- }
959
- }
960
- return this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.call(params)), types_appArc56.getArc56Method(params.method, this._appSpec));
961
- },
962
- };
963
- }
964
- getMethodCallCreateTransactionMethods() {
965
- return {
966
- /** Return transaction for a payment transaction to fund the app account
967
- * @param params The parameters for the fund app account payment transaction
968
- * @returns A transaction which can be used to fund the app account
969
- */
970
- fundAppAccount: (params) => {
971
- return this._algorand.createTransaction.payment(this.params.fundAppAccount(params));
972
- },
973
- /**
974
- * Return transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided
975
- * @param params The parameters for the update ABI method call
976
- * @returns The transactions which can be used to create an update ABI method call
977
- */
978
- update: async (params) => {
979
- return this._algorand.createTransaction.appUpdateMethodCall(await this.params.update(params));
980
- },
981
- /**
982
- * Return transactions for an opt-in ABI call
983
- * @param params The parameters for the opt-in ABI method call
984
- * @returns The transactions which can be used to create an opt-in ABI method call
985
- */
986
- optIn: async (params) => {
987
- return this._algorand.createTransaction.appCallMethodCall(await this.params.optIn(params));
988
- },
989
- /**
990
- * Return transactions for a delete ABI call
991
- * @param params The parameters for the delete ABI method call
992
- * @returns The transactions which can be used to create a delete ABI method call
993
- */
994
- delete: async (params) => {
995
- return this._algorand.createTransaction.appDeleteMethodCall(await this.params.delete(params));
996
- },
997
- /**
998
- * Return transactions for a close out ABI call
999
- * @param params The parameters for the close out ABI method call
1000
- * @returns The transactions which can be used to create a close out ABI method call
1001
- */
1002
- closeOut: async (params) => {
1003
- return this._algorand.createTransaction.appCallMethodCall(await this.params.closeOut(params));
1004
- },
1005
- /**
1006
- * Return transactions for an ABI call (defaults to no-op)
1007
- * @param params The parameters for the ABI method call
1008
- * @returns The transactions which can be used to create an ABI method call
1009
- */
1010
- call: async (params) => {
1011
- return this._algorand.createTransaction.appCallMethodCall(await this.params.call(params));
1012
- },
1013
- };
1014
- }
1015
- /** Returns the sender for a call, using the provided sender or using the `defaultSender`
1016
- * if none provided and throws an error if neither provided */
1017
- getSender(sender) {
1018
- if (!sender && !this._defaultSender) {
1019
- throw new Error(`No sender provided and no default sender present in app client for call to app ${this._appName}`);
1020
- }
1021
- return typeof sender === 'string' ? algosdk.Address.fromString(sender) : (sender ?? this._defaultSender);
1022
- }
1023
- /** Returns the signer for a call, using the provided signer or the `defaultSigner`
1024
- * if no signer was provided and the sender resolves to the default sender, the call will use default signer
1025
- * or `undefined` otherwise (so the signer is resolved from `AlgorandClient`) */
1026
- getSigner(sender, signer) {
1027
- return signer ?? (!sender || sender === this._defaultSender ? this._defaultSigner : undefined);
1028
- }
1029
- getBareParams(params, onComplete) {
1030
- return {
1031
- ...params,
1032
- appId: this._appId,
1033
- sender: this.getSender(params?.sender),
1034
- signer: this.getSigner(params?.sender, params?.signer),
1035
- onComplete,
1036
- };
1037
- }
1038
- async getABIParams(params, onComplete) {
1039
- const sender = this.getSender(params.sender);
1040
- const method = types_appArc56.getArc56Method(params.method, this._appSpec);
1041
- const args = await this.getABIArgsWithDefaultValues(params.method, params.args, sender);
1042
- return {
1043
- ...params,
1044
- appId: this._appId,
1045
- sender: sender,
1046
- signer: this.getSigner(params.sender, params.signer),
1047
- method,
1048
- onComplete,
1049
- args,
1050
- };
1051
- }
1052
- getBoxMethods() {
1053
- // eslint-disable-next-line @typescript-eslint/no-this-alias
1054
- const that = this;
1055
- const stateMethods = {
1056
- /**
1057
- * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value.
1058
- */
1059
- getAll: async () => {
1060
- return Object.fromEntries(await Promise.all(Object.keys(that._appSpec.state.keys.box).map(async (key) => [key, await stateMethods.getValue(key)])));
1061
- },
1062
- /**
1063
- * Returns a single state value for the current app with the value a decoded ABI value.
1064
- * @param name The name of the state value to retrieve the value for
1065
- * @returns
1066
- */
1067
- getValue: async (name) => {
1068
- const metadata = that._appSpec.state.keys.box[name];
1069
- const value = await that.getBoxValue(buffer.Buffer.from(metadata.key, 'base64'));
1070
- return types_appArc56.getABIDecodedValue(value, metadata.valueType, that._appSpec.structs);
1071
- },
1072
- /**
1073
- *
1074
- * @param mapName The name of the map to read from
1075
- * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value
1076
- * that will be converted to bytes by encoding it using the specified ABI key type
1077
- * in the ARC-56 spec
1078
- */
1079
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1080
- getMapValue: async (mapName, key) => {
1081
- const metadata = that._appSpec.state.maps.box[mapName];
1082
- const prefix = buffer.Buffer.from(metadata.prefix ?? '', 'base64');
1083
- const encodedKey = buffer.Buffer.concat([prefix, types_appArc56.getABIEncodedValue(key, metadata.keyType, that._appSpec.structs)]);
1084
- const base64Key = buffer.Buffer.from(encodedKey).toString('base64');
1085
- const value = await that.getBoxValue(buffer.Buffer.from(base64Key, 'base64'));
1086
- return types_appArc56.getABIDecodedValue(value, metadata.valueType, that._appSpec.structs);
1087
- },
1088
- /**
1089
- *
1090
- * @param mapName The name of the map to read from
1091
- * @param key The key within the map as either a Buffer with the bytes or a value
1092
- * that will be converted to bytes by encoding it using the specified ABI key type
1093
- * in the ARC-56 spec
1094
- * @param appState
1095
- */
1096
- getMap: async (mapName) => {
1097
- const metadata = that._appSpec.state.maps.box[mapName];
1098
- const prefix = buffer.Buffer.from(metadata.prefix ?? '', 'base64');
1099
- const boxNames = await that.getBoxNames();
1100
- return new Map(await Promise.all(boxNames
1101
- .filter((b) => util.binaryStartsWith(b.nameRaw, prefix))
1102
- .map(async (b) => {
1103
- return [
1104
- types_appArc56.getABIDecodedValue(b.nameRaw.slice(prefix.length), metadata.keyType, that._appSpec.structs),
1105
- types_appArc56.getABIDecodedValue(await that.getBoxValue(b.nameRaw), metadata.valueType, that._appSpec.structs),
1106
- ];
1107
- })));
1108
- },
1109
- };
1110
- return stateMethods;
1111
- }
1112
- getStateMethods(stateGetter, keyGetter, mapGetter) {
1113
- // eslint-disable-next-line @typescript-eslint/no-this-alias
1114
- const that = this;
1115
- const stateMethods = {
1116
- /**
1117
- * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value.
1118
- */
1119
- getAll: async () => {
1120
- const appState = await stateGetter();
1121
- return Object.fromEntries(await Promise.all(Object.keys(keyGetter()).map(async (key) => [key, await stateMethods.getValue(key, appState)])));
1122
- },
1123
- /**
1124
- * Returns a single state value for the current app with the value a decoded ABI value.
1125
- * @param name The name of the state value to retrieve the value for
1126
- * @param appState Optional cached value of the current state
1127
- * @returns
1128
- */
1129
- getValue: async (name, appState) => {
1130
- const state = Object.values(appState ?? (await stateGetter()));
1131
- const metadata = keyGetter()[name];
1132
- if (metadata === undefined)
1133
- throw new Error(`Attempted to get state value ${name}, but it does not exist`);
1134
- const value = state.find((s) => s.keyBase64 === metadata.key);
1135
- if (value && 'valueRaw' in value) {
1136
- return types_appArc56.getABIDecodedValue(value.valueRaw, metadata.valueType, that._appSpec.structs);
1137
- }
1138
- return value?.value;
1139
- },
1140
- /**
1141
- * Returns a single value from the given map for the current app with the value a decoded ABI value.
1142
- * @param mapName The name of the map to read from
1143
- * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value
1144
- * that will be converted to bytes by encoding it using the specified ABI key type
1145
- * in the ARC-56 spec
1146
- * @param appState Optional cached value of the current state
1147
- */
1148
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1149
- getMapValue: async (mapName, key, appState) => {
1150
- const state = Object.values(appState ?? (await stateGetter()));
1151
- const metadata = mapGetter()[mapName];
1152
- const prefix = buffer.Buffer.from(metadata.prefix ?? '', 'base64');
1153
- const encodedKey = buffer.Buffer.concat([prefix, types_appArc56.getABIEncodedValue(key, metadata.keyType, that._appSpec.structs)]);
1154
- const base64Key = buffer.Buffer.from(encodedKey).toString('base64');
1155
- const value = state.find((s) => s.keyBase64 === base64Key);
1156
- if (value && 'valueRaw' in value) {
1157
- return types_appArc56.getABIDecodedValue(value.valueRaw, metadata.valueType, that._appSpec.structs);
1158
- }
1159
- return value?.value;
1160
- },
1161
- /**
1162
- * Returns all map values for the given map.
1163
- * @param mapName The name of the map to read from
1164
- * @param appState Optional cached value of the current state
1165
- * @returns A map of all key-value pairs in the map as a `Record<string, ABIValue>`
1166
- */
1167
- getMap: async (mapName) => {
1168
- const state = Object.values(await stateGetter());
1169
- const metadata = mapGetter()[mapName];
1170
- const prefix = buffer.Buffer.from(metadata.prefix ?? '', 'base64');
1171
- return new Map(state
1172
- .filter((s) => util.binaryStartsWith(s.keyRaw, prefix))
1173
- .map((s) => {
1174
- const key = s.keyRaw.slice(prefix.length);
1175
- return [
1176
- types_appArc56.getABIDecodedValue(key, metadata.keyType, this._appSpec.structs),
1177
- types_appArc56.getABIDecodedValue('valueRaw' in s ? s.valueRaw : s.value, metadata.valueType, this._appSpec.structs),
1178
- ];
1179
- }));
1180
- },
1181
- };
1182
- return stateMethods;
1183
- }
1184
- }
1185
- /**
1186
- * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
1187
- * `algorand.client.getAppClientByCreatorAndName`.
1188
- * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
1189
- * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
1190
- *
1191
- * Application client - a class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app */
1192
- class ApplicationClient {
1193
- /**
1194
- * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
1195
- * `algorand.client.getAppClientByCreatorAndName`.
1196
- * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
1197
- * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
1198
- *
1199
- * Create a new ApplicationClient instance
1200
- * @param appDetails The details of the app
1201
- * @param algod An algod instance
1202
- */
1203
- constructor(appDetails, algod) {
1204
- const { app, sender, params, deployTimeParams, ...appIdentifier } = appDetails;
1205
- this.algod = algod;
1206
- this.appSpec = typeof app == 'string' ? JSON.parse(app) : app;
1207
- this._appName = appIdentifier.name ?? this.appSpec.contract.name;
1208
- this.deployTimeParams = deployTimeParams;
1209
- if (appIdentifier.resolveBy === 'id') {
1210
- if (appIdentifier.id < 0) {
1211
- throw new Error(`Attempt to create application client with invalid app id of ${appIdentifier.id}`);
1212
- }
1213
- this._appId = appIdentifier.id;
1214
- }
1215
- else {
1216
- this._appId = 0;
1217
- this._creator = appIdentifier.creatorAddress?.toString();
1218
- if (appIdentifier.findExistingUsing instanceof Indexer) {
1219
- this.indexer = appIdentifier.findExistingUsing;
1220
- }
1221
- else {
1222
- if (appIdentifier.findExistingUsing.creator !== this._creator) {
1223
- throw new Error(`Attempt to create application client with invalid existingDeployments against a different creator (${appIdentifier.findExistingUsing.creator}) instead of expected creator ${this._creator}`);
1224
- }
1225
- this.existingDeployments = appIdentifier.findExistingUsing;
1226
- }
1227
- }
1228
- this._appAddress = algosdk.getApplicationAddress(this._appId).toString();
1229
- this.sender = sender;
1230
- this.params = params;
1231
- }
1232
- /**
1233
- * @deprecated Use `AppClient.compile()` instead.
1234
- *
1235
- * Compiles the approval and clear state programs and sets up the source map.
1236
- * @param compilation The deploy-time parameters for the compilation
1237
- * @returns The compiled approval and clear state programs
1238
- */
1239
- async compile(compilation) {
1240
- const { deployTimeParams, updatable, deletable } = compilation ?? {};
1241
- const approvalTemplate = buffer.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
1242
- const approval = appDeploy.replaceDeployTimeControlParams(appDeploy.performTemplateSubstitution(approvalTemplate, deployTimeParams ?? this.deployTimeParams), {
1243
- updatable,
1244
- deletable,
1245
- });
1246
- const approvalCompiled = await app.compileTeal(approval, this.algod);
1247
- this._approvalSourceMap = approvalCompiled?.sourceMap;
1248
- const clearTemplate = buffer.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
1249
- const clear = appDeploy.performTemplateSubstitution(clearTemplate, deployTimeParams ?? this.deployTimeParams);
1250
- const clearCompiled = await app.compileTeal(clear, this.algod);
1251
- this._clearSourceMap = clearCompiled?.sourceMap;
1252
- if (config.Config.debug) {
1253
- await config.Config.events.emitAsync(types_lifecycleEvents.EventType.AppCompiled, {
1254
- sources: [
1255
- { compiledTeal: approvalCompiled, appName: this._appName, fileName: 'approval' },
1256
- { compiledTeal: clearCompiled, appName: this._appName, fileName: 'clear' },
1257
- ],
1258
- });
1259
- }
1260
- return { approvalCompiled, clearCompiled };
1261
- }
1262
- /**
1263
- * Export the current source maps for the app.
1264
- * @returns The source maps
1265
- */
1266
- exportSourceMaps() {
1267
- if (!this._approvalSourceMap || !this._clearSourceMap) {
1268
- throw new Error("Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first");
1269
- }
1270
- return {
1271
- approvalSourceMap: this._approvalSourceMap,
1272
- clearSourceMap: this._clearSourceMap,
1273
- };
1274
- }
1275
- /**
1276
- * Import source maps for the app.
1277
- * @param sourceMaps The source maps to import
1278
- */
1279
- importSourceMaps(sourceMaps) {
1280
- this._approvalSourceMap = new SourceMap(sourceMaps.approvalSourceMap);
1281
- this._clearSourceMap = new SourceMap(sourceMaps.clearSourceMap);
1282
- }
1283
- /**
1284
- * @deprecated Use `deploy` from an `AppFactory` instance instead.
1285
- *
1286
- * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
1287
- *
1288
- * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
1289
- *
1290
- * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.
1291
- *
1292
- * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.
1293
- * @param deploy Deployment details
1294
- * @returns The metadata and transaction result(s) of the deployment, or just the metadata if it didn't need to issue transactions
1295
- */
1296
- async deploy(deploy) {
1297
- const { schema, sender: deploySender, version, allowUpdate, allowDelete, sendParams, createArgs, createOnCompleteAction, updateArgs, deleteArgs, ...deployArgs } = deploy ?? {};
1298
- if (this._appId !== 0) {
1299
- throw new Error(`Attempt to deploy app which already has an app id of ${this._appId}`);
1300
- }
1301
- const sender = deploySender ?? this.sender;
1302
- if (!sender) {
1303
- throw new Error('No sender provided, unable to deploy app');
1304
- }
1305
- const from = sender ?? this.sender;
1306
- if (!this._creator) {
1307
- throw new Error("Attempt to `deploy` a contract without specifying `resolveBy: 'creatorAndName'` in the constructor");
1308
- }
1309
- if (this._creator !== transaction.getSenderAddress(from)) {
1310
- throw new Error(`Attempt to deploy contract with a sender address (${transaction.getSenderAddress(from)}) that differs from the given creator address for this application client: ${this._creator}`);
1311
- }
1312
- const approval = buffer.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
1313
- const compilation = {
1314
- deployTimeParams: deployArgs.deployTimeParams,
1315
- updatable: allowUpdate !== undefined
1316
- ? allowUpdate
1317
- : getDeployTimeControl(approval, this.appSpec, types_app.UPDATABLE_TEMPLATE_NAME, 'update_application'),
1318
- deletable: allowDelete !== undefined
1319
- ? allowDelete
1320
- : getDeployTimeControl(approval, this.appSpec, types_app.DELETABLE_TEMPLATE_NAME, 'delete_application'),
1321
- };
1322
- const { approvalCompiled, clearCompiled } = await this.compile(compilation);
1323
- try {
1324
- await this.getAppReference();
1325
- const result = await appDeploy.deployApp({
1326
- from: sender,
1327
- approvalProgram: approvalCompiled.compiledBase64ToBytes,
1328
- clearStateProgram: clearCompiled.compiledBase64ToBytes,
1329
- metadata: {
1330
- name: this._appName,
1331
- version: version ?? '1.0',
1332
- updatable: compilation.updatable,
1333
- deletable: compilation.deletable,
1334
- },
1335
- schema: {
1336
- globalByteSlices: this.appSpec.state.global.num_byte_slices,
1337
- globalInts: this.appSpec.state.global.num_uints,
1338
- localByteSlices: this.appSpec.state.local.num_byte_slices,
1339
- localInts: this.appSpec.state.local.num_uints,
1340
- ...schema,
1341
- },
1342
- transactionParams: this.params,
1343
- ...(sendParams ?? {}),
1344
- existingDeployments: this.existingDeployments,
1345
- createArgs: await this.getCallArgs(createArgs, sender),
1346
- createOnCompleteAction: createOnCompleteAction,
1347
- updateArgs: await this.getCallArgs(updateArgs, sender),
1348
- deleteArgs: await this.getCallArgs(deleteArgs, sender),
1349
- ...deployArgs,
1350
- }, this.algod, this.indexer);
1351
- // Nothing needed to happen
1352
- if (result.operationPerformed === 'nothing') {
1353
- return result;
1354
- }
1355
- if (!this.existingDeployments) {
1356
- throw new Error('Expected existingDeployments to be present');
1357
- }
1358
- const { transaction, confirmation, operationPerformed, ...appMetadata } = result;
1359
- this.existingDeployments = {
1360
- creator: this.existingDeployments.creator,
1361
- apps: { ...this.existingDeployments.apps, [this._appName]: appMetadata },
1362
- };
1363
- return { ...result, ...{ compiledApproval: approvalCompiled, compiledClear: clearCompiled } };
1364
- }
1365
- catch (e) {
1366
- throw this.exposeLogicError(e);
1367
- }
1368
- }
1369
- /**
1370
- * @deprecated Use `create` from an `AppFactory` instance instead.
1371
- *
1372
- * Creates a smart contract app, returns the details of the created app.
1373
- * @param create The parameters to create the app with
1374
- * @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result
1375
- */
1376
- async create(create) {
1377
- const { sender: createSender, note, sendParams, deployTimeParams, updatable, deletable, onCompleteAction, schema, ...args } = create ?? {};
1378
- if (this._appId !== 0) {
1379
- throw new Error(`Attempt to create app which already has an app id of ${this._appId}`);
1380
- }
1381
- const sender = createSender ?? this.sender;
1382
- if (!sender) {
1383
- throw new Error('No sender provided, unable to create app');
1384
- }
1385
- const { approvalCompiled, clearCompiled } = await this.compile(create);
1386
- try {
1387
- const result = await app.createApp({
1388
- from: sender,
1389
- approvalProgram: approvalCompiled.compiledBase64ToBytes,
1390
- clearStateProgram: clearCompiled.compiledBase64ToBytes,
1391
- schema: {
1392
- globalByteSlices: this.appSpec.state.global.num_byte_slices,
1393
- globalInts: this.appSpec.state.global.num_uints,
1394
- localByteSlices: this.appSpec.state.local.num_byte_slices,
1395
- localInts: this.appSpec.state.local.num_uints,
1396
- ...schema,
1397
- },
1398
- onCompleteAction,
1399
- args: await this.getCallArgs(args, sender),
1400
- note: note,
1401
- transactionParams: this.params,
1402
- ...(sendParams ?? {}),
1403
- }, this.algod);
1404
- if (result.confirmation) {
1405
- this._appId = result.confirmation.applicationIndex;
1406
- this._appAddress = getApplicationAddress(this._appId).toString();
1407
- }
1408
- return { ...result, ...{ compiledApproval: approvalCompiled, compiledClear: clearCompiled } };
1409
- }
1410
- catch (e) {
1411
- throw await this.exposeLogicError(e);
1412
- }
1413
- }
1414
- /**
1415
- * @deprecated Use `appClient.send.update` or `appClient.createTransaction.update` from an `AppClient` instance instead.
1416
- *
1417
- * Updates the smart contract app.
1418
- * @param update The parameters to update the app with
1419
- * @returns The transaction send result and the compilation result
1420
- */
1421
- async update(update) {
1422
- const { sender: updateSender, note, sendParams, deployTimeParams, updatable, deletable, ...args } = update ?? {};
1423
- if (this._appId === 0) {
1424
- throw new Error(`Attempt to update app which doesn't have an app id defined`);
1425
- }
1426
- const sender = updateSender ?? this.sender;
1427
- if (!sender) {
1428
- throw new Error('No sender provided, unable to create app');
1429
- }
1430
- const { approvalCompiled, clearCompiled } = await this.compile(update);
1431
- try {
1432
- const result = await app.updateApp({
1433
- appId: this._appId,
1434
- from: sender,
1435
- approvalProgram: approvalCompiled.compiledBase64ToBytes,
1436
- clearStateProgram: clearCompiled.compiledBase64ToBytes,
1437
- args: await this.getCallArgs(args, sender),
1438
- note: note,
1439
- transactionParams: this.params,
1440
- ...(sendParams ?? {}),
1441
- }, this.algod);
1442
- return { ...result, ...{ compiledApproval: approvalCompiled, compiledClear: clearCompiled } };
1443
- }
1444
- catch (e) {
1445
- throw await this.exposeLogicError(e);
1446
- }
1447
- }
1448
- /**
1449
- * @deprecated Use `appClient.send.call` or `appClient.createTransaction.call` from an `AppClient` instance instead.
1450
- *
1451
- * Issues a no_op (normal) call to the app.
1452
- * @param call The call details.
1453
- * @returns The result of the call
1454
- */
1455
- async call(call) {
1456
- if (
1457
- // ABI call
1458
- call?.method &&
1459
- // We aren't skipping the send
1460
- !call.sendParams?.skipSending &&
1461
- // There isn't an ATC passed in
1462
- !call.sendParams?.atc &&
1463
- // The method is readonly
1464
- this.appSpec.hints[this.getABIMethodSignature(this.getABIMethod(call.method))].read_only) {
1465
- const atc = new AtomicTransactionComposer();
1466
- await this.callOfType({ ...call, sendParams: { ...call.sendParams, atc } }, 'no_op');
1467
- const result = await atc.simulate(this.algod);
1468
- if (result.simulateResponse.txnGroups.some((group) => group.failureMessage)) {
1469
- throw new Error(result.simulateResponse.txnGroups.find((x) => x.failureMessage)?.failureMessage);
1470
- }
1471
- const txns = atc.buildGroup();
1472
- return {
1473
- transaction: txns[txns.length - 1].txn,
1474
- confirmation: result.simulateResponse.txnGroups[0].txnResults.at(-1)?.txnResult,
1475
- confirmations: result.simulateResponse.txnGroups[0].txnResults.map((t) => t.txnResult),
1476
- transactions: txns.map((t) => t.txn),
1477
- return: (result.methodResults?.length ?? 0 > 0) ? result.methodResults[result.methodResults.length - 1] : undefined,
1478
- };
1479
- }
1480
- return await this.callOfType(call, 'no_op');
1481
- }
1482
- /**
1483
- * @deprecated Use `appClient.send.optIn` or `appClient.createTransaction.optIn` from an `AppClient` instance instead.
1484
- *
1485
- * Issues a opt_in call to the app.
1486
- * @param call The call details.
1487
- * @returns The result of the call
1488
- */
1489
- async optIn(call) {
1490
- return await this.callOfType(call, 'opt_in');
1491
- }
1492
- /**
1493
- * @deprecated Use `appClient.send.closeOut` or `appClient.createTransaction.closeOut` from an `AppClient` instance instead.
1494
- *
1495
- * Issues a close_out call to the app.
1496
- * @param call The call details.
1497
- * @returns The result of the call
1498
- */
1499
- async closeOut(call) {
1500
- return await this.callOfType(call, 'close_out');
1501
- }
1502
- /**
1503
- * @deprecated Use `appClient.send.clearState` or `appClient.createTransaction.clearState` from an `AppClient` instance instead.
1504
- *
1505
- * Issues a clear_state call to the app.
1506
- * @param call The call details.
1507
- * @returns The result of the call
1508
- */
1509
- async clearState(call) {
1510
- return await this.callOfType(call, 'clear_state');
1511
- }
1512
- /**
1513
- * @deprecated Use `appClient.send.delete` or `appClient.createTransaction.delete` from an `AppClient` instance instead.
1514
- *
1515
- * Issues a delete_application call to the app.
1516
- * @param call The call details.
1517
- * @returns The result of the call
1518
- */
1519
- async delete(call) {
1520
- return await this.callOfType(call, 'delete_application');
1521
- }
1522
- /**
1523
- * @deprecated Use `appClient.send.call` or `appClient.createTransaction.call` from an `AppClient` instance instead.
1524
- *
1525
- * Issues a call to the app with the given call type.
1526
- * @param call The call details.
1527
- * @param callType The call type
1528
- * @returns The result of the call
1529
- */
1530
- async callOfType(call = {}, callType) {
1531
- const { sender: callSender, note, sendParams, ...args } = call;
1532
- const sender = callSender ?? this.sender;
1533
- if (!sender) {
1534
- throw new Error('No sender provided, unable to call app');
1535
- }
1536
- const appMetadata = await this.getAppReference();
1537
- if (appMetadata.appId === 0) {
1538
- throw new Error(`Attempt to call an app that can't be found '${this._appName}' for creator '${this._creator}'.`);
1539
- }
1540
- try {
1541
- return await app.callApp({
1542
- appId: appMetadata.appId,
1543
- callType: callType,
1544
- from: sender,
1545
- args: await this.getCallArgs(args, sender),
1546
- note: note,
1547
- transactionParams: this.params,
1548
- ...(sendParams ?? {}),
1549
- }, this.algod);
1550
- }
1551
- catch (e) {
1552
- throw this.exposeLogicError(e);
1553
- }
1554
- }
1555
- /**
1556
- * Funds Algo into the app account for this app.
1557
- * @param fund The parameters for the funding or the funding amount
1558
- * @returns The result of the funding
1559
- */
1560
- async fundAppAccount(fund) {
1561
- const { amount, sender, note, sendParams } = 'microAlgos' in fund ? { amount: fund } : fund;
1562
- if (!sender && !this.sender) {
1563
- throw new Error('No sender provided, unable to call app');
1564
- }
1565
- const ref = await this.getAppReference();
1566
- return legacyBridge.legacySendTransactionBridge(this.algod, sender ?? this.sender, sendParams ?? {}, {
1567
- receiver: ref.appAddress,
1568
- sender: transaction.getSenderAddress(sender ?? this.sender),
1569
- amount: amount,
1570
- note: transaction.encodeTransactionNote(note),
1571
- }, (c) => c.payment, (c) => c.payment, this.params);
1572
- }
1573
- /**
1574
- * Returns global state for the current app.
1575
- * @returns The global state
1576
- */
1577
- async getGlobalState() {
1578
- const appRef = await this.getAppReference();
1579
- if (appRef.appId === 0) {
1580
- throw new Error('No app has been created yet, unable to get global state');
1581
- }
1582
- return app.getAppGlobalState(appRef.appId, this.algod);
1583
- }
1584
- /**
1585
- * Returns local state for the given account / account address.
1586
- * @returns The global state
1587
- */
1588
- async getLocalState(account) {
1589
- const appRef = await this.getAppReference();
1590
- if (appRef.appId === 0) {
1591
- throw new Error('No app has been created yet, unable to get global state');
1592
- }
1593
- return app.getAppLocalState(appRef.appId, account, this.algod);
1594
- }
1595
- /**
1596
- * Returns the names of all current boxes for the current app.
1597
- * @returns The names of the boxes
1598
- */
1599
- async getBoxNames() {
1600
- const appRef = await this.getAppReference();
1601
- if (appRef.appId === 0) {
1602
- throw new Error('No app has been created yet, unable to get global state');
1603
- }
1604
- return await app.getAppBoxNames(appRef.appId, this.algod);
1605
- }
1606
- /**
1607
- * Returns the value of the given box for the current app.
1608
- * @param name The name of the box to return either as a string, binary array or `BoxName`
1609
- * @returns The current box value as a byte array
1610
- */
1611
- async getBoxValue(name) {
1612
- const appRef = await this.getAppReference();
1613
- if (appRef.appId === 0) {
1614
- throw new Error('No app has been created yet, unable to get global state');
1615
- }
1616
- return await app.getAppBoxValue(appRef.appId, name, this.algod);
1617
- }
1618
- /**
1619
- * Returns the value of the given box for the current app.
1620
- * @param name The name of the box to return either as a string, binary array or `BoxName`
1621
- * @param type
1622
- * @returns The current box value as a byte array
1623
- */
1624
- async getBoxValueFromABIType(name, type) {
1625
- const appRef = await this.getAppReference();
1626
- if (appRef.appId === 0) {
1627
- throw new Error('No app has been created yet, unable to get global state');
1628
- }
1629
- return await app.getAppBoxValueFromABIType({ appId: appRef.appId, boxName: name, type }, this.algod);
1630
- }
1631
- /**
1632
- * Returns the values of all current boxes for the current app.
1633
- * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
1634
- * @param filter Optional filter to filter which boxes' values are returned
1635
- * @returns The (name, value) pair of the boxes with values as raw byte arrays
1636
- */
1637
- async getBoxValues(filter) {
1638
- const appRef = await this.getAppReference();
1639
- if (appRef.appId === 0) {
1640
- throw new Error('No app has been created yet, unable to get global state');
1641
- }
1642
- const names = await this.getBoxNames();
1643
- return await Promise.all(names
1644
- .filter(filter ?? ((_) => true))
1645
- .map(async (boxName) => ({ name: boxName, value: await app.getAppBoxValue(appRef.appId, boxName, this.algod) })));
1646
- }
1647
- /**
1648
- * Returns the values of all current boxes for the current app decoded using an ABI Type.
1649
- * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
1650
- * @param type The ABI type to decode the values with
1651
- * @param filter Optional filter to filter which boxes' values are returned
1652
- * @returns The (name, value) pair of the boxes with values as the ABI Value
1653
- */
1654
- async getBoxValuesFromABIType(type, filter) {
1655
- const appRef = await this.getAppReference();
1656
- if (appRef.appId === 0) {
1657
- throw new Error('No app has been created yet, unable to get global state');
1658
- }
1659
- const names = await this.getBoxNames();
1660
- return await Promise.all(names.filter(filter ?? ((_) => true)).map(async (boxName) => ({
1661
- name: boxName,
1662
- value: await app.getAppBoxValueFromABIType({ appId: appRef.appId, boxName, type }, this.algod),
1663
- })));
1664
- }
1665
- /**
1666
- * @deprecated Use `appClient.params.*` from an `AppClient` instance instead.
1667
- *
1668
- * Returns the arguments for an app call for the given ABI method or raw method specification.
1669
- * @param args The call args specific to this application client
1670
- * @param sender The sender of this call. Will be used to fetch any default argument values if applicable
1671
- * @returns The call args ready to pass into an app call
1672
- */
1673
- async getCallArgs(args, sender) {
1674
- if (!args) {
1675
- return undefined;
1676
- }
1677
- if (args.method) {
1678
- const abiMethod = this.getABIMethodParams(args.method);
1679
- if (!abiMethod) {
1680
- throw new Error(`Attempt to call ABI method ${args.method}, but it wasn't found`);
1681
- }
1682
- const methodSignature = this.getABIMethodSignature(abiMethod);
1683
- return {
1684
- ...args,
1685
- method: abiMethod,
1686
- methodArgs: await Promise.all(args.methodArgs.map(async (arg, index) => {
1687
- if (arg !== undefined)
1688
- return arg;
1689
- const argName = abiMethod.args[index].name;
1690
- const defaultValueStrategy = argName && this.appSpec.hints?.[methodSignature]?.default_arguments?.[argName];
1691
- if (!defaultValueStrategy)
1692
- throw new Error(`Argument at position ${index} with the name ${argName} is undefined and does not have a default value strategy`);
1693
- switch (defaultValueStrategy.source) {
1694
- case 'constant':
1695
- return defaultValueStrategy.data;
1696
- case 'abi-method': {
1697
- const method = defaultValueStrategy.data;
1698
- const result = await this.callOfType({
1699
- method: this.getABIMethodSignature(method),
1700
- methodArgs: method.args.map(() => undefined),
1701
- sender,
1702
- }, 'no_op');
1703
- return result.return?.returnValue;
1704
- }
1705
- case 'local-state':
1706
- case 'global-state': {
1707
- const state = defaultValueStrategy.source === 'global-state' ? await this.getGlobalState() : await this.getLocalState(sender);
1708
- const key = defaultValueStrategy.data;
1709
- if (key in state) {
1710
- return state[key].value;
1711
- }
1712
- else {
1713
- throw new Error(`Preparing default value for argument at position ${index} with the name ${argName} resulted in the failure: The key '${key}' could not be found in ${defaultValueStrategy.source}`);
1714
- }
1715
- }
1716
- }
1717
- })),
1718
- };
1719
- }
1720
- else {
1721
- return args;
1722
- }
1723
- }
1724
- /**
1725
- * @deprecated Use `appClient.getABIMethod` instead.
1726
- *
1727
- * Returns the ABI Method parameters for the given method name string for the app represented by this application client instance
1728
- * @param method Either the name of the method or the ABI method spec definition string
1729
- * @returns The ABI method params for the given method
1730
- */
1731
- getABIMethodParams(method) {
1732
- if (!method.includes('(')) {
1733
- const methods = this.appSpec.contract.methods.filter((m) => m.name === method);
1734
- if (methods.length > 1) {
1735
- throw new Error(`Received a call to method ${method} in contract ${this._appName}, but this resolved to multiple methods; please pass in an ABI signature instead: ${methods
1736
- .map(this.getABIMethodSignature)
1737
- .join(', ')}`);
1738
- }
1739
- return methods[0];
1740
- }
1741
- return this.appSpec.contract.methods.find((m) => this.getABIMethodSignature(m) === method);
1742
- }
1743
- /**
1744
- * Returns the ABI Method for the given method name string for the app represented by this application client instance
1745
- * @param method Either the name of the method or the ABI method spec definition string
1746
- * @returns The ABI method for the given method
1747
- */
1748
- getABIMethod(method) {
1749
- const methodParams = this.getABIMethodParams(method);
1750
- return methodParams ? new ABIMethod(methodParams) : undefined;
1751
- }
1752
- /**
1753
- * @deprecated Use `appClient.appId` and `appClient.appAddress` from an `AppClient` instance instead.
1754
- *
1755
- * Gets the reference information for the current application instance.
1756
- * `appId` will be 0 if it can't find an app.
1757
- * @returns The app reference, or if deployed using the `deploy` method, the app metadata too
1758
- */
1759
- async getAppReference() {
1760
- if (!this.existingDeployments && this._creator) {
1761
- this.existingDeployments = await appDeploy.getCreatorAppsByName(this._creator, this.indexer);
1762
- }
1763
- if (this.existingDeployments && this._appId === 0) {
1764
- const app = this.existingDeployments.apps[this._appName];
1765
- if (!app) {
1766
- return {
1767
- appId: 0,
1768
- appAddress: getApplicationAddress(0).toString(),
1769
- };
1770
- }
1771
- return app;
1772
- }
1773
- return {
1774
- appId: this._appId,
1775
- appAddress: this._appAddress,
1776
- };
1777
- }
1778
- /**
1779
- * Takes an error that may include a logic error from a smart contract call and re-exposes the error to include source code information via the source map.
1780
- * This is automatically used within `ApplicationClient` but if you pass `skipSending: true` e.g. if doing a group transaction
1781
- * then you can use this in a try/catch block to get better debugging information.
1782
- * @param e The error to parse
1783
- * @param isClear Whether or not the code was running the clear state program
1784
- * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
1785
- */
1786
- exposeLogicError(e, isClear) {
1787
- if ((!isClear && this._approvalSourceMap == undefined) || (isClear && this._clearSourceMap == undefined))
1788
- return e;
1789
- const errorDetails = types_logicError.LogicError.parseLogicError(e);
1790
- if (errorDetails !== undefined)
1791
- return new types_logicError.LogicError(errorDetails, buffer.Buffer.from(isClear ? this.appSpec.source.clear : this.appSpec.source.approval, 'base64')
1792
- .toString()
1793
- .split('\n'), (pc) => (isClear ? this._clearSourceMap : this._approvalSourceMap)?.getLocationForPc(pc)?.line);
1794
- else
1795
- return e;
1796
- }
1797
- getABIMethodSignature(method) {
1798
- return 'getSignature' in method ? method.getSignature() : new ABIMethod(method).getSignature();
1799
- }
1800
- }
55
+ * state for a specific deployed instance of an app (with a known app ID). */
56
+ var AppClient = class AppClient {
57
+ _appId;
58
+ _appAddress;
59
+ _appName;
60
+ _appSpec;
61
+ _algorand;
62
+ _defaultSender;
63
+ _defaultSigner;
64
+ _approvalSourceMap;
65
+ _clearSourceMap;
66
+ _localStateMethods;
67
+ _globalStateMethods;
68
+ _boxStateMethods;
69
+ _paramsMethods;
70
+ _createTransactionsMethods;
71
+ _sendMethods;
72
+ _lastCompiled;
73
+ /**
74
+ * Create a new app client.
75
+ * @param params The parameters to create the app client
76
+ * @returns The `AppClient` instance
77
+ * @example
78
+ * ```typescript
79
+ * const appClient = new AppClient({
80
+ * appId: 12345678n,
81
+ * appSpec: appSpec,
82
+ * algorand: AlgorandClient.mainNet(),
83
+ * })
84
+ */
85
+ constructor(params) {
86
+ this._appId = params.appId;
87
+ this._appAddress = require_address.getApplicationAddress(this._appId);
88
+ this._appSpec = AppClient.normaliseAppSpec(params.appSpec);
89
+ this._appName = params.appName ?? this._appSpec.name;
90
+ this._algorand = params.algorand;
91
+ this._algorand.registerErrorTransformer(this.handleCallErrors);
92
+ this._defaultSender = require_address.getOptionalAddress(params.defaultSender);
93
+ this._defaultSigner = params.defaultSigner;
94
+ this._lastCompiled = {};
95
+ this._approvalSourceMap = params.approvalSourceMap;
96
+ this._clearSourceMap = params.clearSourceMap;
97
+ this._localStateMethods = (address) => this.getStateMethods(() => this.getLocalState(address), () => require_arc56_contract.getLocalABIStorageKeys(this._appSpec), () => require_arc56_contract.getLocalABIStorageMaps(this._appSpec));
98
+ this._globalStateMethods = this.getStateMethods(() => this.getGlobalState(), () => require_arc56_contract.getGlobalABIStorageKeys(this._appSpec), () => require_arc56_contract.getGlobalABIStorageMaps(this._appSpec));
99
+ this._boxStateMethods = this.getBoxMethods();
100
+ this._paramsMethods = {
101
+ ...this.getMethodCallParamsMethods(),
102
+ bare: this.getBareParamsMethods()
103
+ };
104
+ this._createTransactionsMethods = {
105
+ ...this.getMethodCallCreateTransactionMethods(),
106
+ bare: this.getBareCreateTransactionMethods()
107
+ };
108
+ this._sendMethods = {
109
+ ...this.getMethodCallSendMethods(),
110
+ bare: this.getBareSendMethods()
111
+ };
112
+ }
113
+ /**
114
+ * Clone this app client with different params
115
+ *
116
+ * @param params The params to use for the the cloned app client. Omit a param to keep the original value. Set a param to override the original value. Setting to undefined will clear the original value.
117
+ * @returns A new app client with the altered params
118
+ * @example
119
+ * ```typescript
120
+ * const appClient2 = appClient.clone({ defaultSender: 'NEW_SENDER_ADDRESS' })
121
+ * ```
122
+ */
123
+ clone(params) {
124
+ return new AppClient({
125
+ appId: this._appId,
126
+ appSpec: this._appSpec,
127
+ algorand: this._algorand,
128
+ appName: this._appName,
129
+ defaultSender: this._defaultSender,
130
+ defaultSigner: this._defaultSigner,
131
+ approvalSourceMap: this._approvalSourceMap,
132
+ clearSourceMap: this._clearSourceMap,
133
+ ...params
134
+ });
135
+ }
136
+ /**
137
+ * Returns a new `AppClient` client, resolving the app by creator address and name
138
+ * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
139
+ * @param params The parameters to create the app client
140
+ * @returns The `AppClient` instance
141
+ * @example
142
+ * ```typescript
143
+ * const appClient = await AppClient.fromCreatorAndName({
144
+ * creatorAddress: 'CREATOR_ADDRESS',
145
+ * name: 'APP_NAME',
146
+ * appSpec: appSpec,
147
+ * algorand: AlgorandClient.mainNet(),
148
+ * })
149
+ */
150
+ static async fromCreatorAndName(params) {
151
+ const appSpec = AppClient.normaliseAppSpec(params.appSpec);
152
+ const appMetadata = (params.appLookupCache ?? await params.algorand.appDeployer.getCreatorAppsByName(params.creatorAddress, params.ignoreCache)).apps[params.appName ?? appSpec.name];
153
+ if (!appMetadata) throw new Error(`App not found for creator ${params.creatorAddress} and name ${params.appName ?? appSpec.name}`);
154
+ return new AppClient({
155
+ ...params,
156
+ algorand: params.algorand,
157
+ appId: appMetadata.appId
158
+ });
159
+ }
160
+ /**
161
+ * Returns an `AppClient` instance for the current network based on
162
+ * pre-determined network-specific app IDs specified in the ARC-56 app spec.
163
+ *
164
+ * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
165
+ * @param params The parameters to create the app client
166
+ * @returns The `AppClient` instance
167
+ * @example
168
+ * ```typescript
169
+ * const appClient = await AppClient.fromNetwork({
170
+ * appSpec: appSpec,
171
+ * algorand: AlgorandClient.mainNet(),
172
+ * })
173
+ */
174
+ static async fromNetwork(params) {
175
+ const network = await params.algorand.client.network();
176
+ const appSpec = AppClient.normaliseAppSpec(params.appSpec);
177
+ const networkNames = [network.genesisHash];
178
+ if (network.isLocalNet) networkNames.push("localnet");
179
+ if (network.isTestNet) networkNames.push("testnet");
180
+ if (network.isMainNet) networkNames.push("mainnet");
181
+ const networkIndex = Object.keys(appSpec.networks ?? {}).findIndex((n) => networkNames.includes(n));
182
+ if (networkIndex === -1) throw new Error(`No app ID found for network ${require_util.asJson(networkNames)} in the app spec`);
183
+ const appId = BigInt(appSpec.networks[networkIndex].appID);
184
+ return new AppClient({
185
+ ...params,
186
+ appId,
187
+ appSpec
188
+ });
189
+ }
190
+ /**
191
+ * Takes a string or parsed JSON object that could be ARC-32 or ARC-56 format and
192
+ * normalises it into a parsed ARC-56 contract object.
193
+ * @param spec The spec to normalise
194
+ * @returns The normalised ARC-56 contract object
195
+ * @example
196
+ * ```typescript
197
+ * const arc56AppSpec = AppClient.normaliseAppSpec(appSpec)
198
+ * ```
199
+ */
200
+ static normaliseAppSpec(spec) {
201
+ const parsedSpec = typeof spec === "string" ? JSON.parse(spec) : spec;
202
+ return "hints" in parsedSpec ? require_app_spec.arc32ToArc56(parsedSpec) : parsedSpec;
203
+ }
204
+ /** The ID of the app instance this client is linked to. */
205
+ get appId() {
206
+ return this._appId;
207
+ }
208
+ /** The app address of the app instance this client is linked to. */
209
+ get appAddress() {
210
+ return this._appAddress;
211
+ }
212
+ /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */
213
+ get appName() {
214
+ return this._appName;
215
+ }
216
+ /** The ARC-56 app spec being used */
217
+ get appSpec() {
218
+ return this._appSpec;
219
+ }
220
+ /** A reference to the underlying `AlgorandClient` this app client is using. */
221
+ get algorand() {
222
+ return this._algorand;
223
+ }
224
+ /** Get parameters to create transactions for the current app.
225
+ *
226
+ * A good mental model for this is that these parameters represent a deferred transaction creation.
227
+ * @example Create a transaction in the future using Algorand Client
228
+ * ```typescript
229
+ * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})
230
+ * // ...
231
+ * await algorand.send.AppMethodCall(myMethodCall)
232
+ * ```
233
+ * @example Define a nested transaction as an ABI argument
234
+ * ```typescript
235
+ * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})
236
+ * await appClient.send.call({method: 'my_method2', args: [myMethodCall]})
237
+ * ```
238
+ */
239
+ get params() {
240
+ return this._paramsMethods;
241
+ }
242
+ /** Create transactions for the current app */
243
+ get createTransaction() {
244
+ return this._createTransactionsMethods;
245
+ }
246
+ /** Send transactions to the current app */
247
+ get send() {
248
+ return this._sendMethods;
249
+ }
250
+ /** Get state (local, global, box) from the current app */
251
+ get state() {
252
+ return {
253
+ local: this._localStateMethods,
254
+ global: this._globalStateMethods,
255
+ box: this._boxStateMethods
256
+ };
257
+ }
258
+ /**
259
+ * Funds Algo into the app account for this app.
260
+ *
261
+ * An alias for `appClient.send.fundAppAccount(params)`.
262
+ * @param params The parameters for the funding transaction
263
+ * @returns The result of the funding
264
+ * @example
265
+ * ```typescript
266
+ * await appClient.fundAppAccount({ amount: algo(1) })
267
+ * ```
268
+ */
269
+ async fundAppAccount(params) {
270
+ return this.send.fundAppAccount(params);
271
+ }
272
+ /**
273
+ * Returns raw global state for the current app.
274
+ * @returns The global state
275
+ * @example
276
+ * ```typescript
277
+ * const globalState = await appClient.getGlobalState()
278
+ * ```
279
+ */
280
+ async getGlobalState() {
281
+ return await this._algorand.app.getGlobalState(this.appId);
282
+ }
283
+ /**
284
+ * Returns raw local state for the given account address.
285
+ * @param address The address of the account to get the local state for
286
+ * @returns The local state
287
+ * @example
288
+ * ```typescript
289
+ * const localState = await appClient.getLocalState('ACCOUNT_ADDRESS')
290
+ * ```
291
+ */
292
+ async getLocalState(address) {
293
+ return await this._algorand.app.getLocalState(this.appId, require_address.getAddress(address));
294
+ }
295
+ /**
296
+ * Returns the names of all current boxes for the current app.
297
+ * @returns The names of the boxes
298
+ * @example
299
+ * ```typescript
300
+ * const boxNames = await appClient.getBoxNames()
301
+ * ```
302
+ */
303
+ async getBoxNames() {
304
+ return await this._algorand.app.getBoxNames(this.appId);
305
+ }
306
+ /**
307
+ * Returns the value of the given box for the current app.
308
+ * @param name The identifier of the box to return
309
+ * @returns The current box value as a byte array
310
+ * @example
311
+ * ```typescript
312
+ * const boxValue = await appClient.getBoxValue('boxName')
313
+ * ```
314
+ */
315
+ async getBoxValue(name) {
316
+ return await this._algorand.app.getBoxValue(this.appId, name);
317
+ }
318
+ /**
319
+ * Returns the value of the given box for the current app.
320
+ * @param name The identifier of the box to return
321
+ * @param type
322
+ * @returns The current box value as a byte array
323
+ * @example
324
+ * ```typescript
325
+ * const boxValue = await appClient.getBoxValueFromABIType('boxName', new ABIUintType(32))
326
+ * ```
327
+ */
328
+ async getBoxValueFromABIType(name, type) {
329
+ return await this._algorand.app.getBoxValueFromABIType({
330
+ appId: this.appId,
331
+ boxName: name,
332
+ type
333
+ });
334
+ }
335
+ /**
336
+ * Returns the values of all current boxes for the current app.
337
+ * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
338
+ * @param filter Optional filter to filter which boxes' values are returned
339
+ * @returns The (name, value) pair of the boxes with values as raw byte arrays
340
+ * @example
341
+ * ```typescript
342
+ * const boxValues = await appClient.getBoxValues()
343
+ * ```
344
+ */
345
+ async getBoxValues(filter) {
346
+ const names = (await this.getBoxNames()).filter(filter ?? ((_) => true));
347
+ const values = await this._algorand.app.getBoxValues(this.appId, names.map((name) => name.nameRaw));
348
+ return names.map((name, i) => ({
349
+ name,
350
+ value: values[i]
351
+ }));
352
+ }
353
+ /**
354
+ * Returns the values of all current boxes for the current app decoded using an ABI Type.
355
+ * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
356
+ * @param type The ABI type to decode the values with
357
+ * @param filter Optional filter to filter which boxes' values are returned
358
+ * @returns The (name, value) pair of the boxes with values as the ABI Value
359
+ * @example
360
+ * ```typescript
361
+ * const boxValues = await appClient.getBoxValuesFromABIType(new ABIUintType(32))
362
+ * ```
363
+ */
364
+ async getBoxValuesFromABIType(type, filter) {
365
+ const names = (await this.getBoxNames()).filter(filter ?? ((_) => true));
366
+ const values = await this._algorand.app.getBoxValuesFromABIType({
367
+ appId: this.appId,
368
+ boxNames: names.map((name) => name.nameRaw),
369
+ type
370
+ });
371
+ return names.map((name, i) => ({
372
+ name,
373
+ value: values[i]
374
+ }));
375
+ }
376
+ /**
377
+ * Takes an error that may include a logic error from a call to the current app and re-exposes the
378
+ * error to include source code information via the source map and ARC-56 spec.
379
+ * @param e The error to parse
380
+ * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program)
381
+ * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
382
+ */
383
+ async exposeLogicError(e, isClearStateProgram) {
384
+ const pcOffsetMethod = this._appSpec.sourceInfo?.[isClearStateProgram ? "clear" : "approval"]?.pcOffsetMethod;
385
+ let program;
386
+ if (pcOffsetMethod === "cblocks") {
387
+ const appInfo = await this._algorand.app.getById(this.appId);
388
+ program = isClearStateProgram ? appInfo.clearStateProgram : appInfo.approvalProgram;
389
+ }
390
+ return AppClient.exposeLogicError(e, this._appSpec, {
391
+ isClearStateProgram,
392
+ approvalSourceMap: this._approvalSourceMap,
393
+ clearSourceMap: this._clearSourceMap,
394
+ program
395
+ });
396
+ }
397
+ /**
398
+ * Export the current source maps for the app.
399
+ * @returns The source maps
400
+ */
401
+ exportSourceMaps() {
402
+ if (!this._approvalSourceMap || !this._clearSourceMap) throw new Error("Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first");
403
+ return {
404
+ approvalSourceMap: this._approvalSourceMap,
405
+ clearSourceMap: this._clearSourceMap
406
+ };
407
+ }
408
+ /**
409
+ * Import source maps for the app.
410
+ * @param sourceMaps The source maps to import
411
+ */
412
+ importSourceMaps(sourceMaps) {
413
+ this._approvalSourceMap = new require_sourcemap.ProgramSourceMap(sourceMaps.approvalSourceMap);
414
+ this._clearSourceMap = new require_sourcemap.ProgramSourceMap(sourceMaps.clearSourceMap);
415
+ }
416
+ /**
417
+ * Returns the ABI Method spec for the given method string for the app represented by this application client instance
418
+ * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
419
+ * e.g. `my_method` or `my_method(unit64,string)bytes`
420
+ * @returns A tuple with: [ARC-56 `Method`, algosdk `ABIMethod`]
421
+ */
422
+ getABIMethod(methodNameOrSignature) {
423
+ return require_abi_method.getABIMethod(methodNameOrSignature, this._appSpec);
424
+ }
425
+ /**
426
+ * Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type
427
+ * on the ARC-56 method, replacing the `return` property with the decoded type.
428
+ *
429
+ * If the return type is an ARC-56 struct then the struct will be returned.
430
+ *
431
+ * @param result The SendAppTransactionResult to be mapped
432
+ * @param method The method that was called
433
+ * @returns The smart contract response with an updated return value
434
+ */
435
+ async processMethodCallReturn(result) {
436
+ const resultValue = await result;
437
+ return {
438
+ ...resultValue,
439
+ return: resultValue.return?.returnValue
440
+ };
441
+ }
442
+ /**
443
+ * Compiles the approval and clear state programs (if TEAL templates provided),
444
+ * performing any provided deploy-time parameter replacement and stores
445
+ * the source maps.
446
+ *
447
+ * If no TEAL templates provided it will use any byte code provided in the app spec.
448
+ *
449
+ * Will store any generated source maps for later use in debugging.
450
+ * @param compilation Any compilation parameters to use
451
+ * @returns The compiled code and any compilation results (including source maps)
452
+ */
453
+ async compile(compilation) {
454
+ const result = await AppClient.compile(this._appSpec, this._algorand.app, compilation);
455
+ if (result.compiledApproval) {
456
+ this._approvalSourceMap = result.compiledApproval.sourceMap;
457
+ this._lastCompiled.approval = result.compiledApproval.compiledBase64ToBytes;
458
+ }
459
+ if (result.compiledClear) {
460
+ this._clearSourceMap = result.compiledClear.sourceMap;
461
+ this._lastCompiled.clear = result.compiledClear.compiledBase64ToBytes;
462
+ }
463
+ return result;
464
+ }
465
+ /**
466
+ * Takes an error that may include a logic error from a call to the current app and re-exposes the
467
+ * error to include source code information via the source map and ARC-56 spec.
468
+ * @param e The error to parse
469
+ * @param appSpec The app spec for the app
470
+ * @param details Additional information to inform the error
471
+ * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
472
+ */
473
+ static exposeLogicError(e, appSpec, details) {
474
+ const { isClearStateProgram, approvalSourceMap, clearSourceMap, program } = details;
475
+ const sourceMap = isClearStateProgram ? clearSourceMap : approvalSourceMap;
476
+ const errorDetails = require_logic_error.LogicError.parseLogicError(e);
477
+ if (errorDetails === void 0 || errorDetails?.pc === void 0) return e;
478
+ /** The PC value to find in the ARC56 SourceInfo */
479
+ let arc56Pc = errorDetails?.pc;
480
+ const programSourceInfo = isClearStateProgram ? appSpec.sourceInfo?.clear : appSpec.sourceInfo?.approval;
481
+ /** The offset to apply to the PC if using the cblocks pc offset method */
482
+ let cblocksOffset = 0;
483
+ if (programSourceInfo?.pcOffsetMethod === "cblocks") {
484
+ if (program === void 0) throw new Error("Program bytes are required to calculate the ARC56 cblocks PC offset");
485
+ cblocksOffset = getConstantBlockOffset(program);
486
+ arc56Pc = errorDetails.pc - cblocksOffset;
487
+ }
488
+ const errorMessage = (programSourceInfo?.sourceInfo.find((s) => s.pc.includes(arc56Pc)))?.errorMessage;
489
+ if (appSpec.source) {
490
+ let getLineForPc = (inputPc) => sourceMap?.getLocationForPc?.(inputPc)?.line;
491
+ if (sourceMap === void 0) getLineForPc = (inputPc) => {
492
+ const teal = programSourceInfo?.sourceInfo.find((s) => s.pc.includes(inputPc - cblocksOffset))?.teal;
493
+ if (teal === void 0) return void 0;
494
+ return teal - 1;
495
+ };
496
+ e = new require_logic_error.LogicError(errorDetails, buffer.Buffer.from(isClearStateProgram ? appSpec.source.clear : appSpec.source.approval, "base64").toString().split("\n"), getLineForPc);
497
+ }
498
+ if (errorMessage) {
499
+ const appId = require_util.asJson(e).match(/(?<=app=)\d+/)?.[0] || "";
500
+ const txId = require_util.asJson(e).match(/(?<=transaction )\S+(?=:)/)?.[0];
501
+ const error = /* @__PURE__ */ new Error(`Runtime error when executing ${appSpec.name} (appId: ${appId}) in transaction ${txId}: ${errorMessage}`);
502
+ error.cause = e;
503
+ return error;
504
+ }
505
+ return e;
506
+ }
507
+ /**
508
+ * Compiles the approval and clear state programs (if TEAL templates provided),
509
+ * performing any provided deploy-time parameter replacement and returns
510
+ * the compiled code and any compilation results (including source maps).
511
+ *
512
+ * If no TEAL templates provided it will use any byte code provided in the app spec.
513
+ *
514
+ * Will store any generated source maps for later use in debugging.
515
+ * @param appSpec The app spec for the app
516
+ * @param appManager The app manager to use for compilation
517
+ * @param compilation Any compilation parameters to use
518
+ * @returns The compiled code and any compilation results (including source maps)
519
+ */
520
+ static async compile(appSpec, appManager, compilation) {
521
+ const { deployTimeParams, updatable, deletable } = compilation ?? {};
522
+ if (!appSpec.source) {
523
+ if (!appSpec.byteCode?.approval || !appSpec.byteCode?.clear) throw new Error(`Attempt to compile app ${appSpec.name} without source or byteCode`);
524
+ return {
525
+ approvalProgram: buffer.Buffer.from(appSpec.byteCode.approval, "base64"),
526
+ clearStateProgram: buffer.Buffer.from(appSpec.byteCode.clear, "base64")
527
+ };
528
+ }
529
+ const approvalTemplate = buffer.Buffer.from(appSpec.source.approval, "base64").toString("utf-8");
530
+ const compiledApproval = await appManager.compileTealTemplate(approvalTemplate, deployTimeParams, {
531
+ updatable,
532
+ deletable
533
+ });
534
+ const clearTemplate = buffer.Buffer.from(appSpec.source.clear, "base64").toString("utf-8");
535
+ const compiledClear = await appManager.compileTealTemplate(clearTemplate, deployTimeParams);
536
+ if (require_config.Config.debug) await require_config.Config.events.emitAsync(require_lifecycle_events.EventType.AppCompiled, { sources: [{
537
+ compiledTeal: compiledApproval,
538
+ appName: appSpec.name,
539
+ fileName: "approval"
540
+ }, {
541
+ compiledTeal: compiledClear,
542
+ appName: appSpec.name,
543
+ fileName: "clear"
544
+ }] });
545
+ return {
546
+ approvalProgram: compiledApproval.compiledBase64ToBytes,
547
+ compiledApproval,
548
+ clearStateProgram: compiledClear.compiledBase64ToBytes,
549
+ compiledClear
550
+ };
551
+ }
552
+ /**
553
+ * Returns ABI method arguments ready for a method call params object with default values populated
554
+ * and structs replaced with tuples.
555
+ *
556
+ * It does this by replacing any `undefined` values with the equivalent default value from the given ARC-56 app spec.
557
+ * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
558
+ * e.g. `my_method` or `my_method(unit64,string)bytes`
559
+ * @param args The arguments to the method with `undefined` for any that should be populated with a default value
560
+ */
561
+ async getABIArgsWithDefaultValues(methodNameOrSignature, args, sender) {
562
+ const m = require_abi_method.getABIMethod(methodNameOrSignature, this._appSpec);
563
+ return await Promise.all(args?.map(async (arg, i) => {
564
+ const methodArg = m.args[i];
565
+ if (!methodArg) throw new Error(`Unexpected arg at position ${i}. ${m.name} only expects ${m.args.length} args`);
566
+ if (require_abi_method.argTypeIsTransaction(methodArg.type)) return arg;
567
+ if (arg !== void 0) return arg;
568
+ const defaultValue = methodArg.defaultValue;
569
+ if (defaultValue) switch (defaultValue.source) {
570
+ case "literal": {
571
+ const bytes = buffer.Buffer.from(defaultValue.data, "base64");
572
+ return require_abi_method.getABIDecodedValue(defaultValue.type ?? methodArg.type, bytes);
573
+ }
574
+ case "method": {
575
+ const method = this.getABIMethod(defaultValue.data);
576
+ const result = await this.send.call({
577
+ method: defaultValue.data,
578
+ args: method.args.map(() => void 0),
579
+ sender
580
+ });
581
+ if (result.return === void 0) throw new Error("Default value method call did not return a value");
582
+ return result.return;
583
+ }
584
+ case "local":
585
+ case "global":
586
+ case "box": return await this.getDefaultValueFromStorage({
587
+ data: defaultValue.data,
588
+ source: defaultValue.source
589
+ }, methodArg.name ?? `arg${i + 1}`, sender);
590
+ }
591
+ }) ?? []);
592
+ }
593
+ async getDefaultValueFromStorage(defaultValue, argName, sender) {
594
+ const keys = defaultValue.source === "box" ? require_arc56_contract.getBoxABIStorageKeys(this.appSpec) : defaultValue.source === "global" ? require_arc56_contract.getGlobalABIStorageKeys(this.appSpec) : require_arc56_contract.getLocalABIStorageKeys(this.appSpec);
595
+ const key = Object.values(keys).find((s) => s.key === defaultValue.data);
596
+ if (!key) throw new Error(`Unable to find default value for argument '${argName}': The storage key (base64: '${defaultValue.data}') is not defined in the contract's ${defaultValue.source} storage schema`);
597
+ if (defaultValue.source === "box") {
598
+ const value$1 = await this.getBoxValue(buffer.Buffer.from(defaultValue.data, "base64"));
599
+ return require_abi_method.getABIDecodedValue(key.valueType, value$1);
600
+ }
601
+ const state = defaultValue.source === "global" ? await this.getGlobalState() : await this.getLocalState(sender);
602
+ const value = Object.values(state).find((s) => s.keyBase64 === defaultValue.data);
603
+ if (!value) throw new Error(`Unable to find default value for argument '${argName}': No value exists in ${defaultValue.source} storage for key (base64: '${defaultValue.data}')`);
604
+ return "valueRaw" in value ? require_abi_method.getABIDecodedValue(key.valueType, value.valueRaw) : value.value;
605
+ }
606
+ getBareParamsMethods() {
607
+ return {
608
+ update: async (params) => {
609
+ return this.getBareParams({
610
+ ...params,
611
+ ...await this.compile(params)
612
+ }, require_app_call.OnApplicationComplete.UpdateApplication);
613
+ },
614
+ optIn: (params) => {
615
+ return this.getBareParams(params, require_app_call.OnApplicationComplete.OptIn);
616
+ },
617
+ delete: (params) => {
618
+ return this.getBareParams(params, require_app_call.OnApplicationComplete.DeleteApplication);
619
+ },
620
+ clearState: (params) => {
621
+ return this.getBareParams(params, require_app_call.OnApplicationComplete.ClearState);
622
+ },
623
+ closeOut: (params) => {
624
+ return this.getBareParams(params, require_app_call.OnApplicationComplete.CloseOut);
625
+ },
626
+ call: (params) => {
627
+ return this.getBareParams(params, params?.onComplete ?? require_app_call.OnApplicationComplete.NoOp);
628
+ }
629
+ };
630
+ }
631
+ getBareCreateTransactionMethods() {
632
+ return {
633
+ update: async (params) => {
634
+ return this._algorand.createTransaction.appUpdate(await this.params.bare.update(params));
635
+ },
636
+ optIn: (params) => {
637
+ return this._algorand.createTransaction.appCall(this.params.bare.optIn(params));
638
+ },
639
+ delete: (params) => {
640
+ return this._algorand.createTransaction.appDelete(this.params.bare.delete(params));
641
+ },
642
+ clearState: (params) => {
643
+ return this._algorand.createTransaction.appCall(this.params.bare.clearState(params));
644
+ },
645
+ closeOut: (params) => {
646
+ return this._algorand.createTransaction.appCall(this.params.bare.closeOut(params));
647
+ },
648
+ call: (params) => {
649
+ return this._algorand.createTransaction.appCall(this.params.bare.call(params));
650
+ }
651
+ };
652
+ }
653
+ getBareSendMethods() {
654
+ return {
655
+ update: async (params) => {
656
+ const compiled = await this.compile(params);
657
+ return {
658
+ ...await this._algorand.send.appUpdate(await this.params.bare.update(params)),
659
+ ...compiled
660
+ };
661
+ },
662
+ optIn: (params) => {
663
+ return this._algorand.send.appCall(this.params.bare.optIn(params));
664
+ },
665
+ delete: (params) => {
666
+ return this._algorand.send.appDelete(this.params.bare.delete(params));
667
+ },
668
+ clearState: (params) => {
669
+ return this._algorand.send.appCall(this.params.bare.clearState(params));
670
+ },
671
+ closeOut: (params) => {
672
+ return this._algorand.send.appCall(this.params.bare.closeOut(params));
673
+ },
674
+ call: (params) => {
675
+ return this._algorand.send.appCall(this.params.bare.call(params));
676
+ }
677
+ };
678
+ }
679
+ getMethodCallParamsMethods() {
680
+ return {
681
+ fundAppAccount: (params) => {
682
+ return {
683
+ ...params,
684
+ sender: this.getSender(params.sender),
685
+ signer: this.getSigner(params.sender, params.signer),
686
+ receiver: this.appAddress
687
+ };
688
+ },
689
+ update: async (params) => {
690
+ return await this.getABIParams({
691
+ ...params,
692
+ ...await this.compile(params)
693
+ }, require_app_call.OnApplicationComplete.UpdateApplication);
694
+ },
695
+ optIn: async (params) => {
696
+ return await this.getABIParams(params, require_app_call.OnApplicationComplete.OptIn);
697
+ },
698
+ delete: async (params) => {
699
+ return await this.getABIParams(params, require_app_call.OnApplicationComplete.DeleteApplication);
700
+ },
701
+ closeOut: async (params) => {
702
+ return await this.getABIParams(params, require_app_call.OnApplicationComplete.CloseOut);
703
+ },
704
+ call: async (params) => {
705
+ return await this.getABIParams(params, params.onComplete ?? require_app_call.OnApplicationComplete.NoOp);
706
+ }
707
+ };
708
+ }
709
+ getMethodCallSendMethods() {
710
+ return {
711
+ fundAppAccount: (params) => {
712
+ return this._algorand.send.payment(this.params.fundAppAccount(params));
713
+ },
714
+ update: async (params) => {
715
+ const compiled = await this.compile(params);
716
+ return {
717
+ ...await this.processMethodCallReturn(this._algorand.send.appUpdateMethodCall(await this.params.update({ ...params }))),
718
+ ...compiled
719
+ };
720
+ },
721
+ optIn: async (params) => {
722
+ return this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.optIn(params)));
723
+ },
724
+ delete: async (params) => {
725
+ return this.processMethodCallReturn(this._algorand.send.appDeleteMethodCall(await this.params.delete(params)));
726
+ },
727
+ closeOut: async (params) => {
728
+ return this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.closeOut(params)));
729
+ },
730
+ call: async (params) => {
731
+ if ((params.onComplete === require_app_call.OnApplicationComplete.NoOp || !params.onComplete) && require_abi_method.getABIMethod(params.method, this._appSpec).readonly) {
732
+ const readonlyParams = { ...params };
733
+ if (params.coverAppCallInnerTransactionFees && params.maxFee) {
734
+ readonlyParams.staticFee = params.maxFee;
735
+ readonlyParams.extraFee = void 0;
736
+ }
737
+ try {
738
+ const result = await this._algorand.newGroup().addAppCallMethodCall(await this.params.call(readonlyParams)).simulate({
739
+ allowUnnamedResources: params.populateAppCallResources ?? true,
740
+ skipSignatures: true,
741
+ extraOpcodeBudget: MAX_SIMULATE_OPCODE_BUDGET
742
+ });
743
+ return this.processMethodCallReturn({
744
+ ...result,
745
+ transaction: result.transactions.at(-1),
746
+ confirmation: result.confirmations.at(-1),
747
+ return: result.returns && result.returns.length > 0 ? result.returns.at(-1) : void 0
748
+ });
749
+ } catch (e) {
750
+ const error = e;
751
+ if (params.coverAppCallInnerTransactionFees && error && error.message && error.message.match(/fee too small/)) throw Error(`Fees were too small. You may need to increase the transaction maxFee.`);
752
+ throw e;
753
+ }
754
+ }
755
+ return this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.call(params)));
756
+ }
757
+ };
758
+ }
759
+ getMethodCallCreateTransactionMethods() {
760
+ return {
761
+ fundAppAccount: (params) => {
762
+ return this._algorand.createTransaction.payment(this.params.fundAppAccount(params));
763
+ },
764
+ update: async (params) => {
765
+ return this._algorand.createTransaction.appUpdateMethodCall(await this.params.update(params));
766
+ },
767
+ optIn: async (params) => {
768
+ return this._algorand.createTransaction.appCallMethodCall(await this.params.optIn(params));
769
+ },
770
+ delete: async (params) => {
771
+ return this._algorand.createTransaction.appDeleteMethodCall(await this.params.delete(params));
772
+ },
773
+ closeOut: async (params) => {
774
+ return this._algorand.createTransaction.appCallMethodCall(await this.params.closeOut(params));
775
+ },
776
+ call: async (params) => {
777
+ return this._algorand.createTransaction.appCallMethodCall(await this.params.call(params));
778
+ }
779
+ };
780
+ }
781
+ /** Returns the sender for a call, using the provided sender or using the `defaultSender`
782
+ * if none provided and throws an error if neither provided */
783
+ getSender(sender) {
784
+ if (!sender && !this._defaultSender) throw new Error(`No sender provided and no default sender present in app client for call to app ${this._appName}`);
785
+ return require_address.getAddress(sender ?? this._defaultSender);
786
+ }
787
+ /** Returns the signer for a call, using the provided signer or the `defaultSigner`
788
+ * if no signer was provided and the sender resolves to the default sender, the call will use default signer
789
+ * or `undefined` otherwise (so the signer is resolved from `AlgorandClient`) */
790
+ getSigner(sender, signer) {
791
+ return signer ?? (!sender || sender === this._defaultSender ? this._defaultSigner : void 0);
792
+ }
793
+ getBareParams(params, onComplete) {
794
+ return {
795
+ ...params,
796
+ appId: this._appId,
797
+ sender: this.getSender(params?.sender),
798
+ signer: this.getSigner(params?.sender, params?.signer),
799
+ onComplete
800
+ };
801
+ }
802
+ async getABIParams(params, onComplete) {
803
+ const sender = this.getSender(params.sender);
804
+ const method = require_abi_method.getABIMethod(params.method, this._appSpec);
805
+ const args = await this.getABIArgsWithDefaultValues(params.method, params.args, sender);
806
+ return {
807
+ ...params,
808
+ appId: this._appId,
809
+ sender,
810
+ signer: this.getSigner(params.sender, params.signer),
811
+ method,
812
+ onComplete,
813
+ args
814
+ };
815
+ }
816
+ /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */
817
+ handleCallErrors = async (e) => {
818
+ if (this.appId === 0n) {
819
+ if (e.sentTransactions === void 0) return e;
820
+ const txn = e.sentTransactions.find((t) => e.message.includes(t.txId()));
821
+ const programsDefinedAndEqual = (a, b) => {
822
+ if (a === void 0 || b === void 0) return false;
823
+ if (a.length !== b.length) return false;
824
+ for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
825
+ return true;
826
+ };
827
+ if (!programsDefinedAndEqual(txn?.appCall?.clearStateProgram, this._lastCompiled.clear) || !programsDefinedAndEqual(txn?.appCall?.approvalProgram, this._lastCompiled?.approval)) return e;
828
+ } else {
829
+ const appIdString = `app=${this._appId.toString()}`;
830
+ if (!e.message.includes(appIdString)) return e;
831
+ }
832
+ const logicError = await this.exposeLogicError(e);
833
+ if (logicError instanceof require_logic_error.LogicError) {
834
+ let currentLine = logicError.teal_line - logicError.lines - 1;
835
+ const stackWithLines = logicError.stack?.split("\n").map((line) => `${currentLine += 1}: ${line}`).join("\n");
836
+ require_config.Config.logger.error(`${logicError.message}\n\n${stackWithLines}`);
837
+ }
838
+ return logicError;
839
+ };
840
+ getBoxMethods() {
841
+ const that = this;
842
+ const stateMethods = {
843
+ getAll: async () => {
844
+ return Object.fromEntries(await Promise.all(Object.keys(that._appSpec.state.keys.box).map(async (key) => [key, await stateMethods.getValue(key)])));
845
+ },
846
+ getValue: async (name) => {
847
+ const metadata = require_arc56_contract.getBoxABIStorageKey(that._appSpec, name);
848
+ const value = await that.getBoxValue(buffer.Buffer.from(metadata.key, "base64"));
849
+ return require_abi_method.getABIDecodedValue(metadata.valueType, value);
850
+ },
851
+ getMapValue: async (mapName, key) => {
852
+ const metadata = require_arc56_contract.getBoxABIStorageMap(that._appSpec, mapName);
853
+ const prefix = buffer.Buffer.from(metadata.prefix ?? "", "base64");
854
+ const encodedKey = buffer.Buffer.concat([prefix, require_abi_method.getABIEncodedValue(metadata.keyType, key)]);
855
+ const base64Key = buffer.Buffer.from(encodedKey).toString("base64");
856
+ const value = await that.getBoxValue(buffer.Buffer.from(base64Key, "base64"));
857
+ return require_abi_method.getABIDecodedValue(metadata.valueType, value);
858
+ },
859
+ getMap: async (mapName) => {
860
+ const metadata = require_arc56_contract.getBoxABIStorageMap(that._appSpec, mapName);
861
+ const prefix = buffer.Buffer.from(metadata.prefix ?? "", "base64");
862
+ const boxNames = await that.getBoxNames();
863
+ return new Map(await Promise.all(boxNames.filter((b) => require_util.binaryStartsWith(b.nameRaw, prefix)).map(async (b) => {
864
+ return [require_abi_method.getABIDecodedValue(metadata.keyType, b.nameRaw.slice(prefix.length)), require_abi_method.getABIDecodedValue(metadata.valueType, await that.getBoxValue(b.nameRaw))];
865
+ })));
866
+ }
867
+ };
868
+ return stateMethods;
869
+ }
870
+ getStateMethods(stateGetter, keyGetter, mapGetter) {
871
+ const stateMethods = {
872
+ getAll: async () => {
873
+ const appState = await stateGetter();
874
+ return Object.fromEntries(await Promise.all(Object.keys(keyGetter()).map(async (key) => [key, await stateMethods.getValue(key, appState)])));
875
+ },
876
+ getValue: async (name, appState) => {
877
+ const state = Object.values(appState ?? await stateGetter());
878
+ const metadata = keyGetter()[name];
879
+ if (metadata === void 0) throw new Error(`Attempted to get state value ${name}, but it does not exist`);
880
+ const value = state.find((s) => s.keyBase64 === metadata.key);
881
+ if (value && "valueRaw" in value) return require_abi_method.getABIDecodedValue(metadata.valueType, value.valueRaw);
882
+ return value?.value;
883
+ },
884
+ getMapValue: async (mapName, key, appState) => {
885
+ const state = Object.values(appState ?? await stateGetter());
886
+ const metadata = mapGetter()[mapName];
887
+ const prefix = buffer.Buffer.from(metadata.prefix ?? "", "base64");
888
+ const encodedKey = buffer.Buffer.concat([prefix, require_abi_method.getABIEncodedValue(metadata.keyType, key)]);
889
+ const base64Key = buffer.Buffer.from(encodedKey).toString("base64");
890
+ const value = state.find((s) => s.keyBase64 === base64Key);
891
+ if (value && "valueRaw" in value) return require_abi_method.getABIDecodedValue(metadata.valueType, value.valueRaw);
892
+ return value?.value;
893
+ },
894
+ getMap: async (mapName) => {
895
+ const state = Object.values(await stateGetter());
896
+ const metadata = mapGetter()[mapName];
897
+ const prefix = buffer.Buffer.from(metadata.prefix ?? "", "base64");
898
+ return new Map(state.filter((s) => require_util.binaryStartsWith(s.keyRaw, prefix)).map((s) => {
899
+ const key = s.keyRaw.slice(prefix.length);
900
+ return [require_abi_method.getABIDecodedValue(metadata.keyType, key), "valueRaw" in s ? require_abi_method.getABIDecodedValue(metadata.valueType, s.valueRaw) : s.value];
901
+ }));
902
+ }
903
+ };
904
+ return stateMethods;
905
+ }
906
+ };
1801
907
 
908
+ //#endregion
1802
909
  exports.AppClient = AppClient;
1803
- exports.ApplicationClient = ApplicationClient;
1804
- //# sourceMappingURL=app-client.js.map
910
+ //# sourceMappingURL=app-client.js.map