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