@algorandfoundation/algokit-utils 10.0.0-alpha.1 → 10.0.0-alpha.10

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 (316) hide show
  1. package/README.md +27 -5
  2. package/_virtual/rolldown_runtime.js +20 -11
  3. package/_virtual/rolldown_runtime.mjs +10 -5
  4. package/algo25/index.d.ts +2 -0
  5. package/algo25/index.js +9 -0
  6. package/algo25/index.mjs +3 -0
  7. package/algod-client/index.d.ts +2 -5
  8. package/package.json +1 -1
  9. package/packages/abi/src/abi-method.d.ts +1 -1
  10. package/packages/abi/src/abi-method.js.map +1 -1
  11. package/packages/abi/src/abi-method.mjs.map +1 -1
  12. package/packages/abi/src/abi-type.d.ts +1 -1
  13. package/packages/abi/src/abi-type.js +2 -1
  14. package/packages/abi/src/abi-type.js.map +1 -1
  15. package/packages/abi/src/abi-type.mjs +2 -1
  16. package/packages/abi/src/abi-type.mjs.map +1 -1
  17. package/packages/abi/src/arc56-contract.js +1 -0
  18. package/packages/abi/src/arc56-contract.js.map +1 -1
  19. package/packages/abi/src/arc56-contract.mjs +1 -0
  20. package/packages/abi/src/arc56-contract.mjs.map +1 -1
  21. package/packages/algo25/src/english.js.map +1 -1
  22. package/packages/algo25/src/english.mjs.map +1 -1
  23. package/packages/algo25/src/index.d.ts +40 -0
  24. package/packages/algo25/src/index.js +44 -0
  25. package/packages/algo25/src/index.js.map +1 -1
  26. package/packages/algo25/src/index.mjs +39 -1
  27. package/packages/algo25/src/index.mjs.map +1 -1
  28. package/packages/algod_client/src/apis/api-service.d.ts +44 -44
  29. package/packages/algod_client/src/apis/api-service.js +153 -153
  30. package/packages/algod_client/src/apis/api-service.js.map +1 -1
  31. package/packages/algod_client/src/apis/api-service.mjs +153 -153
  32. package/packages/algod_client/src/apis/api-service.mjs.map +1 -1
  33. package/packages/algod_client/src/core/api-error.js +3 -1
  34. package/packages/algod_client/src/core/api-error.js.map +1 -1
  35. package/packages/algod_client/src/core/api-error.mjs +3 -1
  36. package/packages/algod_client/src/core/api-error.mjs.map +1 -1
  37. package/packages/algod_client/src/core/model-runtime.js +4 -4
  38. package/packages/algod_client/src/core/model-runtime.js.map +1 -1
  39. package/packages/algod_client/src/core/model-runtime.mjs +6 -6
  40. package/packages/algod_client/src/core/model-runtime.mjs.map +1 -1
  41. package/packages/algod_client/src/models/account-participation.js +4 -4
  42. package/packages/algod_client/src/models/account-participation.js.map +1 -1
  43. package/packages/algod_client/src/models/account-participation.mjs +4 -4
  44. package/packages/algod_client/src/models/account-participation.mjs.map +1 -1
  45. package/packages/algod_client/src/models/application-state-schema.d.ts +2 -2
  46. package/packages/algod_client/src/models/application-state-schema.js +2 -2
  47. package/packages/algod_client/src/models/application-state-schema.js.map +1 -1
  48. package/packages/algod_client/src/models/application-state-schema.mjs +2 -2
  49. package/packages/algod_client/src/models/application-state-schema.mjs.map +1 -1
  50. package/packages/algod_client/src/models/asset-params.js +2 -1
  51. package/packages/algod_client/src/models/asset-params.js.map +1 -1
  52. package/packages/algod_client/src/models/asset-params.mjs +2 -1
  53. package/packages/algod_client/src/models/asset-params.mjs.map +1 -1
  54. package/packages/algod_client/src/models/block-response.js +1 -2
  55. package/packages/algod_client/src/models/block-response.js.map +1 -1
  56. package/packages/algod_client/src/models/block-response.mjs +2 -3
  57. package/packages/algod_client/src/models/block-response.mjs.map +1 -1
  58. package/packages/algod_client/src/models/block.d.ts +49 -29
  59. package/packages/algod_client/src/models/block.js +174 -98
  60. package/packages/algod_client/src/models/block.js.map +1 -1
  61. package/packages/algod_client/src/models/block.mjs +174 -98
  62. package/packages/algod_client/src/models/block.mjs.map +1 -1
  63. package/packages/algod_client/src/models/ledger-state-delta.js +1 -1
  64. package/packages/algod_client/src/models/ledger-state-delta.js.map +1 -1
  65. package/packages/algod_client/src/models/ledger-state-delta.mjs +2 -2
  66. package/packages/algod_client/src/models/ledger-state-delta.mjs.map +1 -1
  67. package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.d.ts +3 -5
  68. package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.js +4 -6
  69. package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.js.map +1 -1
  70. package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.mjs +3 -5
  71. package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.mjs.map +1 -1
  72. package/packages/algod_client/src/models/transaction-parameters-response.js +2 -2
  73. package/packages/algod_client/src/models/transaction-parameters-response.js.map +1 -1
  74. package/packages/algod_client/src/models/transaction-parameters-response.mjs +2 -2
  75. package/packages/algod_client/src/models/transaction-parameters-response.mjs.map +1 -1
  76. package/packages/common/src/address.js +0 -14
  77. package/packages/common/src/address.js.map +1 -1
  78. package/packages/common/src/address.mjs +1 -14
  79. package/packages/common/src/address.mjs.map +1 -1
  80. package/packages/common/src/codecs/composite/map.js +7 -4
  81. package/packages/common/src/codecs/composite/map.js.map +1 -1
  82. package/packages/common/src/codecs/composite/map.mjs +7 -4
  83. package/packages/common/src/codecs/composite/map.mjs.map +1 -1
  84. package/packages/common/src/codecs/composite/record.js +0 -1
  85. package/packages/common/src/codecs/composite/record.js.map +1 -1
  86. package/packages/common/src/codecs/primitives/address.js +0 -1
  87. package/packages/common/src/codecs/primitives/address.js.map +1 -1
  88. package/packages/common/src/codecs/primitives/bytes.js +0 -1
  89. package/packages/common/src/codecs/primitives/bytes.js.map +1 -1
  90. package/packages/common/src/codecs/primitives/fixed-bytes.js +0 -1
  91. package/packages/common/src/codecs/primitives/fixed-bytes.js.map +1 -1
  92. package/packages/common/src/codecs/wire.js +0 -1
  93. package/packages/common/src/codecs/wire.js.map +1 -1
  94. package/packages/common/src/json.mjs +2 -2
  95. package/packages/common/src/json.mjs.map +1 -1
  96. package/packages/common/src/msgpack.js +0 -1
  97. package/packages/common/src/msgpack.js.map +1 -1
  98. package/packages/indexer_client/src/apis/api-service.d.ts +1 -1
  99. package/packages/indexer_client/src/apis/api-service.js +12 -12
  100. package/packages/indexer_client/src/apis/api-service.js.map +1 -1
  101. package/packages/indexer_client/src/apis/api-service.mjs +12 -12
  102. package/packages/indexer_client/src/apis/api-service.mjs.map +1 -1
  103. package/packages/indexer_client/src/core/api-error.js +3 -1
  104. package/packages/indexer_client/src/core/api-error.js.map +1 -1
  105. package/packages/indexer_client/src/core/api-error.mjs +3 -1
  106. package/packages/indexer_client/src/core/api-error.mjs.map +1 -1
  107. package/packages/indexer_client/src/core/model-runtime.js +4 -4
  108. package/packages/indexer_client/src/core/model-runtime.js.map +1 -1
  109. package/packages/indexer_client/src/core/model-runtime.mjs +6 -6
  110. package/packages/indexer_client/src/core/model-runtime.mjs.map +1 -1
  111. package/packages/indexer_client/src/models/account-participation.js +4 -4
  112. package/packages/indexer_client/src/models/account-participation.js.map +1 -1
  113. package/packages/indexer_client/src/models/account-participation.mjs +4 -4
  114. package/packages/indexer_client/src/models/account-participation.mjs.map +1 -1
  115. package/packages/indexer_client/src/models/application-state-schema.d.ts +2 -2
  116. package/packages/indexer_client/src/models/application-state-schema.js +2 -2
  117. package/packages/indexer_client/src/models/application-state-schema.js.map +1 -1
  118. package/packages/indexer_client/src/models/application-state-schema.mjs +2 -2
  119. package/packages/indexer_client/src/models/application-state-schema.mjs.map +1 -1
  120. package/packages/indexer_client/src/models/asset-params.js +2 -1
  121. package/packages/indexer_client/src/models/asset-params.js.map +1 -1
  122. package/packages/indexer_client/src/models/asset-params.mjs +2 -1
  123. package/packages/indexer_client/src/models/asset-params.mjs.map +1 -1
  124. package/packages/indexer_client/src/models/block.js +8 -8
  125. package/packages/indexer_client/src/models/block.js.map +1 -1
  126. package/packages/indexer_client/src/models/block.mjs +8 -8
  127. package/packages/indexer_client/src/models/block.mjs.map +1 -1
  128. package/packages/indexer_client/src/models/eval-delta-key-value.d.ts +1 -1
  129. package/packages/indexer_client/src/models/eval-delta-key-value.js +2 -2
  130. package/packages/indexer_client/src/models/eval-delta-key-value.js.map +1 -1
  131. package/packages/indexer_client/src/models/eval-delta-key-value.mjs +2 -2
  132. package/packages/indexer_client/src/models/eval-delta-key-value.mjs.map +1 -1
  133. package/packages/indexer_client/src/models/eval-delta.d.ts +1 -1
  134. package/packages/indexer_client/src/models/eval-delta.js +2 -2
  135. package/packages/indexer_client/src/models/eval-delta.js.map +1 -1
  136. package/packages/indexer_client/src/models/eval-delta.mjs +2 -2
  137. package/packages/indexer_client/src/models/eval-delta.mjs.map +1 -1
  138. package/packages/indexer_client/src/models/hb-proof-fields.js +6 -6
  139. package/packages/indexer_client/src/models/hb-proof-fields.js.map +1 -1
  140. package/packages/indexer_client/src/models/hb-proof-fields.mjs +6 -6
  141. package/packages/indexer_client/src/models/hb-proof-fields.mjs.map +1 -1
  142. package/packages/indexer_client/src/models/state-proof-verifier.js +2 -2
  143. package/packages/indexer_client/src/models/state-proof-verifier.js.map +1 -1
  144. package/packages/indexer_client/src/models/state-proof-verifier.mjs +2 -2
  145. package/packages/indexer_client/src/models/state-proof-verifier.mjs.map +1 -1
  146. package/packages/indexer_client/src/models/state-schema.d.ts +2 -2
  147. package/packages/indexer_client/src/models/state-schema.js +2 -2
  148. package/packages/indexer_client/src/models/state-schema.js.map +1 -1
  149. package/packages/indexer_client/src/models/state-schema.mjs +2 -2
  150. package/packages/indexer_client/src/models/state-schema.mjs.map +1 -1
  151. package/packages/indexer_client/src/models/teal-key-value.d.ts +1 -1
  152. package/packages/indexer_client/src/models/teal-key-value.js +2 -2
  153. package/packages/indexer_client/src/models/teal-key-value.js.map +1 -1
  154. package/packages/indexer_client/src/models/teal-key-value.mjs +2 -2
  155. package/packages/indexer_client/src/models/teal-key-value.mjs.map +1 -1
  156. package/packages/indexer_client/src/models/transaction-heartbeat.js +2 -1
  157. package/packages/indexer_client/src/models/transaction-heartbeat.js.map +1 -1
  158. package/packages/indexer_client/src/models/transaction-heartbeat.mjs +2 -1
  159. package/packages/indexer_client/src/models/transaction-heartbeat.mjs.map +1 -1
  160. package/packages/indexer_client/src/models/transaction-keyreg.js +4 -4
  161. package/packages/indexer_client/src/models/transaction-keyreg.js.map +1 -1
  162. package/packages/indexer_client/src/models/transaction-keyreg.mjs +4 -4
  163. package/packages/indexer_client/src/models/transaction-keyreg.mjs.map +1 -1
  164. package/packages/indexer_client/src/models/transaction-signature-logicsig.js +2 -1
  165. package/packages/indexer_client/src/models/transaction-signature-logicsig.js.map +1 -1
  166. package/packages/indexer_client/src/models/transaction-signature-logicsig.mjs +2 -1
  167. package/packages/indexer_client/src/models/transaction-signature-logicsig.mjs.map +1 -1
  168. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.js +3 -3
  169. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.js.map +1 -1
  170. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.mjs +3 -3
  171. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.mjs.map +1 -1
  172. package/packages/indexer_client/src/models/transaction.d.ts +2 -2
  173. package/packages/indexer_client/src/models/transaction.js +6 -5
  174. package/packages/indexer_client/src/models/transaction.js.map +1 -1
  175. package/packages/indexer_client/src/models/transaction.mjs +6 -5
  176. package/packages/indexer_client/src/models/transaction.mjs.map +1 -1
  177. package/packages/kmd_client/src/apis/api-service.d.ts +5 -5
  178. package/packages/kmd_client/src/apis/api-service.js +32 -32
  179. package/packages/kmd_client/src/apis/api-service.js.map +1 -1
  180. package/packages/kmd_client/src/apis/api-service.mjs +32 -32
  181. package/packages/kmd_client/src/apis/api-service.mjs.map +1 -1
  182. package/packages/kmd_client/src/core/api-error.js +3 -1
  183. package/packages/kmd_client/src/core/api-error.js.map +1 -1
  184. package/packages/kmd_client/src/core/api-error.mjs +3 -1
  185. package/packages/kmd_client/src/core/api-error.mjs.map +1 -1
  186. package/packages/kmd_client/src/core/model-runtime.js +4 -4
  187. package/packages/kmd_client/src/core/model-runtime.js.map +1 -1
  188. package/packages/kmd_client/src/core/model-runtime.mjs +6 -6
  189. package/packages/kmd_client/src/core/model-runtime.mjs.map +1 -1
  190. package/packages/sdk/src/encoding/encoding.js +12 -2
  191. package/packages/sdk/src/encoding/encoding.js.map +1 -1
  192. package/packages/sdk/src/encoding/encoding.mjs +12 -1
  193. package/packages/sdk/src/encoding/encoding.mjs.map +1 -1
  194. package/packages/sdk/src/encoding/schema/map.js +0 -2
  195. package/packages/sdk/src/encoding/schema/map.js.map +1 -1
  196. package/packages/sdk/src/utils/utils.mjs +2 -2
  197. package/packages/sdk/src/utils/utils.mjs.map +1 -1
  198. package/packages/transact/src/logicsig.d.ts +3 -15
  199. package/packages/transact/src/logicsig.js +16 -36
  200. package/packages/transact/src/logicsig.js.map +1 -1
  201. package/packages/transact/src/logicsig.mjs +18 -36
  202. package/packages/transact/src/logicsig.mjs.map +1 -1
  203. package/packages/transact/src/multisig.d.ts +7 -115
  204. package/packages/transact/src/multisig.js +86 -136
  205. package/packages/transact/src/multisig.js.map +1 -1
  206. package/packages/transact/src/multisig.mjs +87 -117
  207. package/packages/transact/src/multisig.mjs.map +1 -1
  208. package/packages/transact/src/transactions/app-call.d.ts +10 -10
  209. package/packages/transact/src/transactions/app-call.js.map +1 -1
  210. package/packages/transact/src/transactions/app-call.mjs.map +1 -1
  211. package/packages/transact/src/transactions/reference-types-meta.d.ts +26 -0
  212. package/packages/transact/src/transactions/reference-types-meta.js +71 -0
  213. package/packages/transact/src/transactions/reference-types-meta.js.map +1 -0
  214. package/packages/transact/src/transactions/reference-types-meta.mjs +69 -0
  215. package/packages/transact/src/transactions/reference-types-meta.mjs.map +1 -0
  216. package/packages/transact/src/transactions/signed-transaction-meta.js +2 -3
  217. package/packages/transact/src/transactions/signed-transaction-meta.js.map +1 -1
  218. package/packages/transact/src/transactions/signed-transaction-meta.mjs +3 -3
  219. package/packages/transact/src/transactions/signed-transaction-meta.mjs.map +1 -1
  220. package/packages/transact/src/transactions/signed-transaction.d.ts +2 -2
  221. package/packages/transact/src/transactions/signed-transaction.js.map +1 -1
  222. package/packages/transact/src/transactions/signed-transaction.mjs.map +1 -1
  223. package/packages/transact/src/transactions/transaction-meta.js +29 -23
  224. package/packages/transact/src/transactions/transaction-meta.js.map +1 -1
  225. package/packages/transact/src/transactions/transaction-meta.mjs +29 -23
  226. package/packages/transact/src/transactions/transaction-meta.mjs.map +1 -1
  227. package/packages/transact/src/transactions/transaction.js +1 -0
  228. package/packages/transact/src/transactions/transaction.js.map +1 -1
  229. package/packages/transact/src/transactions/transaction.mjs +1 -0
  230. package/packages/transact/src/transactions/transaction.mjs.map +1 -1
  231. package/sdk/index.js +1 -1
  232. package/testing/fixtures/algorand-fixture.d.ts +3 -3
  233. package/testing/fixtures/algorand-fixture.js.map +1 -1
  234. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  235. package/transact/index.d.ts +5 -4
  236. package/transact/index.js +4 -22
  237. package/transact/index.mjs +4 -3
  238. package/transaction/transaction.js +2 -2
  239. package/transaction/transaction.js.map +1 -1
  240. package/transaction/transaction.mjs +2 -2
  241. package/transaction/transaction.mjs.map +1 -1
  242. package/transactions/app-call.d.ts +4 -3
  243. package/transactions/app-call.js +15 -15
  244. package/transactions/app-call.js.map +1 -1
  245. package/transactions/app-call.mjs +15 -15
  246. package/transactions/app-call.mjs.map +1 -1
  247. package/transactions/asset-config.d.ts +1 -1
  248. package/transactions/asset-config.js +1 -1
  249. package/transactions/asset-config.js.map +1 -1
  250. package/transactions/asset-config.mjs +1 -1
  251. package/transactions/asset-config.mjs.map +1 -1
  252. package/transactions/method-call.js +12 -12
  253. package/transactions/method-call.js.map +1 -1
  254. package/transactions/method-call.mjs +12 -12
  255. package/transactions/method-call.mjs.map +1 -1
  256. package/types/account-manager.js +2 -2
  257. package/types/account-manager.js.map +1 -1
  258. package/types/account-manager.mjs +2 -2
  259. package/types/account-manager.mjs.map +1 -1
  260. package/types/algorand-client-transaction-creator.d.ts +97 -83
  261. package/types/algorand-client-transaction-creator.js +8 -0
  262. package/types/algorand-client-transaction-creator.js.map +1 -1
  263. package/types/algorand-client-transaction-creator.mjs +8 -0
  264. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  265. package/types/algorand-client-transaction-sender.d.ts +100 -86
  266. package/types/algorand-client-transaction-sender.js +8 -1
  267. package/types/algorand-client-transaction-sender.js.map +1 -1
  268. package/types/algorand-client-transaction-sender.mjs +8 -0
  269. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  270. package/types/app-client.d.ts +265 -260
  271. package/types/app-client.js +0 -1
  272. package/types/app-client.js.map +1 -1
  273. package/types/app-deployer.js +1 -1
  274. package/types/app-deployer.js.map +1 -1
  275. package/types/app-deployer.mjs +1 -1
  276. package/types/app-deployer.mjs.map +1 -1
  277. package/types/app-factory.d.ts +91 -88
  278. package/types/app-manager.d.ts +3 -1
  279. package/types/app-manager.js +16 -10
  280. package/types/app-manager.js.map +1 -1
  281. package/types/app-manager.mjs +16 -10
  282. package/types/app-manager.mjs.map +1 -1
  283. package/types/app-spec.js +12 -5
  284. package/types/app-spec.js.map +1 -1
  285. package/types/app-spec.mjs +12 -5
  286. package/types/app-spec.mjs.map +1 -1
  287. package/types/asset-manager.js +1 -1
  288. package/types/asset-manager.js.map +1 -1
  289. package/types/asset-manager.mjs +1 -1
  290. package/types/asset-manager.mjs.map +1 -1
  291. package/types/composer.d.ts +9 -0
  292. package/types/composer.js +28 -13
  293. package/types/composer.js.map +1 -1
  294. package/types/composer.mjs +28 -12
  295. package/types/composer.mjs.map +1 -1
  296. package/types/kmd-account-manager.d.ts +1 -0
  297. package/types/kmd-account-manager.js +21 -10
  298. package/types/kmd-account-manager.js.map +1 -1
  299. package/types/kmd-account-manager.mjs +22 -11
  300. package/types/kmd-account-manager.mjs.map +1 -1
  301. package/types/testing.d.ts +2 -2
  302. package/packages/algod_client/src/models/application-local-reference.d.ts +0 -20
  303. package/packages/algod_client/src/models/application-local-reference.js +0 -23
  304. package/packages/algod_client/src/models/application-local-reference.js.map +0 -1
  305. package/packages/algod_client/src/models/application-local-reference.mjs +0 -23
  306. package/packages/algod_client/src/models/application-local-reference.mjs.map +0 -1
  307. package/packages/algod_client/src/models/asset-holding-reference.d.ts +0 -20
  308. package/packages/algod_client/src/models/asset-holding-reference.js +0 -23
  309. package/packages/algod_client/src/models/asset-holding-reference.js.map +0 -1
  310. package/packages/algod_client/src/models/asset-holding-reference.mjs +0 -23
  311. package/packages/algod_client/src/models/asset-holding-reference.mjs.map +0 -1
  312. package/packages/algod_client/src/models/box-reference.d.ts +0 -17
  313. package/packages/algod_client/src/models/box-reference.js +0 -23
  314. package/packages/algod_client/src/models/box-reference.js.map +0 -1
  315. package/packages/algod_client/src/models/box-reference.mjs +0 -23
  316. package/packages/algod_client/src/models/box-reference.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ledger-state-delta.mjs","names":["LedgerTealValueMeta: ObjectModelMetadata<LedgerTealValue>","LedgerStateSchemaMeta: ObjectModelMetadata<LedgerStateSchema>","LedgerAppParamsMeta: ObjectModelMetadata<LedgerAppParams>","LedgerAppLocalStateMeta: ObjectModelMetadata<LedgerAppLocalState>","LedgerAppLocalStateDeltaMeta: ObjectModelMetadata<LedgerAppLocalStateDelta>","LedgerAppParamsDeltaMeta: ObjectModelMetadata<LedgerAppParamsDelta>","LedgerAppResourceRecordMeta: ObjectModelMetadata<LedgerAppResourceRecord>","LedgerAssetHoldingMeta: ObjectModelMetadata<LedgerAssetHolding>","LedgerAssetHoldingDeltaMeta: ObjectModelMetadata<LedgerAssetHoldingDelta>","LedgerAssetParamsMeta: ObjectModelMetadata<LedgerAssetParams>","LedgerAssetParamsDeltaMeta: ObjectModelMetadata<LedgerAssetParamsDelta>","LedgerAssetResourceRecordMeta: ObjectModelMetadata<LedgerAssetResourceRecord>","LedgerVotingDataMeta: ObjectModelMetadata<LedgerVotingData>","LedgerAccountBaseDataMeta: ObjectModelMetadata<LedgerAccountBaseData>","LedgerAccountDataMeta: ObjectModelMetadata<LedgerAccountData>","LedgerBalanceRecordMeta: ObjectModelMetadata<LedgerBalanceRecord>","LedgerAccountDeltasMeta: ObjectModelMetadata<LedgerAccountDeltas>","LedgerKvValueDeltaMeta: ObjectModelMetadata<LedgerKvValueDelta>","LedgerIncludedTransactionsMeta: ObjectModelMetadata<LedgerIncludedTransactions>","LedgerModifiedCreatableMeta: ObjectModelMetadata<LedgerModifiedCreatable>","LedgerAlgoCountMeta: ObjectModelMetadata<LedgerAlgoCount>","LedgerAccountTotalsMeta: ObjectModelMetadata<LedgerAccountTotals>","LedgerStateDeltaMeta: ObjectModelMetadata<LedgerStateDelta>"],"sources":["../../../../../packages/algod_client/src/models/ledger-state-delta.ts"],"sourcesContent":["import type { Block } from './block'\nimport { BlockMeta } from './block'\nimport {\n numberCodec,\n bigIntCodec,\n booleanCodec,\n stringCodec,\n bytesCodec,\n addressCodec,\n Address,\n ArrayCodec,\n MapCodec,\n ObjectModelCodec,\n type ObjectModelMetadata,\n} from '@algorandfoundation/algokit-common'\n\n/**\n * Contains type information and a value, representing a value in a TEAL program.\n */\nexport type LedgerTealValue = {\n /**\n * Type determines the type of the value.\n * * 1 represents the type of a byte slice in a TEAL program\n * * 2 represents the type of an unsigned integer in a TEAL program\n */\n type: number\n /** bytes value. */\n bytes?: Uint8Array\n /** uint value. */\n uint?: bigint\n}\n\nexport const LedgerTealValueMeta: ObjectModelMetadata<LedgerTealValue> = {\n name: 'LedgerTealValue',\n kind: 'object',\n fields: [\n { name: 'type', wireKey: 'tt', optional: false, codec: numberCodec },\n { name: 'bytes', wireKey: 'tb', optional: true, codec: bytesCodec },\n { name: 'uint', wireKey: 'ui', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * Sets maximums on the number of each type that may be stored.\n */\nexport type LedgerStateSchema = {\n /** Number of uints in state. */\n numUints?: bigint\n /** Number of byte slices in state. */\n numByteSlices?: bigint\n}\n\nexport const LedgerStateSchemaMeta: ObjectModelMetadata<LedgerStateSchema> = {\n name: 'LedgerStateSchema',\n kind: 'object',\n fields: [\n { name: 'numUints', wireKey: 'nui', optional: true, codec: bigIntCodec },\n { name: 'numByteSlices', wireKey: 'nbs', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * Stores the global information associated with an application.\n */\nexport type LedgerAppParams = {\n approvalProgram: Uint8Array\n clearStateProgram: Uint8Array\n localStateSchema: LedgerStateSchema\n globalStateSchema: LedgerStateSchema\n extraProgramPages: number\n version?: number\n sizeSponsor?: Address\n globalState?: Map<Uint8Array, LedgerTealValue>\n}\n\nexport const LedgerAppParamsMeta: ObjectModelMetadata<LedgerAppParams> = {\n name: 'LedgerAppParams',\n kind: 'object',\n fields: [\n { name: 'approvalProgram', wireKey: 'approv', optional: false, codec: bytesCodec },\n { name: 'clearStateProgram', wireKey: 'clearp', optional: false, codec: bytesCodec },\n { name: 'localStateSchema', wireKey: 'lsch', optional: false, codec: new ObjectModelCodec(LedgerStateSchemaMeta) },\n { name: 'globalStateSchema', wireKey: 'gsch', optional: false, codec: new ObjectModelCodec(LedgerStateSchemaMeta) },\n { name: 'extraProgramPages', wireKey: 'epp', optional: false, codec: numberCodec },\n { name: 'version', wireKey: 'v', optional: true, codec: numberCodec },\n { name: 'sizeSponsor', wireKey: 'ss', optional: true, codec: addressCodec },\n {\n name: 'globalState',\n wireKey: 'gs',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(LedgerTealValueMeta)),\n },\n ],\n}\n\n/**\n * Stores the LocalState associated with an application.\n */\nexport type LedgerAppLocalState = {\n schema: LedgerStateSchema\n keyValue?: Map<Uint8Array, LedgerTealValue>\n}\n\nexport const LedgerAppLocalStateMeta: ObjectModelMetadata<LedgerAppLocalState> = {\n name: 'LedgerAppLocalState',\n kind: 'object',\n fields: [\n { name: 'schema', wireKey: 'hsch', optional: false, codec: new ObjectModelCodec(LedgerStateSchemaMeta) },\n {\n name: 'keyValue',\n wireKey: 'tkv',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(LedgerTealValueMeta)),\n },\n ],\n}\n\n/**\n * Tracks a changed AppLocalState, and whether it was deleted.\n */\nexport type LedgerAppLocalStateDelta = {\n deleted: boolean\n localState?: LedgerAppLocalState\n}\n\nexport const LedgerAppLocalStateDeltaMeta: ObjectModelMetadata<LedgerAppLocalStateDelta> = {\n name: 'LedgerAppLocalStateDelta',\n kind: 'object',\n fields: [\n { name: 'deleted', wireKey: 'Deleted', optional: false, codec: booleanCodec },\n { name: 'localState', wireKey: 'LocalState', optional: true, codec: new ObjectModelCodec(LedgerAppLocalStateMeta) },\n ],\n}\n\n/**\n * Tracks a changed AppParams, and whether it was deleted.\n */\nexport type LedgerAppParamsDelta = {\n deleted: boolean\n params?: LedgerAppParams\n}\n\nexport const LedgerAppParamsDeltaMeta: ObjectModelMetadata<LedgerAppParamsDelta> = {\n name: 'LedgerAppParamsDelta',\n kind: 'object',\n fields: [\n { name: 'deleted', wireKey: 'Deleted', optional: false, codec: booleanCodec },\n { name: 'params', wireKey: 'Params', optional: true, codec: new ObjectModelCodec(LedgerAppParamsMeta) },\n ],\n}\n\n/**\n * Represents AppParams and AppLocalState in deltas.\n */\nexport type LedgerAppResourceRecord = {\n appId: bigint\n address: Address\n params: LedgerAppParamsDelta\n state: LedgerAppLocalStateDelta\n}\n\nexport const LedgerAppResourceRecordMeta: ObjectModelMetadata<LedgerAppResourceRecord> = {\n name: 'LedgerAppResourceRecord',\n kind: 'object',\n fields: [\n { name: 'appId', wireKey: 'Aidx', optional: false, codec: bigIntCodec },\n { name: 'address', wireKey: 'Addr', optional: false, codec: addressCodec },\n { name: 'params', wireKey: 'Params', optional: false, codec: new ObjectModelCodec(LedgerAppParamsDeltaMeta) },\n { name: 'state', wireKey: 'State', optional: false, codec: new ObjectModelCodec(LedgerAppLocalStateDeltaMeta) },\n ],\n}\n\n/**\n * Describes an asset held by an account.\n */\nexport type LedgerAssetHolding = {\n amount: bigint\n frozen: boolean\n}\n\nexport const LedgerAssetHoldingMeta: ObjectModelMetadata<LedgerAssetHolding> = {\n name: 'LedgerAssetHolding',\n kind: 'object',\n fields: [\n { name: 'amount', wireKey: 'a', optional: false, codec: bigIntCodec },\n { name: 'frozen', wireKey: 'f', optional: false, codec: booleanCodec },\n ],\n}\n\n/**\n * Records a changed AssetHolding, and whether it was deleted.\n */\nexport type LedgerAssetHoldingDelta = {\n deleted: boolean\n holding?: LedgerAssetHolding\n}\n\nexport const LedgerAssetHoldingDeltaMeta: ObjectModelMetadata<LedgerAssetHoldingDelta> = {\n name: 'LedgerAssetHoldingDelta',\n kind: 'object',\n fields: [\n { name: 'deleted', wireKey: 'Deleted', optional: false, codec: booleanCodec },\n { name: 'holding', wireKey: 'Holding', optional: true, codec: new ObjectModelCodec(LedgerAssetHoldingMeta) },\n ],\n}\n\n/**\n * Describes the parameters of an asset.\n */\nexport type LedgerAssetParams = {\n /**\n * Specifies the total number of units of this asset created.\n */\n total: bigint\n /**\n * Specifies the number of digits to display after the decimal place when displaying this asset.\n * A value of 0 represents an asset that is not divisible, a value of 1 represents an asset divisible into tenths, and so on.\n * This value must be between 0 and 19 (inclusive).\n */\n decimals: number\n /**\n * Specifies whether slots for this asset in user accounts are frozen by default or not.\n */\n defaultFrozen: boolean\n /**\n * Specifies a hint for the name of a unit of this asset.\n */\n unitName?: string\n /**\n * Specifies a hint for the name of the asset.\n */\n assetName?: string\n /**\n * Specifies a URL where more information about the asset can be retrieved.\n */\n url?: string\n /**\n * Specifies a commitment to some unspecified asset metadata. The format of this\n * metadata is up to the application.\n */\n metadataHash?: Uint8Array\n /**\n * Manager specifies an account that is allowed to change the non-zero addresses in this AssetParams.\n */\n manager?: Address\n /**\n * Specifies an account whose holdings of this asset should be reported as \"not minted\".\n */\n reserve?: Address\n /**\n * Specifies an account that is allowed to change the frozen state of holdings of this asset.\n */\n freeze?: Address\n /**\n * Specifies an account that is allowed to take units of this asset from any account.\n */\n clawback?: Address\n}\n\nexport const LedgerAssetParamsMeta: ObjectModelMetadata<LedgerAssetParams> = {\n name: 'LedgerAssetParams',\n kind: 'object',\n fields: [\n { name: 'total', wireKey: 't', optional: false, codec: bigIntCodec },\n { name: 'decimals', wireKey: 'dc', optional: false, codec: numberCodec },\n { name: 'defaultFrozen', wireKey: 'df', optional: false, codec: booleanCodec },\n { name: 'unitName', wireKey: 'un', optional: true, codec: stringCodec },\n { name: 'assetName', wireKey: 'an', optional: true, codec: stringCodec },\n { name: 'url', wireKey: 'au', optional: true, codec: stringCodec },\n { name: 'metadataHash', wireKey: 'am', optional: true, codec: bytesCodec },\n { name: 'manager', wireKey: 'm', optional: true, codec: addressCodec },\n { name: 'reserve', wireKey: 'r', optional: true, codec: addressCodec },\n { name: 'freeze', wireKey: 'f', optional: true, codec: addressCodec },\n { name: 'clawback', wireKey: 'c', optional: true, codec: addressCodec },\n ],\n}\n\n/**\n * Tracks a changed asset params, and whether it was deleted.\n */\nexport type LedgerAssetParamsDelta = {\n deleted: boolean\n params?: LedgerAssetParams\n}\n\nexport const LedgerAssetParamsDeltaMeta: ObjectModelMetadata<LedgerAssetParamsDelta> = {\n name: 'LedgerAssetParamsDelta',\n kind: 'object',\n fields: [\n { name: 'deleted', wireKey: 'Deleted', optional: false, codec: booleanCodec },\n { name: 'params', wireKey: 'Params', optional: true, codec: new ObjectModelCodec(LedgerAssetParamsMeta) },\n ],\n}\n\n/**\n * Represents asset params and asset holding in deltas.\n */\nexport type LedgerAssetResourceRecord = {\n assetId: bigint\n address: Address\n params: LedgerAssetParamsDelta\n holding: LedgerAssetHoldingDelta\n}\n\nexport const LedgerAssetResourceRecordMeta: ObjectModelMetadata<LedgerAssetResourceRecord> = {\n name: 'LedgerAssetResourceRecord',\n kind: 'object',\n fields: [\n { name: 'assetId', wireKey: 'Aidx', optional: false, codec: bigIntCodec },\n { name: 'address', wireKey: 'Addr', optional: false, codec: addressCodec },\n { name: 'params', wireKey: 'Params', optional: false, codec: new ObjectModelCodec(LedgerAssetParamsDeltaMeta) },\n { name: 'holding', wireKey: 'Holding', optional: false, codec: new ObjectModelCodec(LedgerAssetHoldingDeltaMeta) },\n ],\n}\n\n/**\n * Holds participation information.\n */\nexport type LedgerVotingData = {\n voteId: Uint8Array\n selectionId: Uint8Array\n stateProofId: Uint8Array\n voteFirstValid: bigint\n voteLastValid: bigint\n voteKeyDilution: bigint\n}\n\nexport const LedgerVotingDataMeta: ObjectModelMetadata<LedgerVotingData> = {\n name: 'LedgerVotingData',\n kind: 'object',\n fields: [\n { name: 'voteId', wireKey: 'VoteID', optional: false, codec: bytesCodec },\n { name: 'selectionId', wireKey: 'SelectionID', optional: false, codec: bytesCodec },\n { name: 'stateProofId', wireKey: 'StateProofID', optional: false, codec: bytesCodec },\n { name: 'voteFirstValid', wireKey: 'VoteFirstValid', optional: false, codec: bigIntCodec },\n { name: 'voteLastValid', wireKey: 'VoteLastValid', optional: false, codec: bigIntCodec },\n { name: 'voteKeyDilution', wireKey: 'VoteKeyDilution', optional: false, codec: bigIntCodec },\n ],\n}\n\n/**\n * Contains base account info like balance, status and total number of resources.\n */\nexport type LedgerAccountBaseData = {\n /**\n * Account status. Values are:\n * * 0: Offline\n * * 1: Online\n * * 2: NotParticipating\n */\n status: number\n microAlgos: bigint\n rewardsBase: bigint\n rewardedMicroAlgos: bigint\n authAddress: Address\n incentiveEligible: boolean\n /**\n * Totals across created globals, and opted in locals.\n */\n totalAppSchema: LedgerStateSchema\n /**\n * Total number of extra pages across all created apps.\n */\n totalExtraAppPages: number\n /**\n * Total number of apps this account has created.\n */\n totalAppParams: number\n /**\n * Total number of apps this account is opted into.\n */\n totalAppLocalStates: number\n /**\n * Total number of assets created by this account.\n */\n totalAssetParams: number\n /**\n * Total of asset creations and optins (i.e. number of holdings).\n */\n totalAssets: number\n /**\n * Total number of boxes associated to this account.\n */\n totalBoxes: bigint\n /**\n * Total bytes for this account's boxes. keys and values count.\n */\n totalBoxBytes: bigint\n /**\n * The last round that this account proposed the winning block.\n */\n lastProposed: bigint\n /**\n * The last round that this account sent a heartbeat to show it was online.\n */\n lastHeartbeat: bigint\n}\n\nexport const LedgerAccountBaseDataMeta: ObjectModelMetadata<LedgerAccountBaseData> = {\n name: 'LedgerAccountBaseData',\n kind: 'object',\n fields: [\n { name: 'status', wireKey: 'Status', optional: false, codec: numberCodec },\n { name: 'microAlgos', wireKey: 'MicroAlgos', optional: false, codec: bigIntCodec },\n { name: 'rewardsBase', wireKey: 'RewardsBase', optional: false, codec: bigIntCodec },\n {\n name: 'rewardedMicroAlgos',\n wireKey: 'RewardedMicroAlgos',\n optional: false,\n codec: bigIntCodec,\n },\n { name: 'authAddress', wireKey: 'AuthAddr', optional: false, codec: addressCodec },\n { name: 'incentiveEligible', wireKey: 'IncentiveEligible', optional: false, codec: booleanCodec },\n {\n name: 'totalAppSchema',\n wireKey: 'TotalAppSchema',\n optional: false,\n codec: new ObjectModelCodec(LedgerStateSchemaMeta),\n },\n { name: 'totalExtraAppPages', wireKey: 'TotalExtraAppPages', optional: false, codec: numberCodec },\n { name: 'totalAppParams', wireKey: 'TotalAppParams', optional: false, codec: numberCodec },\n { name: 'totalAppLocalStates', wireKey: 'TotalAppLocalStates', optional: false, codec: numberCodec },\n { name: 'totalAssetParams', wireKey: 'TotalAssetParams', optional: false, codec: numberCodec },\n { name: 'totalAssets', wireKey: 'TotalAssets', optional: false, codec: numberCodec },\n { name: 'totalBoxes', wireKey: 'TotalBoxes', optional: false, codec: bigIntCodec },\n { name: 'totalBoxBytes', wireKey: 'TotalBoxBytes', optional: false, codec: bigIntCodec },\n { name: 'lastProposed', wireKey: 'LastProposed', optional: false, codec: bigIntCodec },\n { name: 'lastHeartbeat', wireKey: 'LastHeartbeat', optional: false, codec: bigIntCodec },\n ],\n}\n\n/**\n * Provides per-account data.\n */\nexport type LedgerAccountData = {\n accountBaseData: LedgerAccountBaseData\n votingData: LedgerVotingData\n}\n\nexport const LedgerAccountDataMeta: ObjectModelMetadata<LedgerAccountData> = {\n name: 'LedgerAccountData',\n kind: 'object',\n fields: [\n {\n name: 'accountBaseData',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(LedgerAccountBaseDataMeta),\n },\n { name: 'votingData', flattened: true, optional: false, codec: new ObjectModelCodec(LedgerVotingDataMeta) },\n ],\n}\n\nexport type LedgerBalanceRecord = {\n address: Address\n accountData: LedgerAccountData\n}\n\nexport const LedgerBalanceRecordMeta: ObjectModelMetadata<LedgerBalanceRecord> = {\n name: 'LedgerBalanceRecord',\n kind: 'object',\n fields: [\n { name: 'address', wireKey: 'Addr', optional: false, codec: addressCodec },\n { name: 'accountData', flattened: true, optional: false, codec: new ObjectModelCodec(LedgerAccountDataMeta) },\n ],\n}\n\nexport type LedgerAccountDeltas = {\n accounts?: LedgerBalanceRecord[]\n appResources?: LedgerAppResourceRecord[]\n assetResources?: LedgerAssetResourceRecord[]\n}\n\nexport const LedgerAccountDeltasMeta: ObjectModelMetadata<LedgerAccountDeltas> = {\n name: 'LedgerAccountDeltas',\n kind: 'object',\n fields: [\n {\n name: 'accounts',\n wireKey: 'Accts',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(LedgerBalanceRecordMeta)),\n },\n {\n name: 'appResources',\n wireKey: 'AppResources',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(LedgerAppResourceRecordMeta)),\n },\n {\n name: 'assetResources',\n wireKey: 'AssetResources',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(LedgerAssetResourceRecordMeta)),\n },\n ],\n}\n\n/**\n * Shows how the data associated with a key in the kvstore has changed.\n */\nexport type LedgerKvValueDelta = {\n /**\n * Stores the most recent value (undefined means deleted).\n */\n data?: Uint8Array\n /**\n * Stores the previous value (undefined means didn't exist).\n */\n oldData?: Uint8Array\n}\n\nexport const LedgerKvValueDeltaMeta: ObjectModelMetadata<LedgerKvValueDelta> = {\n name: 'LedgerKvValueDelta',\n kind: 'object',\n fields: [\n { name: 'data', wireKey: 'Data', optional: true, codec: bytesCodec },\n { name: 'oldData', wireKey: 'OldData', optional: true, codec: bytesCodec },\n ],\n}\n\n/**\n * Defines the transactions included in a block, their index and last valid round.\n */\nexport type LedgerIncludedTransactions = {\n lastValid: bigint\n /**\n * The index of the transaction in the block.\n */\n intra: number\n}\n\nexport const LedgerIncludedTransactionsMeta: ObjectModelMetadata<LedgerIncludedTransactions> = {\n name: 'LedgerIncludedTransactions',\n kind: 'object',\n fields: [\n { name: 'lastValid', wireKey: 'LastValid', optional: false, codec: bigIntCodec },\n { name: 'intra', wireKey: 'Intra', optional: false, codec: numberCodec },\n ],\n}\n\n/**\n * Represents a change to a single creatable state.\n */\nexport type LedgerModifiedCreatable = {\n /**\n * Type of the creatable. The values are:\n * * 0: Asset\n * * 1: Application\n */\n creatableType: number\n /**\n * Created if true, deleted if false.\n */\n created: boolean\n /**\n * Creator of the app/asset.\n */\n creator: Address\n /**\n * Keeps track of how many times this app/asset appears in accountUpdates.creatableDeltas.\n */\n nDeltas: number\n}\n\nexport const LedgerModifiedCreatableMeta: ObjectModelMetadata<LedgerModifiedCreatable> = {\n name: 'LedgerModifiedCreatable',\n kind: 'object',\n fields: [\n { name: 'creatableType', wireKey: 'Ctype', optional: false, codec: numberCodec },\n { name: 'created', wireKey: 'Created', optional: false, codec: booleanCodec },\n { name: 'creator', wireKey: 'Creator', optional: false, codec: addressCodec },\n { name: 'ndeltas', wireKey: 'Ndeltas', optional: false, codec: numberCodec },\n ],\n}\n\n/**\n * Represents a total of algos of a certain class of accounts (split up by their Status value).\n */\nexport type LedgerAlgoCount = {\n /**\n * Sum of algos of all accounts in this scope.\n */\n money: bigint\n /**\n * Total number of whole reward units in accounts.\n */\n rewardUnits: bigint\n}\n\nexport const LedgerAlgoCountMeta: ObjectModelMetadata<LedgerAlgoCount> = {\n name: 'LedgerAlgoCount',\n kind: 'object',\n fields: [\n { name: 'money', wireKey: 'mon', optional: false, codec: bigIntCodec },\n { name: 'rewardUnits', wireKey: 'rwd', optional: false, codec: bigIntCodec },\n ],\n}\n\n/**\n * Represents the totals of algos in the system grouped by different account status values.\n */\nexport type LedgerAccountTotals = {\n online: LedgerAlgoCount\n offline: LedgerAlgoCount\n notParticipating: LedgerAlgoCount\n /**\n * Total number of algos received per reward unit since genesis.\n */\n rewardsLevel: bigint\n}\n\nexport const LedgerAccountTotalsMeta: ObjectModelMetadata<LedgerAccountTotals> = {\n name: 'LedgerAccountTotals',\n kind: 'object',\n fields: [\n { name: 'online', wireKey: 'online', optional: false, codec: new ObjectModelCodec(LedgerAlgoCountMeta) },\n { name: 'offline', wireKey: 'offline', optional: false, codec: new ObjectModelCodec(LedgerAlgoCountMeta) },\n { name: 'notParticipating', wireKey: 'notpart', optional: false, codec: new ObjectModelCodec(LedgerAlgoCountMeta) },\n { name: 'rewardsLevel', wireKey: 'rwdlvl', optional: false, codec: bigIntCodec },\n ],\n}\n\n/**\n * Describes the delta between a given round to the previous round.\n */\nexport type LedgerStateDelta = {\n /**\n * Modified new accounts.\n */\n accounts: LedgerAccountDeltas\n /**\n * Block header.\n */\n block: Block\n /**\n * Represents modification on StateProofNextRound field in the block header. If the block contains\n * a valid state proof transaction, this field will contain the next round for state proof.\n * otherwise it will be set to 0.\n */\n stateProofNext: bigint\n /**\n * Previous block timestamp\n */\n prevTimestamp: bigint\n /**\n * The account totals reflecting the changes in this StateDelta object.\n */\n totals: LedgerAccountTotals\n /**\n * Modified kv pairs.\n */\n kvMods?: Map<Uint8Array, LedgerKvValueDelta>\n /**\n * New Txids for the txtail and TxnCounter, mapped to txn.LastValid.\n */\n txIds?: Map<Uint8Array, LedgerIncludedTransactions>\n /**\n * New creatables creator lookup table.\n */\n creatables?: Map<number, LedgerModifiedCreatable>\n}\n\nexport const LedgerStateDeltaMeta: ObjectModelMetadata<LedgerStateDelta> = {\n name: 'LedgerStateDelta',\n kind: 'object',\n fields: [\n { name: 'accounts', wireKey: 'Accts', optional: false, codec: new ObjectModelCodec(LedgerAccountDeltasMeta) },\n { name: 'block', wireKey: 'Hdr', optional: false, codec: new ObjectModelCodec(BlockMeta) },\n { name: 'stateProofNext', wireKey: 'StateProofNext', optional: false, codec: bigIntCodec },\n { name: 'prevTimestamp', wireKey: 'PrevTimestamp', optional: false, codec: bigIntCodec },\n { name: 'totals', wireKey: 'Totals', optional: false, codec: new ObjectModelCodec(LedgerAccountTotalsMeta) },\n {\n name: 'kvMods',\n wireKey: 'KvMods',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(LedgerKvValueDeltaMeta)),\n },\n {\n name: 'txIds',\n wireKey: 'Txids',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(LedgerIncludedTransactionsMeta)),\n },\n {\n name: 'creatables',\n wireKey: 'Creatables',\n optional: true,\n codec: new MapCodec(numberCodec, new ObjectModelCodec(LedgerModifiedCreatableMeta)),\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,MAAaA,sBAA4D;CACvE,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAO,OAAO;GAAa;EACpE;GAAE,MAAM;GAAS,SAAS;GAAM,UAAU;GAAM,OAAO;GAAY;EACnE;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAM,OAAO;GAAa;EACpE;CACF;AAYD,MAAaC,wBAAgE;CAC3E,MAAM;CACN,MAAM;CACN,QAAQ,CACN;EAAE,MAAM;EAAY,SAAS;EAAO,UAAU;EAAM,OAAO;EAAa,EACxE;EAAE,MAAM;EAAiB,SAAS;EAAO,UAAU;EAAM,OAAO;EAAa,CAC9E;CACF;AAgBD,MAAaC,sBAA4D;CACvE,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAmB,SAAS;GAAU,UAAU;GAAO,OAAO;GAAY;EAClF;GAAE,MAAM;GAAqB,SAAS;GAAU,UAAU;GAAO,OAAO;GAAY;EACpF;GAAE,MAAM;GAAoB,SAAS;GAAQ,UAAU;GAAO,OAAO,IAAI,iBAAiB,sBAAsB;GAAE;EAClH;GAAE,MAAM;GAAqB,SAAS;GAAQ,UAAU;GAAO,OAAO,IAAI,iBAAiB,sBAAsB;GAAE;EACnH;GAAE,MAAM;GAAqB,SAAS;GAAO,UAAU;GAAO,OAAO;GAAa;EAClF;GAAE,MAAM;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E,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAU,SAAS;GAAU,UAAU;GAAO,OAAO,IAAI,iBAAiB,oBAAoB;GAAE;EACxG;GAAE,MAAM;GAAW,SAAS;GAAW,UAAU;GAAO,OAAO,IAAI,iBAAiB,oBAAoB;GAAE;EAC1G;GAAE,MAAM;GAAoB,SAAS;GAAW,UAAU;GAAO,OAAO,IAAI,iBAAiB,oBAAoB;GAAE;EACnH;GAAE,MAAM;GAAgB,SAAS;GAAU,UAAU;GAAO,OAAO;GAAa;EACjF;CACF;AA0CD,MAAaC,uBAA8D;CACzE,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAY,SAAS;GAAS,UAAU;GAAO,OAAO,IAAI,iBAAiB,wBAAwB;GAAE;EAC7G;GAAE,MAAM;GAAS,SAAS;GAAO,UAAU;GAAO,OAAO,IAAI,iBAAiB,UAAU;GAAE;EAC1F;GAAE,MAAM;GAAkB,SAAS;GAAkB,UAAU;GAAO,OAAO;GAAa;EAC1F;GAAE,MAAM;GAAiB,SAAS;GAAiB,UAAU;GAAO,OAAO;GAAa;EACxF;GAAE,MAAM;GAAU,SAAS;GAAU,UAAU;GAAO,OAAO,IAAI,iBAAiB,wBAAwB;GAAE;EAC5G;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,YAAY,IAAI,iBAAiB,uBAAuB,CAAC;GAC9E;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,YAAY,IAAI,iBAAiB,+BAA+B,CAAC;GACtF;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,aAAa,IAAI,iBAAiB,4BAA4B,CAAC;GACpF;EACF;CACF"}
1
+ {"version":3,"file":"ledger-state-delta.mjs","names":["LedgerTealValueMeta: ObjectModelMetadata<LedgerTealValue>","LedgerStateSchemaMeta: ObjectModelMetadata<LedgerStateSchema>","LedgerAppParamsMeta: ObjectModelMetadata<LedgerAppParams>","LedgerAppLocalStateMeta: ObjectModelMetadata<LedgerAppLocalState>","LedgerAppLocalStateDeltaMeta: ObjectModelMetadata<LedgerAppLocalStateDelta>","LedgerAppParamsDeltaMeta: ObjectModelMetadata<LedgerAppParamsDelta>","LedgerAppResourceRecordMeta: ObjectModelMetadata<LedgerAppResourceRecord>","LedgerAssetHoldingMeta: ObjectModelMetadata<LedgerAssetHolding>","LedgerAssetHoldingDeltaMeta: ObjectModelMetadata<LedgerAssetHoldingDelta>","LedgerAssetParamsMeta: ObjectModelMetadata<LedgerAssetParams>","LedgerAssetParamsDeltaMeta: ObjectModelMetadata<LedgerAssetParamsDelta>","LedgerAssetResourceRecordMeta: ObjectModelMetadata<LedgerAssetResourceRecord>","LedgerVotingDataMeta: ObjectModelMetadata<LedgerVotingData>","LedgerAccountBaseDataMeta: ObjectModelMetadata<LedgerAccountBaseData>","LedgerAccountDataMeta: ObjectModelMetadata<LedgerAccountData>","LedgerBalanceRecordMeta: ObjectModelMetadata<LedgerBalanceRecord>","LedgerAccountDeltasMeta: ObjectModelMetadata<LedgerAccountDeltas>","LedgerKvValueDeltaMeta: ObjectModelMetadata<LedgerKvValueDelta>","LedgerIncludedTransactionsMeta: ObjectModelMetadata<LedgerIncludedTransactions>","LedgerModifiedCreatableMeta: ObjectModelMetadata<LedgerModifiedCreatable>","LedgerAlgoCountMeta: ObjectModelMetadata<LedgerAlgoCount>","LedgerAccountTotalsMeta: ObjectModelMetadata<LedgerAccountTotals>","LedgerStateDeltaMeta: ObjectModelMetadata<LedgerStateDelta>"],"sources":["../../../../../packages/algod_client/src/models/ledger-state-delta.ts"],"sourcesContent":["import type { Block } from './block'\nimport { blockCodec } from './block'\nimport {\n numberCodec,\n bigIntCodec,\n booleanCodec,\n stringCodec,\n bytesCodec,\n addressCodec,\n Address,\n ArrayCodec,\n MapCodec,\n ObjectModelCodec,\n type ObjectModelMetadata,\n} from '@algorandfoundation/algokit-common'\n\n/**\n * Contains type information and a value, representing a value in a TEAL program.\n */\nexport type LedgerTealValue = {\n /**\n * Type determines the type of the value.\n * * 1 represents the type of a byte slice in a TEAL program\n * * 2 represents the type of an unsigned integer in a TEAL program\n */\n type: number\n /** bytes value. */\n bytes?: Uint8Array\n /** uint value. */\n uint?: bigint\n}\n\nexport const LedgerTealValueMeta: ObjectModelMetadata<LedgerTealValue> = {\n name: 'LedgerTealValue',\n kind: 'object',\n fields: [\n { name: 'type', wireKey: 'tt', optional: false, codec: numberCodec },\n { name: 'bytes', wireKey: 'tb', optional: true, codec: bytesCodec },\n { name: 'uint', wireKey: 'ui', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * Sets maximums on the number of each type that may be stored.\n */\nexport type LedgerStateSchema = {\n /** Number of uints in state. */\n numUints?: bigint\n /** Number of byte slices in state. */\n numByteSlices?: bigint\n}\n\nexport const LedgerStateSchemaMeta: ObjectModelMetadata<LedgerStateSchema> = {\n name: 'LedgerStateSchema',\n kind: 'object',\n fields: [\n { name: 'numUints', wireKey: 'nui', optional: true, codec: bigIntCodec },\n { name: 'numByteSlices', wireKey: 'nbs', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * Stores the global information associated with an application.\n */\nexport type LedgerAppParams = {\n approvalProgram: Uint8Array\n clearStateProgram: Uint8Array\n localStateSchema: LedgerStateSchema\n globalStateSchema: LedgerStateSchema\n extraProgramPages: number\n version?: number\n sizeSponsor?: Address\n globalState?: Map<Uint8Array, LedgerTealValue>\n}\n\nexport const LedgerAppParamsMeta: ObjectModelMetadata<LedgerAppParams> = {\n name: 'LedgerAppParams',\n kind: 'object',\n fields: [\n { name: 'approvalProgram', wireKey: 'approv', optional: false, codec: bytesCodec },\n { name: 'clearStateProgram', wireKey: 'clearp', optional: false, codec: bytesCodec },\n { name: 'localStateSchema', wireKey: 'lsch', optional: false, codec: new ObjectModelCodec(LedgerStateSchemaMeta) },\n { name: 'globalStateSchema', wireKey: 'gsch', optional: false, codec: new ObjectModelCodec(LedgerStateSchemaMeta) },\n { name: 'extraProgramPages', wireKey: 'epp', optional: false, codec: numberCodec },\n { name: 'version', wireKey: 'v', optional: true, codec: numberCodec },\n { name: 'sizeSponsor', wireKey: 'ss', optional: true, codec: addressCodec },\n {\n name: 'globalState',\n wireKey: 'gs',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(LedgerTealValueMeta)),\n },\n ],\n}\n\n/**\n * Stores the LocalState associated with an application.\n */\nexport type LedgerAppLocalState = {\n schema: LedgerStateSchema\n keyValue?: Map<Uint8Array, LedgerTealValue>\n}\n\nexport const LedgerAppLocalStateMeta: ObjectModelMetadata<LedgerAppLocalState> = {\n name: 'LedgerAppLocalState',\n kind: 'object',\n fields: [\n { name: 'schema', wireKey: 'hsch', optional: false, codec: new ObjectModelCodec(LedgerStateSchemaMeta) },\n {\n name: 'keyValue',\n wireKey: 'tkv',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(LedgerTealValueMeta)),\n },\n ],\n}\n\n/**\n * Tracks a changed AppLocalState, and whether it was deleted.\n */\nexport type LedgerAppLocalStateDelta = {\n deleted: boolean\n localState?: LedgerAppLocalState\n}\n\nexport const LedgerAppLocalStateDeltaMeta: ObjectModelMetadata<LedgerAppLocalStateDelta> = {\n name: 'LedgerAppLocalStateDelta',\n kind: 'object',\n fields: [\n { name: 'deleted', wireKey: 'Deleted', optional: false, codec: booleanCodec },\n { name: 'localState', wireKey: 'LocalState', optional: true, codec: new ObjectModelCodec(LedgerAppLocalStateMeta) },\n ],\n}\n\n/**\n * Tracks a changed AppParams, and whether it was deleted.\n */\nexport type LedgerAppParamsDelta = {\n deleted: boolean\n params?: LedgerAppParams\n}\n\nexport const LedgerAppParamsDeltaMeta: ObjectModelMetadata<LedgerAppParamsDelta> = {\n name: 'LedgerAppParamsDelta',\n kind: 'object',\n fields: [\n { name: 'deleted', wireKey: 'Deleted', optional: false, codec: booleanCodec },\n { name: 'params', wireKey: 'Params', optional: true, codec: new ObjectModelCodec(LedgerAppParamsMeta) },\n ],\n}\n\n/**\n * Represents AppParams and AppLocalState in deltas.\n */\nexport type LedgerAppResourceRecord = {\n appId: bigint\n address: Address\n params: LedgerAppParamsDelta\n state: LedgerAppLocalStateDelta\n}\n\nexport const LedgerAppResourceRecordMeta: ObjectModelMetadata<LedgerAppResourceRecord> = {\n name: 'LedgerAppResourceRecord',\n kind: 'object',\n fields: [\n { name: 'appId', wireKey: 'Aidx', optional: false, codec: bigIntCodec },\n { name: 'address', wireKey: 'Addr', optional: false, codec: addressCodec },\n { name: 'params', wireKey: 'Params', optional: false, codec: new ObjectModelCodec(LedgerAppParamsDeltaMeta) },\n { name: 'state', wireKey: 'State', optional: false, codec: new ObjectModelCodec(LedgerAppLocalStateDeltaMeta) },\n ],\n}\n\n/**\n * Describes an asset held by an account.\n */\nexport type LedgerAssetHolding = {\n amount: bigint\n frozen: boolean\n}\n\nexport const LedgerAssetHoldingMeta: ObjectModelMetadata<LedgerAssetHolding> = {\n name: 'LedgerAssetHolding',\n kind: 'object',\n fields: [\n { name: 'amount', wireKey: 'a', optional: false, codec: bigIntCodec },\n { name: 'frozen', wireKey: 'f', optional: false, codec: booleanCodec },\n ],\n}\n\n/**\n * Records a changed AssetHolding, and whether it was deleted.\n */\nexport type LedgerAssetHoldingDelta = {\n deleted: boolean\n holding?: LedgerAssetHolding\n}\n\nexport const LedgerAssetHoldingDeltaMeta: ObjectModelMetadata<LedgerAssetHoldingDelta> = {\n name: 'LedgerAssetHoldingDelta',\n kind: 'object',\n fields: [\n { name: 'deleted', wireKey: 'Deleted', optional: false, codec: booleanCodec },\n { name: 'holding', wireKey: 'Holding', optional: true, codec: new ObjectModelCodec(LedgerAssetHoldingMeta) },\n ],\n}\n\n/**\n * Describes the parameters of an asset.\n */\nexport type LedgerAssetParams = {\n /**\n * Specifies the total number of units of this asset created.\n */\n total: bigint\n /**\n * Specifies the number of digits to display after the decimal place when displaying this asset.\n * A value of 0 represents an asset that is not divisible, a value of 1 represents an asset divisible into tenths, and so on.\n * This value must be between 0 and 19 (inclusive).\n */\n decimals: number\n /**\n * Specifies whether slots for this asset in user accounts are frozen by default or not.\n */\n defaultFrozen: boolean\n /**\n * Specifies a hint for the name of a unit of this asset.\n */\n unitName?: string\n /**\n * Specifies a hint for the name of the asset.\n */\n assetName?: string\n /**\n * Specifies a URL where more information about the asset can be retrieved.\n */\n url?: string\n /**\n * Specifies a commitment to some unspecified asset metadata. The format of this\n * metadata is up to the application.\n */\n metadataHash?: Uint8Array\n /**\n * Manager specifies an account that is allowed to change the non-zero addresses in this AssetParams.\n */\n manager?: Address\n /**\n * Specifies an account whose holdings of this asset should be reported as \"not minted\".\n */\n reserve?: Address\n /**\n * Specifies an account that is allowed to change the frozen state of holdings of this asset.\n */\n freeze?: Address\n /**\n * Specifies an account that is allowed to take units of this asset from any account.\n */\n clawback?: Address\n}\n\nexport const LedgerAssetParamsMeta: ObjectModelMetadata<LedgerAssetParams> = {\n name: 'LedgerAssetParams',\n kind: 'object',\n fields: [\n { name: 'total', wireKey: 't', optional: false, codec: bigIntCodec },\n { name: 'decimals', wireKey: 'dc', optional: false, codec: numberCodec },\n { name: 'defaultFrozen', wireKey: 'df', optional: false, codec: booleanCodec },\n { name: 'unitName', wireKey: 'un', optional: true, codec: stringCodec },\n { name: 'assetName', wireKey: 'an', optional: true, codec: stringCodec },\n { name: 'url', wireKey: 'au', optional: true, codec: stringCodec },\n { name: 'metadataHash', wireKey: 'am', optional: true, codec: bytesCodec },\n { name: 'manager', wireKey: 'm', optional: true, codec: addressCodec },\n { name: 'reserve', wireKey: 'r', optional: true, codec: addressCodec },\n { name: 'freeze', wireKey: 'f', optional: true, codec: addressCodec },\n { name: 'clawback', wireKey: 'c', optional: true, codec: addressCodec },\n ],\n}\n\n/**\n * Tracks a changed asset params, and whether it was deleted.\n */\nexport type LedgerAssetParamsDelta = {\n deleted: boolean\n params?: LedgerAssetParams\n}\n\nexport const LedgerAssetParamsDeltaMeta: ObjectModelMetadata<LedgerAssetParamsDelta> = {\n name: 'LedgerAssetParamsDelta',\n kind: 'object',\n fields: [\n { name: 'deleted', wireKey: 'Deleted', optional: false, codec: booleanCodec },\n { name: 'params', wireKey: 'Params', optional: true, codec: new ObjectModelCodec(LedgerAssetParamsMeta) },\n ],\n}\n\n/**\n * Represents asset params and asset holding in deltas.\n */\nexport type LedgerAssetResourceRecord = {\n assetId: bigint\n address: Address\n params: LedgerAssetParamsDelta\n holding: LedgerAssetHoldingDelta\n}\n\nexport const LedgerAssetResourceRecordMeta: ObjectModelMetadata<LedgerAssetResourceRecord> = {\n name: 'LedgerAssetResourceRecord',\n kind: 'object',\n fields: [\n { name: 'assetId', wireKey: 'Aidx', optional: false, codec: bigIntCodec },\n { name: 'address', wireKey: 'Addr', optional: false, codec: addressCodec },\n { name: 'params', wireKey: 'Params', optional: false, codec: new ObjectModelCodec(LedgerAssetParamsDeltaMeta) },\n { name: 'holding', wireKey: 'Holding', optional: false, codec: new ObjectModelCodec(LedgerAssetHoldingDeltaMeta) },\n ],\n}\n\n/**\n * Holds participation information.\n */\nexport type LedgerVotingData = {\n voteId: Uint8Array\n selectionId: Uint8Array\n stateProofId: Uint8Array\n voteFirstValid: bigint\n voteLastValid: bigint\n voteKeyDilution: bigint\n}\n\nexport const LedgerVotingDataMeta: ObjectModelMetadata<LedgerVotingData> = {\n name: 'LedgerVotingData',\n kind: 'object',\n fields: [\n { name: 'voteId', wireKey: 'VoteID', optional: false, codec: bytesCodec },\n { name: 'selectionId', wireKey: 'SelectionID', optional: false, codec: bytesCodec },\n { name: 'stateProofId', wireKey: 'StateProofID', optional: false, codec: bytesCodec },\n { name: 'voteFirstValid', wireKey: 'VoteFirstValid', optional: false, codec: bigIntCodec },\n { name: 'voteLastValid', wireKey: 'VoteLastValid', optional: false, codec: bigIntCodec },\n { name: 'voteKeyDilution', wireKey: 'VoteKeyDilution', optional: false, codec: bigIntCodec },\n ],\n}\n\n/**\n * Contains base account info like balance, status and total number of resources.\n */\nexport type LedgerAccountBaseData = {\n /**\n * Account status. Values are:\n * * 0: Offline\n * * 1: Online\n * * 2: NotParticipating\n */\n status: number\n microAlgos: bigint\n rewardsBase: bigint\n rewardedMicroAlgos: bigint\n authAddress: Address\n incentiveEligible: boolean\n /**\n * Totals across created globals, and opted in locals.\n */\n totalAppSchema: LedgerStateSchema\n /**\n * Total number of extra pages across all created apps.\n */\n totalExtraAppPages: number\n /**\n * Total number of apps this account has created.\n */\n totalAppParams: number\n /**\n * Total number of apps this account is opted into.\n */\n totalAppLocalStates: number\n /**\n * Total number of assets created by this account.\n */\n totalAssetParams: number\n /**\n * Total of asset creations and optins (i.e. number of holdings).\n */\n totalAssets: number\n /**\n * Total number of boxes associated to this account.\n */\n totalBoxes: bigint\n /**\n * Total bytes for this account's boxes. keys and values count.\n */\n totalBoxBytes: bigint\n /**\n * The last round that this account proposed the winning block.\n */\n lastProposed: bigint\n /**\n * The last round that this account sent a heartbeat to show it was online.\n */\n lastHeartbeat: bigint\n}\n\nexport const LedgerAccountBaseDataMeta: ObjectModelMetadata<LedgerAccountBaseData> = {\n name: 'LedgerAccountBaseData',\n kind: 'object',\n fields: [\n { name: 'status', wireKey: 'Status', optional: false, codec: numberCodec },\n { name: 'microAlgos', wireKey: 'MicroAlgos', optional: false, codec: bigIntCodec },\n { name: 'rewardsBase', wireKey: 'RewardsBase', optional: false, codec: bigIntCodec },\n {\n name: 'rewardedMicroAlgos',\n wireKey: 'RewardedMicroAlgos',\n optional: false,\n codec: bigIntCodec,\n },\n { name: 'authAddress', wireKey: 'AuthAddr', optional: false, codec: addressCodec },\n { name: 'incentiveEligible', wireKey: 'IncentiveEligible', optional: false, codec: booleanCodec },\n {\n name: 'totalAppSchema',\n wireKey: 'TotalAppSchema',\n optional: false,\n codec: new ObjectModelCodec(LedgerStateSchemaMeta),\n },\n { name: 'totalExtraAppPages', wireKey: 'TotalExtraAppPages', optional: false, codec: numberCodec },\n { name: 'totalAppParams', wireKey: 'TotalAppParams', optional: false, codec: numberCodec },\n { name: 'totalAppLocalStates', wireKey: 'TotalAppLocalStates', optional: false, codec: numberCodec },\n { name: 'totalAssetParams', wireKey: 'TotalAssetParams', optional: false, codec: numberCodec },\n { name: 'totalAssets', wireKey: 'TotalAssets', optional: false, codec: numberCodec },\n { name: 'totalBoxes', wireKey: 'TotalBoxes', optional: false, codec: bigIntCodec },\n { name: 'totalBoxBytes', wireKey: 'TotalBoxBytes', optional: false, codec: bigIntCodec },\n { name: 'lastProposed', wireKey: 'LastProposed', optional: false, codec: bigIntCodec },\n { name: 'lastHeartbeat', wireKey: 'LastHeartbeat', optional: false, codec: bigIntCodec },\n ],\n}\n\n/**\n * Provides per-account data.\n */\nexport type LedgerAccountData = {\n accountBaseData: LedgerAccountBaseData\n votingData: LedgerVotingData\n}\n\nexport const LedgerAccountDataMeta: ObjectModelMetadata<LedgerAccountData> = {\n name: 'LedgerAccountData',\n kind: 'object',\n fields: [\n {\n name: 'accountBaseData',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(LedgerAccountBaseDataMeta),\n },\n { name: 'votingData', flattened: true, optional: false, codec: new ObjectModelCodec(LedgerVotingDataMeta) },\n ],\n}\n\nexport type LedgerBalanceRecord = {\n address: Address\n accountData: LedgerAccountData\n}\n\nexport const LedgerBalanceRecordMeta: ObjectModelMetadata<LedgerBalanceRecord> = {\n name: 'LedgerBalanceRecord',\n kind: 'object',\n fields: [\n { name: 'address', wireKey: 'Addr', optional: false, codec: addressCodec },\n { name: 'accountData', flattened: true, optional: false, codec: new ObjectModelCodec(LedgerAccountDataMeta) },\n ],\n}\n\nexport type LedgerAccountDeltas = {\n accounts?: LedgerBalanceRecord[]\n appResources?: LedgerAppResourceRecord[]\n assetResources?: LedgerAssetResourceRecord[]\n}\n\nexport const LedgerAccountDeltasMeta: ObjectModelMetadata<LedgerAccountDeltas> = {\n name: 'LedgerAccountDeltas',\n kind: 'object',\n fields: [\n {\n name: 'accounts',\n wireKey: 'Accts',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(LedgerBalanceRecordMeta)),\n },\n {\n name: 'appResources',\n wireKey: 'AppResources',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(LedgerAppResourceRecordMeta)),\n },\n {\n name: 'assetResources',\n wireKey: 'AssetResources',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(LedgerAssetResourceRecordMeta)),\n },\n ],\n}\n\n/**\n * Shows how the data associated with a key in the kvstore has changed.\n */\nexport type LedgerKvValueDelta = {\n /**\n * Stores the most recent value (undefined means deleted).\n */\n data?: Uint8Array\n /**\n * Stores the previous value (undefined means didn't exist).\n */\n oldData?: Uint8Array\n}\n\nexport const LedgerKvValueDeltaMeta: ObjectModelMetadata<LedgerKvValueDelta> = {\n name: 'LedgerKvValueDelta',\n kind: 'object',\n fields: [\n { name: 'data', wireKey: 'Data', optional: true, codec: bytesCodec },\n { name: 'oldData', wireKey: 'OldData', optional: true, codec: bytesCodec },\n ],\n}\n\n/**\n * Defines the transactions included in a block, their index and last valid round.\n */\nexport type LedgerIncludedTransactions = {\n lastValid: bigint\n /**\n * The index of the transaction in the block.\n */\n intra: number\n}\n\nexport const LedgerIncludedTransactionsMeta: ObjectModelMetadata<LedgerIncludedTransactions> = {\n name: 'LedgerIncludedTransactions',\n kind: 'object',\n fields: [\n { name: 'lastValid', wireKey: 'LastValid', optional: false, codec: bigIntCodec },\n { name: 'intra', wireKey: 'Intra', optional: false, codec: numberCodec },\n ],\n}\n\n/**\n * Represents a change to a single creatable state.\n */\nexport type LedgerModifiedCreatable = {\n /**\n * Type of the creatable. The values are:\n * * 0: Asset\n * * 1: Application\n */\n creatableType: number\n /**\n * Created if true, deleted if false.\n */\n created: boolean\n /**\n * Creator of the app/asset.\n */\n creator: Address\n /**\n * Keeps track of how many times this app/asset appears in accountUpdates.creatableDeltas.\n */\n nDeltas: number\n}\n\nexport const LedgerModifiedCreatableMeta: ObjectModelMetadata<LedgerModifiedCreatable> = {\n name: 'LedgerModifiedCreatable',\n kind: 'object',\n fields: [\n { name: 'creatableType', wireKey: 'Ctype', optional: false, codec: numberCodec },\n { name: 'created', wireKey: 'Created', optional: false, codec: booleanCodec },\n { name: 'creator', wireKey: 'Creator', optional: false, codec: addressCodec },\n { name: 'ndeltas', wireKey: 'Ndeltas', optional: false, codec: numberCodec },\n ],\n}\n\n/**\n * Represents a total of algos of a certain class of accounts (split up by their Status value).\n */\nexport type LedgerAlgoCount = {\n /**\n * Sum of algos of all accounts in this scope.\n */\n money: bigint\n /**\n * Total number of whole reward units in accounts.\n */\n rewardUnits: bigint\n}\n\nexport const LedgerAlgoCountMeta: ObjectModelMetadata<LedgerAlgoCount> = {\n name: 'LedgerAlgoCount',\n kind: 'object',\n fields: [\n { name: 'money', wireKey: 'mon', optional: false, codec: bigIntCodec },\n { name: 'rewardUnits', wireKey: 'rwd', optional: false, codec: bigIntCodec },\n ],\n}\n\n/**\n * Represents the totals of algos in the system grouped by different account status values.\n */\nexport type LedgerAccountTotals = {\n online: LedgerAlgoCount\n offline: LedgerAlgoCount\n notParticipating: LedgerAlgoCount\n /**\n * Total number of algos received per reward unit since genesis.\n */\n rewardsLevel: bigint\n}\n\nexport const LedgerAccountTotalsMeta: ObjectModelMetadata<LedgerAccountTotals> = {\n name: 'LedgerAccountTotals',\n kind: 'object',\n fields: [\n { name: 'online', wireKey: 'online', optional: false, codec: new ObjectModelCodec(LedgerAlgoCountMeta) },\n { name: 'offline', wireKey: 'offline', optional: false, codec: new ObjectModelCodec(LedgerAlgoCountMeta) },\n { name: 'notParticipating', wireKey: 'notpart', optional: false, codec: new ObjectModelCodec(LedgerAlgoCountMeta) },\n { name: 'rewardsLevel', wireKey: 'rwdlvl', optional: false, codec: bigIntCodec },\n ],\n}\n\n/**\n * Describes the delta between a given round to the previous round.\n */\nexport type LedgerStateDelta = {\n /**\n * Modified new accounts.\n */\n accounts: LedgerAccountDeltas\n /**\n * Block header.\n */\n block: Block\n /**\n * Represents modification on StateProofNextRound field in the block header. If the block contains\n * a valid state proof transaction, this field will contain the next round for state proof.\n * otherwise it will be set to 0.\n */\n stateProofNext: bigint\n /**\n * Previous block timestamp\n */\n prevTimestamp: bigint\n /**\n * The account totals reflecting the changes in this StateDelta object.\n */\n totals: LedgerAccountTotals\n /**\n * Modified kv pairs.\n */\n kvMods?: Map<Uint8Array, LedgerKvValueDelta>\n /**\n * New Txids for the txtail and TxnCounter, mapped to txn.LastValid.\n */\n txIds?: Map<Uint8Array, LedgerIncludedTransactions>\n /**\n * New creatables creator lookup table.\n */\n creatables?: Map<number, LedgerModifiedCreatable>\n}\n\nexport const LedgerStateDeltaMeta: ObjectModelMetadata<LedgerStateDelta> = {\n name: 'LedgerStateDelta',\n kind: 'object',\n fields: [\n { name: 'accounts', wireKey: 'Accts', optional: false, codec: new ObjectModelCodec(LedgerAccountDeltasMeta) },\n { name: 'block', wireKey: 'Hdr', optional: false, codec: blockCodec },\n { name: 'stateProofNext', wireKey: 'StateProofNext', optional: false, codec: bigIntCodec },\n { name: 'prevTimestamp', wireKey: 'PrevTimestamp', optional: false, codec: bigIntCodec },\n { name: 'totals', wireKey: 'Totals', optional: false, codec: new ObjectModelCodec(LedgerAccountTotalsMeta) },\n {\n name: 'kvMods',\n wireKey: 'KvMods',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(LedgerKvValueDeltaMeta)),\n },\n {\n name: 'txIds',\n wireKey: 'Txids',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(LedgerIncludedTransactionsMeta)),\n },\n {\n name: 'creatables',\n wireKey: 'Creatables',\n optional: true,\n codec: new MapCodec(numberCodec, new ObjectModelCodec(LedgerModifiedCreatableMeta)),\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,MAAaA,sBAA4D;CACvE,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAO,OAAO;GAAa;EACpE;GAAE,MAAM;GAAS,SAAS;GAAM,UAAU;GAAM,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O,UAAU;GAAO,OAAO;GAAY;EACrE;GAAE,MAAM;GAAkB,SAAS;GAAkB,UAAU;GAAO,OAAO;GAAa;EAC1F;GAAE,MAAM;GAAiB,SAAS;GAAiB,UAAU;GAAO,OAAO;GAAa;EACxF;GAAE,MAAM;GAAU,SAAS;GAAU,UAAU;GAAO,OAAO,IAAI,iBAAiB,wBAAwB;GAAE;EAC5G;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,YAAY,IAAI,iBAAiB,uBAAuB,CAAC;GAC9E;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,YAAY,IAAI,iBAAiB,+BAA+B,CAAC;GACtF;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,aAAa,IAAI,iBAAiB,4BAA4B,CAAC;GACpF;EACF;CACF"}
@@ -1,7 +1,5 @@
1
1
  import { Address } from "../../../common/src/address.js";
2
- import { AssetHoldingReference } from "./asset-holding-reference.js";
3
- import { ApplicationLocalReference } from "./application-local-reference.js";
4
- import { BoxReference } from "./box-reference.js";
2
+ import { BoxReference, HoldingReference, LocalsReference } from "../../../transact/src/transactions/app-call.js";
5
3
 
6
4
  //#region packages/algod_client/src/models/simulate-unnamed-resources-accessed.d.ts
7
5
 
@@ -32,11 +30,11 @@ type SimulateUnnamedResourcesAccessed = {
32
30
  /**
33
31
  * The unnamed asset holdings that were referenced. The order of this array is arbitrary.
34
32
  */
35
- assetHoldings?: AssetHoldingReference[];
33
+ assetHoldings?: HoldingReference[];
36
34
  /**
37
35
  * The unnamed application local states that were referenced. The order of this array is arbitrary.
38
36
  */
39
- appLocals?: ApplicationLocalReference[];
37
+ appLocals?: LocalsReference[];
40
38
  };
41
39
  //#endregion
42
40
  export { SimulateUnnamedResourcesAccessed };
@@ -1,9 +1,7 @@
1
1
  const require_number = require('../../../common/src/codecs/primitives/number.js');
2
2
  const require_array = require('../../../common/src/codecs/composite/array.js');
3
3
  const require_object_model = require('../../../common/src/codecs/models/object-model.js');
4
- const require_asset_holding_reference = require('./asset-holding-reference.js');
5
- const require_application_local_reference = require('./application-local-reference.js');
6
- const require_box_reference = require('./box-reference.js');
4
+ const require_reference_types_meta = require('../../../transact/src/transactions/reference-types-meta.js');
7
5
 
8
6
  //#region packages/algod_client/src/models/simulate-unnamed-resources-accessed.ts
9
7
  const SimulateUnnamedResourcesAccessedMeta = {
@@ -32,7 +30,7 @@ const SimulateUnnamedResourcesAccessedMeta = {
32
30
  name: "boxes",
33
31
  wireKey: "boxes",
34
32
  optional: true,
35
- codec: new require_array.ArrayCodec(new require_object_model.ObjectModelCodec(require_box_reference.BoxReferenceMeta))
33
+ codec: new require_array.ArrayCodec(new require_object_model.ObjectModelCodec(require_reference_types_meta.BoxReferenceMeta))
36
34
  },
37
35
  {
38
36
  name: "extraBoxRefs",
@@ -44,13 +42,13 @@ const SimulateUnnamedResourcesAccessedMeta = {
44
42
  name: "assetHoldings",
45
43
  wireKey: "asset-holdings",
46
44
  optional: true,
47
- codec: new require_array.ArrayCodec(new require_object_model.ObjectModelCodec(require_asset_holding_reference.AssetHoldingReferenceMeta))
45
+ codec: new require_array.ArrayCodec(new require_object_model.ObjectModelCodec(require_reference_types_meta.HoldingReferenceMeta))
48
46
  },
49
47
  {
50
48
  name: "appLocals",
51
49
  wireKey: "app-locals",
52
50
  optional: true,
53
- codec: new require_array.ArrayCodec(new require_object_model.ObjectModelCodec(require_application_local_reference.ApplicationLocalReferenceMeta))
51
+ codec: new require_array.ArrayCodec(new require_object_model.ObjectModelCodec(require_reference_types_meta.LocalsReferenceMeta))
54
52
  }
55
53
  ]
56
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"simulate-unnamed-resources-accessed.js","names":["SimulateUnnamedResourcesAccessedMeta: ObjectModelMetadata<SimulateUnnamedResourcesAccessed>","addressArrayCodec","bigIntArrayCodec","ArrayCodec","ObjectModelCodec","BoxReferenceMeta","numberCodec","AssetHoldingReferenceMeta","ApplicationLocalReferenceMeta"],"sources":["../../../../../packages/algod_client/src/models/simulate-unnamed-resources-accessed.ts"],"sourcesContent":["import type { Address, ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, ArrayCodec, bigIntArrayCodec, addressArrayCodec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { ApplicationLocalReference } from './application-local-reference'\nimport { ApplicationLocalReferenceMeta } from './application-local-reference'\nimport type { AssetHoldingReference } from './asset-holding-reference'\nimport { AssetHoldingReferenceMeta } from './asset-holding-reference'\nimport type { BoxReference } from './box-reference'\nimport { BoxReferenceMeta } from './box-reference'\n\n/**\n * These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.\n */\nexport type SimulateUnnamedResourcesAccessed = {\n /**\n * The unnamed accounts that were referenced. The order of this array is arbitrary.\n */\n accounts?: Address[]\n\n /**\n * The unnamed assets that were referenced. The order of this array is arbitrary.\n */\n assets?: bigint[]\n\n /**\n * The unnamed applications that were referenced. The order of this array is arbitrary.\n */\n apps?: bigint[]\n\n /**\n * The unnamed boxes that were referenced. The order of this array is arbitrary.\n */\n boxes?: BoxReference[]\n\n /**\n * The number of extra box references used to increase the IO budget. This is in addition to the references defined in the input transaction group and any referenced to unnamed boxes.\n */\n extraBoxRefs?: number\n\n /**\n * The unnamed asset holdings that were referenced. The order of this array is arbitrary.\n */\n assetHoldings?: AssetHoldingReference[]\n\n /**\n * The unnamed application local states that were referenced. The order of this array is arbitrary.\n */\n appLocals?: ApplicationLocalReference[]\n}\n\nexport const SimulateUnnamedResourcesAccessedMeta: ObjectModelMetadata<SimulateUnnamedResourcesAccessed> = {\n name: 'SimulateUnnamedResourcesAccessed',\n kind: 'object',\n fields: [\n {\n name: 'accounts',\n wireKey: 'accounts',\n optional: true,\n codec: addressArrayCodec,\n },\n {\n name: 'assets',\n wireKey: 'assets',\n optional: true,\n codec: bigIntArrayCodec,\n },\n {\n name: 'apps',\n wireKey: 'apps',\n optional: true,\n codec: bigIntArrayCodec,\n },\n {\n name: 'boxes',\n wireKey: 'boxes',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(BoxReferenceMeta)),\n },\n {\n name: 'extraBoxRefs',\n wireKey: 'extra-box-refs',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'assetHoldings',\n wireKey: 'asset-holdings',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(AssetHoldingReferenceMeta)),\n },\n {\n name: 'appLocals',\n wireKey: 'app-locals',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(ApplicationLocalReferenceMeta)),\n },\n ],\n}\n"],"mappings":";;;;;;;;AAiDA,MAAaA,uCAA8F;CACzG,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIC,yBAAW,IAAIC,sCAAiBC,uCAAiB,CAAC;GAC9D;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIH,yBAAW,IAAIC,sCAAiBG,0DAA0B,CAAC;GACvE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIJ,yBAAW,IAAIC,sCAAiBI,kEAA8B,CAAC;GAC3E;EACF;CACF"}
1
+ {"version":3,"file":"simulate-unnamed-resources-accessed.js","names":["SimulateUnnamedResourcesAccessedMeta: ObjectModelMetadata<SimulateUnnamedResourcesAccessed>","addressArrayCodec","bigIntArrayCodec","ArrayCodec","ObjectModelCodec","BoxReferenceMeta","numberCodec","HoldingReferenceMeta","LocalsReferenceMeta"],"sources":["../../../../../packages/algod_client/src/models/simulate-unnamed-resources-accessed.ts"],"sourcesContent":["import type { Address, ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, ArrayCodec, bigIntArrayCodec, addressArrayCodec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { BoxReference, HoldingReference, LocalsReference } from '@algorandfoundation/algokit-transact'\nimport { BoxReferenceMeta, HoldingReferenceMeta, LocalsReferenceMeta } from '@algorandfoundation/algokit-transact'\n\n/**\n * These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.\n */\nexport type SimulateUnnamedResourcesAccessed = {\n /**\n * The unnamed accounts that were referenced. The order of this array is arbitrary.\n */\n accounts?: Address[]\n\n /**\n * The unnamed assets that were referenced. The order of this array is arbitrary.\n */\n assets?: bigint[]\n\n /**\n * The unnamed applications that were referenced. The order of this array is arbitrary.\n */\n apps?: bigint[]\n\n /**\n * The unnamed boxes that were referenced. The order of this array is arbitrary.\n */\n boxes?: BoxReference[]\n\n /**\n * The number of extra box references used to increase the IO budget. This is in addition to the references defined in the input transaction group and any referenced to unnamed boxes.\n */\n extraBoxRefs?: number\n\n /**\n * The unnamed asset holdings that were referenced. The order of this array is arbitrary.\n */\n assetHoldings?: HoldingReference[]\n\n /**\n * The unnamed application local states that were referenced. The order of this array is arbitrary.\n */\n appLocals?: LocalsReference[]\n}\n\nexport const SimulateUnnamedResourcesAccessedMeta: ObjectModelMetadata<SimulateUnnamedResourcesAccessed> = {\n name: 'SimulateUnnamedResourcesAccessed',\n kind: 'object',\n fields: [\n {\n name: 'accounts',\n wireKey: 'accounts',\n optional: true,\n codec: addressArrayCodec,\n },\n {\n name: 'assets',\n wireKey: 'assets',\n optional: true,\n codec: bigIntArrayCodec,\n },\n {\n name: 'apps',\n wireKey: 'apps',\n optional: true,\n codec: bigIntArrayCodec,\n },\n {\n name: 'boxes',\n wireKey: 'boxes',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(BoxReferenceMeta)),\n },\n {\n name: 'extraBoxRefs',\n wireKey: 'extra-box-refs',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'assetHoldings',\n wireKey: 'asset-holdings',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(HoldingReferenceMeta)),\n },\n {\n name: 'appLocals',\n wireKey: 'app-locals',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(LocalsReferenceMeta)),\n },\n ],\n}\n"],"mappings":";;;;;;AA6CA,MAAaA,uCAA8F;CACzG,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIC,yBAAW,IAAIC,sCAAiBC,8CAAiB,CAAC;GAC9D;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIH,yBAAW,IAAIC,sCAAiBG,kDAAqB,CAAC;GAClE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIJ,yBAAW,IAAIC,sCAAiBI,iDAAoB,CAAC;GACjE;EACF;CACF"}
@@ -1,9 +1,7 @@
1
1
  import { numberCodec } from "../../../common/src/codecs/primitives/number.mjs";
2
2
  import { ArrayCodec, addressArrayCodec, bigIntArrayCodec } from "../../../common/src/codecs/composite/array.mjs";
3
3
  import { ObjectModelCodec } from "../../../common/src/codecs/models/object-model.mjs";
4
- import { AssetHoldingReferenceMeta } from "./asset-holding-reference.mjs";
5
- import { ApplicationLocalReferenceMeta } from "./application-local-reference.mjs";
6
- import { BoxReferenceMeta } from "./box-reference.mjs";
4
+ import { BoxReferenceMeta, HoldingReferenceMeta, LocalsReferenceMeta } from "../../../transact/src/transactions/reference-types-meta.mjs";
7
5
 
8
6
  //#region packages/algod_client/src/models/simulate-unnamed-resources-accessed.ts
9
7
  const SimulateUnnamedResourcesAccessedMeta = {
@@ -44,13 +42,13 @@ const SimulateUnnamedResourcesAccessedMeta = {
44
42
  name: "assetHoldings",
45
43
  wireKey: "asset-holdings",
46
44
  optional: true,
47
- codec: new ArrayCodec(new ObjectModelCodec(AssetHoldingReferenceMeta))
45
+ codec: new ArrayCodec(new ObjectModelCodec(HoldingReferenceMeta))
48
46
  },
49
47
  {
50
48
  name: "appLocals",
51
49
  wireKey: "app-locals",
52
50
  optional: true,
53
- codec: new ArrayCodec(new ObjectModelCodec(ApplicationLocalReferenceMeta))
51
+ codec: new ArrayCodec(new ObjectModelCodec(LocalsReferenceMeta))
54
52
  }
55
53
  ]
56
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"simulate-unnamed-resources-accessed.mjs","names":["SimulateUnnamedResourcesAccessedMeta: ObjectModelMetadata<SimulateUnnamedResourcesAccessed>"],"sources":["../../../../../packages/algod_client/src/models/simulate-unnamed-resources-accessed.ts"],"sourcesContent":["import type { Address, ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, ArrayCodec, bigIntArrayCodec, addressArrayCodec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { ApplicationLocalReference } from './application-local-reference'\nimport { ApplicationLocalReferenceMeta } from './application-local-reference'\nimport type { AssetHoldingReference } from './asset-holding-reference'\nimport { AssetHoldingReferenceMeta } from './asset-holding-reference'\nimport type { BoxReference } from './box-reference'\nimport { BoxReferenceMeta } from './box-reference'\n\n/**\n * These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.\n */\nexport type SimulateUnnamedResourcesAccessed = {\n /**\n * The unnamed accounts that were referenced. The order of this array is arbitrary.\n */\n accounts?: Address[]\n\n /**\n * The unnamed assets that were referenced. The order of this array is arbitrary.\n */\n assets?: bigint[]\n\n /**\n * The unnamed applications that were referenced. The order of this array is arbitrary.\n */\n apps?: bigint[]\n\n /**\n * The unnamed boxes that were referenced. The order of this array is arbitrary.\n */\n boxes?: BoxReference[]\n\n /**\n * The number of extra box references used to increase the IO budget. This is in addition to the references defined in the input transaction group and any referenced to unnamed boxes.\n */\n extraBoxRefs?: number\n\n /**\n * The unnamed asset holdings that were referenced. The order of this array is arbitrary.\n */\n assetHoldings?: AssetHoldingReference[]\n\n /**\n * The unnamed application local states that were referenced. The order of this array is arbitrary.\n */\n appLocals?: ApplicationLocalReference[]\n}\n\nexport const SimulateUnnamedResourcesAccessedMeta: ObjectModelMetadata<SimulateUnnamedResourcesAccessed> = {\n name: 'SimulateUnnamedResourcesAccessed',\n kind: 'object',\n fields: [\n {\n name: 'accounts',\n wireKey: 'accounts',\n optional: true,\n codec: addressArrayCodec,\n },\n {\n name: 'assets',\n wireKey: 'assets',\n optional: true,\n codec: bigIntArrayCodec,\n },\n {\n name: 'apps',\n wireKey: 'apps',\n optional: true,\n codec: bigIntArrayCodec,\n },\n {\n name: 'boxes',\n wireKey: 'boxes',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(BoxReferenceMeta)),\n },\n {\n name: 'extraBoxRefs',\n wireKey: 'extra-box-refs',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'assetHoldings',\n wireKey: 'asset-holdings',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(AssetHoldingReferenceMeta)),\n },\n {\n name: 'appLocals',\n wireKey: 'app-locals',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(ApplicationLocalReferenceMeta)),\n },\n ],\n}\n"],"mappings":";;;;;;;;AAiDA,MAAaA,uCAA8F;CACzG,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,iBAAiB,CAAC;GAC9D;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,0BAA0B,CAAC;GACvE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,8BAA8B,CAAC;GAC3E;EACF;CACF"}
1
+ {"version":3,"file":"simulate-unnamed-resources-accessed.mjs","names":["SimulateUnnamedResourcesAccessedMeta: ObjectModelMetadata<SimulateUnnamedResourcesAccessed>"],"sources":["../../../../../packages/algod_client/src/models/simulate-unnamed-resources-accessed.ts"],"sourcesContent":["import type { Address, ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, ArrayCodec, bigIntArrayCodec, addressArrayCodec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { BoxReference, HoldingReference, LocalsReference } from '@algorandfoundation/algokit-transact'\nimport { BoxReferenceMeta, HoldingReferenceMeta, LocalsReferenceMeta } from '@algorandfoundation/algokit-transact'\n\n/**\n * These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.\n */\nexport type SimulateUnnamedResourcesAccessed = {\n /**\n * The unnamed accounts that were referenced. The order of this array is arbitrary.\n */\n accounts?: Address[]\n\n /**\n * The unnamed assets that were referenced. The order of this array is arbitrary.\n */\n assets?: bigint[]\n\n /**\n * The unnamed applications that were referenced. The order of this array is arbitrary.\n */\n apps?: bigint[]\n\n /**\n * The unnamed boxes that were referenced. The order of this array is arbitrary.\n */\n boxes?: BoxReference[]\n\n /**\n * The number of extra box references used to increase the IO budget. This is in addition to the references defined in the input transaction group and any referenced to unnamed boxes.\n */\n extraBoxRefs?: number\n\n /**\n * The unnamed asset holdings that were referenced. The order of this array is arbitrary.\n */\n assetHoldings?: HoldingReference[]\n\n /**\n * The unnamed application local states that were referenced. The order of this array is arbitrary.\n */\n appLocals?: LocalsReference[]\n}\n\nexport const SimulateUnnamedResourcesAccessedMeta: ObjectModelMetadata<SimulateUnnamedResourcesAccessed> = {\n name: 'SimulateUnnamedResourcesAccessed',\n kind: 'object',\n fields: [\n {\n name: 'accounts',\n wireKey: 'accounts',\n optional: true,\n codec: addressArrayCodec,\n },\n {\n name: 'assets',\n wireKey: 'assets',\n optional: true,\n codec: bigIntArrayCodec,\n },\n {\n name: 'apps',\n wireKey: 'apps',\n optional: true,\n codec: bigIntArrayCodec,\n },\n {\n name: 'boxes',\n wireKey: 'boxes',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(BoxReferenceMeta)),\n },\n {\n name: 'extraBoxRefs',\n wireKey: 'extra-box-refs',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'assetHoldings',\n wireKey: 'asset-holdings',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(HoldingReferenceMeta)),\n },\n {\n name: 'appLocals',\n wireKey: 'app-locals',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(LocalsReferenceMeta)),\n },\n ],\n}\n"],"mappings":";;;;;;AA6CA,MAAaA,uCAA8F;CACzG,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,iBAAiB,CAAC;GAC9D;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,qBAAqB,CAAC;GAClE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,oBAAoB,CAAC;GACjE;EACF;CACF"}
@@ -1,5 +1,5 @@
1
1
  const require_bigint = require('../../../common/src/codecs/primitives/bigint.js');
2
- const require_bytes = require('../../../common/src/codecs/primitives/bytes.js');
2
+ const require_fixed_bytes = require('../../../common/src/codecs/primitives/fixed-bytes.js');
3
3
  const require_string = require('../../../common/src/codecs/primitives/string.js');
4
4
 
5
5
  //#region packages/algod_client/src/models/transaction-parameters-response.ts
@@ -23,7 +23,7 @@ const TransactionParametersResponseMeta = {
23
23
  name: "genesisHash",
24
24
  wireKey: "genesis-hash",
25
25
  optional: false,
26
- codec: require_bytes.bytesCodec
26
+ codec: require_fixed_bytes.fixedBytes32Codec
27
27
  },
28
28
  {
29
29
  name: "genesisId",
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-parameters-response.js","names":["TransactionParametersResponseMeta: ObjectModelMetadata<TransactionParametersResponse>","stringCodec","bigIntCodec","bytesCodec"],"sources":["../../../../../packages/algod_client/src/models/transaction-parameters-response.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { stringCodec, bigIntCodec, bytesCodec } from '@algorandfoundation/algokit-common'\n\n/**\n * TransactionParams contains the parameters that help a client construct\n * a new transaction.\n */\nexport type TransactionParametersResponse = {\n /**\n * ConsensusVersion indicates the consensus protocol version\n * as of LastRound.\n */\n consensusVersion: string\n\n /**\n * Fee is the suggested transaction fee\n * Fee is in units of micro-Algos per byte.\n * Fee may fall to zero but transactions must still have a fee of\n * at least MinTxnFee for the current network protocol.\n */\n fee: bigint\n\n /**\n * GenesisHash is the hash of the genesis block.\n */\n genesisHash: Uint8Array\n\n /**\n * GenesisID is an ID listed in the genesis block.\n */\n genesisId: string\n\n /**\n * LastRound indicates the last round seen\n */\n lastRound: bigint\n\n /**\n * The minimum transaction fee (not per byte) required for the\n * txn to validate for the current network protocol.\n */\n minFee: bigint\n}\n\nexport const TransactionParametersResponseMeta: ObjectModelMetadata<TransactionParametersResponse> = {\n name: 'TransactionParametersResponse',\n kind: 'object',\n fields: [\n {\n name: 'consensusVersion',\n wireKey: 'consensus-version',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'fee',\n wireKey: 'fee',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'genesisHash',\n wireKey: 'genesis-hash',\n optional: false,\n codec: bytesCodec,\n },\n {\n name: 'genesisId',\n wireKey: 'genesis-id',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'lastRound',\n wireKey: 'last-round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'minFee',\n wireKey: 'min-fee',\n optional: false,\n codec: bigIntCodec,\n },\n ],\n}\n"],"mappings":";;;;;AA4CA,MAAaA,oCAAwF;CACnG,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOF;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACF;CACF"}
1
+ {"version":3,"file":"transaction-parameters-response.js","names":["TransactionParametersResponseMeta: ObjectModelMetadata<TransactionParametersResponse>","stringCodec","bigIntCodec","fixedBytes32Codec"],"sources":["../../../../../packages/algod_client/src/models/transaction-parameters-response.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { stringCodec, bigIntCodec, fixedBytes32Codec } from '@algorandfoundation/algokit-common'\n\n/**\n * TransactionParams contains the parameters that help a client construct\n * a new transaction.\n */\nexport type TransactionParametersResponse = {\n /**\n * ConsensusVersion indicates the consensus protocol version\n * as of LastRound.\n */\n consensusVersion: string\n\n /**\n * Fee is the suggested transaction fee\n * Fee is in units of micro-Algos per byte.\n * Fee may fall to zero but transactions must still have a fee of\n * at least MinTxnFee for the current network protocol.\n */\n fee: bigint\n\n /**\n * GenesisHash is the hash of the genesis block.\n */\n genesisHash: Uint8Array\n\n /**\n * GenesisID is an ID listed in the genesis block.\n */\n genesisId: string\n\n /**\n * LastRound indicates the last round seen\n */\n lastRound: bigint\n\n /**\n * The minimum transaction fee (not per byte) required for the\n * txn to validate for the current network protocol.\n */\n minFee: bigint\n}\n\nexport const TransactionParametersResponseMeta: ObjectModelMetadata<TransactionParametersResponse> = {\n name: 'TransactionParametersResponse',\n kind: 'object',\n fields: [\n {\n name: 'consensusVersion',\n wireKey: 'consensus-version',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'fee',\n wireKey: 'fee',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'genesisHash',\n wireKey: 'genesis-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'genesisId',\n wireKey: 'genesis-id',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'lastRound',\n wireKey: 'last-round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'minFee',\n wireKey: 'min-fee',\n optional: false,\n codec: bigIntCodec,\n },\n ],\n}\n"],"mappings":";;;;;AA4CA,MAAaA,oCAAwF;CACnG,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOF;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACF;CACF"}
@@ -1,5 +1,5 @@
1
1
  import { bigIntCodec } from "../../../common/src/codecs/primitives/bigint.mjs";
2
- import { bytesCodec } from "../../../common/src/codecs/primitives/bytes.mjs";
2
+ import { fixedBytes32Codec } from "../../../common/src/codecs/primitives/fixed-bytes.mjs";
3
3
  import { stringCodec } from "../../../common/src/codecs/primitives/string.mjs";
4
4
 
5
5
  //#region packages/algod_client/src/models/transaction-parameters-response.ts
@@ -23,7 +23,7 @@ const TransactionParametersResponseMeta = {
23
23
  name: "genesisHash",
24
24
  wireKey: "genesis-hash",
25
25
  optional: false,
26
- codec: bytesCodec
26
+ codec: fixedBytes32Codec
27
27
  },
28
28
  {
29
29
  name: "genesisId",
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-parameters-response.mjs","names":["TransactionParametersResponseMeta: ObjectModelMetadata<TransactionParametersResponse>"],"sources":["../../../../../packages/algod_client/src/models/transaction-parameters-response.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { stringCodec, bigIntCodec, bytesCodec } from '@algorandfoundation/algokit-common'\n\n/**\n * TransactionParams contains the parameters that help a client construct\n * a new transaction.\n */\nexport type TransactionParametersResponse = {\n /**\n * ConsensusVersion indicates the consensus protocol version\n * as of LastRound.\n */\n consensusVersion: string\n\n /**\n * Fee is the suggested transaction fee\n * Fee is in units of micro-Algos per byte.\n * Fee may fall to zero but transactions must still have a fee of\n * at least MinTxnFee for the current network protocol.\n */\n fee: bigint\n\n /**\n * GenesisHash is the hash of the genesis block.\n */\n genesisHash: Uint8Array\n\n /**\n * GenesisID is an ID listed in the genesis block.\n */\n genesisId: string\n\n /**\n * LastRound indicates the last round seen\n */\n lastRound: bigint\n\n /**\n * The minimum transaction fee (not per byte) required for the\n * txn to validate for the current network protocol.\n */\n minFee: bigint\n}\n\nexport const TransactionParametersResponseMeta: ObjectModelMetadata<TransactionParametersResponse> = {\n name: 'TransactionParametersResponse',\n kind: 'object',\n fields: [\n {\n name: 'consensusVersion',\n wireKey: 'consensus-version',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'fee',\n wireKey: 'fee',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'genesisHash',\n wireKey: 'genesis-hash',\n optional: false,\n codec: bytesCodec,\n },\n {\n name: 'genesisId',\n wireKey: 'genesis-id',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'lastRound',\n wireKey: 'last-round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'minFee',\n wireKey: 'min-fee',\n optional: false,\n codec: bigIntCodec,\n },\n ],\n}\n"],"mappings":";;;;;AA4CA,MAAaA,oCAAwF;CACnG,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACF;CACF"}
1
+ {"version":3,"file":"transaction-parameters-response.mjs","names":["TransactionParametersResponseMeta: ObjectModelMetadata<TransactionParametersResponse>"],"sources":["../../../../../packages/algod_client/src/models/transaction-parameters-response.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { stringCodec, bigIntCodec, fixedBytes32Codec } from '@algorandfoundation/algokit-common'\n\n/**\n * TransactionParams contains the parameters that help a client construct\n * a new transaction.\n */\nexport type TransactionParametersResponse = {\n /**\n * ConsensusVersion indicates the consensus protocol version\n * as of LastRound.\n */\n consensusVersion: string\n\n /**\n * Fee is the suggested transaction fee\n * Fee is in units of micro-Algos per byte.\n * Fee may fall to zero but transactions must still have a fee of\n * at least MinTxnFee for the current network protocol.\n */\n fee: bigint\n\n /**\n * GenesisHash is the hash of the genesis block.\n */\n genesisHash: Uint8Array\n\n /**\n * GenesisID is an ID listed in the genesis block.\n */\n genesisId: string\n\n /**\n * LastRound indicates the last round seen\n */\n lastRound: bigint\n\n /**\n * The minimum transaction fee (not per byte) required for the\n * txn to validate for the current network protocol.\n */\n minFee: bigint\n}\n\nexport const TransactionParametersResponseMeta: ObjectModelMetadata<TransactionParametersResponse> = {\n name: 'TransactionParametersResponse',\n kind: 'object',\n fields: [\n {\n name: 'consensusVersion',\n wireKey: 'consensus-version',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'fee',\n wireKey: 'fee',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'genesisHash',\n wireKey: 'genesis-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'genesisId',\n wireKey: 'genesis-id',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'lastRound',\n wireKey: 'last-round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'minFee',\n wireKey: 'min-fee',\n optional: false,\n codec: bigIntCodec,\n },\n ],\n}\n"],"mappings":";;;;;AA4CA,MAAaA,oCAAwF;CACnG,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACF;CACF"}
@@ -102,19 +102,6 @@ function getOptionalAddress(addr) {
102
102
  if (addr === void 0) return;
103
103
  return getAddress(addr);
104
104
  }
105
- /**
106
- * isValidAddress checks if a string is a valid Algorand address.
107
- * @param address - an Algorand address with checksum.
108
- * @returns true if valid, false otherwise
109
- */
110
- function isValidAddress(address) {
111
- try {
112
- Address.fromString(address);
113
- } catch {
114
- return false;
115
- }
116
- return true;
117
- }
118
105
  const APP_ID_PREFIX = new TextEncoder().encode("appID");
119
106
  /**
120
107
  * Get the escrow address of an application.
@@ -152,5 +139,4 @@ exports.encodeAddress = encodeAddress;
152
139
  exports.getAddress = getAddress;
153
140
  exports.getApplicationAddress = getApplicationAddress;
154
141
  exports.getOptionalAddress = getOptionalAddress;
155
- exports.isValidAddress = isValidAddress;
156
142
  //# sourceMappingURL=address.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"address.js","names":["sha512","HASH_BYTES_LENGTH","CHECKSUM_BYTE_LENGTH","arrayEqual","base32","concatArrays"],"sources":["../../../../packages/common/src/address.ts"],"sourcesContent":["import base32 from 'hi-base32'\nimport sha512 from 'js-sha512'\nimport { arrayEqual, concatArrays } from './array'\nimport { CHECKSUM_BYTE_LENGTH, HASH_BYTES_LENGTH } from './constants'\n\nexport const ALGORAND_ADDRESS_BYTE_LENGTH = 36\nexport const ALGORAND_CHECKSUM_BYTE_LENGTH = 4\nexport const ALGORAND_ADDRESS_LENGTH = 58\nexport const ALGORAND_ZERO_ADDRESS_STRING = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ'\n\nexport const MALFORMED_ADDRESS_ERROR_MSG = 'address seems to be malformed'\nexport const CHECKSUM_ADDRESS_ERROR_MSG = 'wrong checksum for address'\n\nexport function checksumFromPublicKey(publicKey: Uint8Array): Uint8Array {\n return Uint8Array.from(sha512.sha512_256.array(publicKey).slice(HASH_BYTES_LENGTH - CHECKSUM_BYTE_LENGTH, HASH_BYTES_LENGTH))\n}\n\nfunction genericHash(arr: sha512.Message) {\n return sha512.sha512_256.array(arr)\n}\n\nfunction bytesToHex(bytes: Uint8Array): string {\n return Buffer.from(bytes).toString('hex')\n}\n\nexport function encodeUint64(num: number | bigint) {\n const isInteger = typeof num === 'bigint' || Number.isInteger(num)\n\n if (!isInteger || num < 0 || num > BigInt('0xffffffffffffffff')) {\n throw new Error('Input is not a 64-bit unsigned integer')\n }\n\n const encoding = new Uint8Array(8)\n const view = new DataView(encoding.buffer)\n view.setBigUint64(0, BigInt(num))\n\n return encoding\n}\n\n/** Symbol used for instanceof checks across packages (CJS/ESM) */\nconst ADDR_SYMBOL = Symbol.for('algokit_common:Address')\n\n/**\n * Represents an Algorand address\n */\nexport class Address {\n /**\n * The binary form of the address. For standard accounts, this is the public key.\n */\n public readonly publicKey: Uint8Array;\n\n /** @internal */\n [ADDR_SYMBOL]: boolean\n\n /**\n * Create a new Address object from its binary form.\n * @param publicKey - The binary form of the address. Must be 32 bytes.\n */\n constructor(publicKey: Uint8Array) {\n this[ADDR_SYMBOL] = true\n if (publicKey.length !== ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: 0x${bytesToHex(publicKey)}, length ${publicKey.length}`)\n this.publicKey = publicKey\n }\n\n /**\n * Check if the address is equal to another address.\n */\n equals(other: Address): boolean {\n return other instanceof Address && arrayEqual(this.publicKey, other.publicKey)\n }\n\n /**\n * Compute the 4 byte checksum of the address.\n */\n checksum(): Uint8Array {\n return checksumFromPublicKey(this.publicKey)\n }\n\n /**\n * Encode the address into a string form.\n */\n toString(): string {\n const addr = base32.encode(concatArrays(this.publicKey, this.checksum()))\n return addr.slice(0, ALGORAND_ADDRESS_LENGTH) // removing the extra '===='\n }\n\n /**\n * Decode an address from a string.\n * @param address - The address to decode. Must be 58 characters long.\n * @returns An Address object corresponding to the input string.\n */\n static fromString(address: string): Address {\n if (typeof address !== 'string') throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected string, got ${typeof address}, ${address}`)\n if (address.length !== ALGORAND_ADDRESS_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected length ${ALGORAND_ADDRESS_LENGTH}, got ${address.length}: ${address}`)\n\n // try to decode\n const decoded = base32.decode.asBytes(address)\n // Sanity check\n if (decoded.length !== ALGORAND_ADDRESS_BYTE_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected byte length ${ALGORAND_ADDRESS_BYTE_LENGTH}, got ${decoded.length}`)\n\n // Find publickey and checksum\n const pk = new Uint8Array(decoded.slice(0, ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH))\n const cs = new Uint8Array(decoded.slice(ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH, ALGORAND_ADDRESS_BYTE_LENGTH))\n const checksum = checksumFromPublicKey(pk)\n // Check if the checksum and the address are equal\n if (!arrayEqual(checksum, cs)) throw new Error(`${CHECKSUM_ADDRESS_ERROR_MSG}: ${address} (${cs}, ${checksum})`)\n\n return new Address(pk)\n }\n\n /**\n * Get the zero address.\n */\n static zeroAddress(): Address {\n return new Address(new Uint8Array(ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH))\n }\n\n static [Symbol.hasInstance](obj: unknown) {\n return Boolean(obj && typeof obj === 'object' && ADDR_SYMBOL in obj && obj[ADDR_SYMBOL as keyof typeof obj])\n }\n}\n\nexport interface Addressable {\n addr: Readonly<Address>\n}\n\nexport type ReadableAddress = Addressable | Address | string\n\nexport function getAddress(addr: ReadableAddress): Address {\n if (typeof addr == 'string') {\n return Address.fromString(addr)\n } else if ('addr' in addr) {\n return addr.addr\n } else {\n return addr\n }\n}\n\nexport function getOptionalAddress(addr: ReadableAddress | undefined): Address | undefined {\n if (addr === undefined) {\n return undefined\n }\n return getAddress(addr)\n}\n\n/**\n * isValidAddress checks if a string is a valid Algorand address.\n * @param address - an Algorand address with checksum.\n * @returns true if valid, false otherwise\n */\nexport function isValidAddress(address: string): boolean {\n // Try to decode\n try {\n Address.fromString(address)\n } catch {\n return false\n }\n return true\n}\n\nconst APP_ID_PREFIX = new TextEncoder().encode('appID')\n\n/**\n * Get the escrow address of an application.\n * @param appID - The ID of the application.\n * @returns The address corresponding to that application's escrow account.\n */\nexport function getApplicationAddress(appID: number | bigint): Address {\n const toBeSigned = concatArrays(APP_ID_PREFIX, encodeUint64(appID))\n const hash = genericHash(toBeSigned)\n return new Address(Uint8Array.from(hash))\n}\n\n/**\n * decodeAddress takes an Algorand address in string form and decodes it into a Uint8Array.\n * @param address - an Algorand address with checksum.\n * @returns the decoded form of the address's public key and checksum\n */\nexport function decodeAddress(address: string): Address {\n return Address.fromString(address)\n}\n\n/**\n * encodeAddress takes an Algorand address as a Uint8Array and encodes it into a string with checksum.\n * @param address - a raw Algorand address\n * @returns the address and checksum encoded as a string.\n */\nexport function encodeAddress(address: Uint8Array): string {\n return new Address(address).toString()\n}\n"],"mappings":";;;;;;;;;AAKA,MAAa,+BAA+B;AAC5C,MAAa,gCAAgC;AAC7C,MAAa,0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,sBAAsB,OAAiC;CAErE,MAAM,OAAO,YADME,2BAAa,eAAe,aAAa,MAAM,CAAC,CAC/B;AACpC,QAAO,IAAI,QAAQ,WAAW,KAAK,KAAK,CAAC;;;;;;;AAQ3C,SAAgB,cAAc,SAA0B;AACtD,QAAO,QAAQ,WAAW,QAAQ;;;;;;;AAQpC,SAAgB,cAAc,SAA6B;AACzD,QAAO,IAAI,QAAQ,QAAQ,CAAC,UAAU"}
1
+ {"version":3,"file":"address.js","names":["sha512","HASH_BYTES_LENGTH","CHECKSUM_BYTE_LENGTH","arrayEqual","base32","concatArrays"],"sources":["../../../../packages/common/src/address.ts"],"sourcesContent":["import base32 from 'hi-base32'\nimport sha512 from 'js-sha512'\nimport { arrayEqual, concatArrays } from './array'\nimport { CHECKSUM_BYTE_LENGTH, HASH_BYTES_LENGTH } from './constants'\n\nexport const ALGORAND_ADDRESS_BYTE_LENGTH = 36\nexport const ALGORAND_CHECKSUM_BYTE_LENGTH = 4\nexport const ALGORAND_ADDRESS_LENGTH = 58\nexport const ALGORAND_ZERO_ADDRESS_STRING = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ'\n\nexport const MALFORMED_ADDRESS_ERROR_MSG = 'address seems to be malformed'\nexport const CHECKSUM_ADDRESS_ERROR_MSG = 'wrong checksum for address'\n\nexport function checksumFromPublicKey(publicKey: Uint8Array): Uint8Array {\n return Uint8Array.from(sha512.sha512_256.array(publicKey).slice(HASH_BYTES_LENGTH - CHECKSUM_BYTE_LENGTH, HASH_BYTES_LENGTH))\n}\n\nfunction genericHash(arr: sha512.Message) {\n return sha512.sha512_256.array(arr)\n}\n\nfunction bytesToHex(bytes: Uint8Array): string {\n return Buffer.from(bytes).toString('hex')\n}\n\nexport function encodeUint64(num: number | bigint) {\n const isInteger = typeof num === 'bigint' || Number.isInteger(num)\n\n if (!isInteger || num < 0 || num > BigInt('0xffffffffffffffff')) {\n throw new Error('Input is not a 64-bit unsigned integer')\n }\n\n const encoding = new Uint8Array(8)\n const view = new DataView(encoding.buffer)\n view.setBigUint64(0, BigInt(num))\n\n return encoding\n}\n\n/** Symbol used for instanceof checks across packages (CJS/ESM) */\nconst ADDR_SYMBOL = Symbol.for('algokit_common:Address')\n\n/**\n * Represents an Algorand address\n */\nexport class Address {\n /**\n * The binary form of the address. For standard accounts, this is the public key.\n */\n public readonly publicKey: Uint8Array;\n\n /** @internal */\n [ADDR_SYMBOL]: boolean\n\n /**\n * Create a new Address object from its binary form.\n * @param publicKey - The binary form of the address. Must be 32 bytes.\n */\n constructor(publicKey: Uint8Array) {\n this[ADDR_SYMBOL] = true\n if (publicKey.length !== ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: 0x${bytesToHex(publicKey)}, length ${publicKey.length}`)\n this.publicKey = publicKey\n }\n\n /**\n * Check if the address is equal to another address.\n */\n equals(other: Address): boolean {\n return other instanceof Address && arrayEqual(this.publicKey, other.publicKey)\n }\n\n /**\n * Compute the 4 byte checksum of the address.\n */\n checksum(): Uint8Array {\n return checksumFromPublicKey(this.publicKey)\n }\n\n /**\n * Encode the address into a string form.\n */\n toString(): string {\n const addr = base32.encode(concatArrays(this.publicKey, this.checksum()))\n return addr.slice(0, ALGORAND_ADDRESS_LENGTH) // removing the extra '===='\n }\n\n /**\n * Decode an address from a string.\n * @param address - The address to decode. Must be 58 characters long.\n * @returns An Address object corresponding to the input string.\n */\n static fromString(address: string): Address {\n if (typeof address !== 'string') throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected string, got ${typeof address}, ${address}`)\n if (address.length !== ALGORAND_ADDRESS_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected length ${ALGORAND_ADDRESS_LENGTH}, got ${address.length}: ${address}`)\n\n // try to decode\n const decoded = base32.decode.asBytes(address)\n // Sanity check\n if (decoded.length !== ALGORAND_ADDRESS_BYTE_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected byte length ${ALGORAND_ADDRESS_BYTE_LENGTH}, got ${decoded.length}`)\n\n // Find publickey and checksum\n const pk = new Uint8Array(decoded.slice(0, ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH))\n const cs = new Uint8Array(decoded.slice(ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH, ALGORAND_ADDRESS_BYTE_LENGTH))\n const checksum = checksumFromPublicKey(pk)\n // Check if the checksum and the address are equal\n if (!arrayEqual(checksum, cs)) throw new Error(`${CHECKSUM_ADDRESS_ERROR_MSG}: ${address} (${cs}, ${checksum})`)\n\n return new Address(pk)\n }\n\n /**\n * Get the zero address.\n */\n static zeroAddress(): Address {\n return new Address(new Uint8Array(ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH))\n }\n\n static [Symbol.hasInstance](obj: unknown) {\n return Boolean(obj && typeof obj === 'object' && ADDR_SYMBOL in obj && obj[ADDR_SYMBOL as keyof typeof obj])\n }\n}\n\nexport interface Addressable {\n addr: Readonly<Address>\n}\n\nexport type ReadableAddress = Addressable | Address | string\n\nexport function getAddress(addr: ReadableAddress): Address {\n if (typeof addr == 'string') {\n return Address.fromString(addr)\n } else if ('addr' in addr) {\n return addr.addr\n } else {\n return addr\n }\n}\n\nexport function getOptionalAddress(addr: ReadableAddress | undefined): Address | undefined {\n if (addr === undefined) {\n return undefined\n }\n return getAddress(addr)\n}\n\n/**\n * isValidAddress checks if a string is a valid Algorand address.\n * @param address - an Algorand address with checksum.\n * @returns true if valid, false otherwise\n */\nexport function isValidAddress(address: string): boolean {\n // Try to decode\n try {\n Address.fromString(address)\n } catch {\n return false\n }\n return true\n}\n\nconst APP_ID_PREFIX = new TextEncoder().encode('appID')\n\n/**\n * Get the escrow address of an application.\n * @param appID - The ID of the application.\n * @returns The address corresponding to that application's escrow account.\n */\nexport function getApplicationAddress(appID: number | bigint): Address {\n const toBeSigned = concatArrays(APP_ID_PREFIX, encodeUint64(appID))\n const hash = genericHash(toBeSigned)\n return new Address(Uint8Array.from(hash))\n}\n\n/**\n * decodeAddress takes an Algorand address in string form and decodes it into a Uint8Array.\n * @param address - an Algorand address with checksum.\n * @returns the decoded form of the address's public key and checksum\n */\nexport function decodeAddress(address: string): Address {\n return Address.fromString(address)\n}\n\n/**\n * encodeAddress takes an Algorand address as a Uint8Array and encodes it into a string with checksum.\n * @param address - a raw Algorand address\n * @returns the address and checksum encoded as a string.\n */\nexport function encodeAddress(address: Uint8Array): string {\n return new Address(address).toString()\n}\n"],"mappings":";;;;;;;;;AAKA,MAAa,+BAA+B;AAC5C,MAAa,gCAAgC;AAC7C,MAAa,0BAA0B;AACvC,MAAa,+BAA+B;AAE5C,MAAa,8BAA8B;AAC3C,MAAa,6BAA6B;AAE1C,SAAgB,sBAAsB,WAAmC;AACvE,QAAO,WAAW,KAAKA,kBAAO,WAAW,MAAM,UAAU,CAAC,MAAMC,sCAAoBC,wCAAsBD,oCAAkB,CAAC;;AAG/H,SAAS,YAAY,KAAqB;AACxC,QAAOD,kBAAO,WAAW,MAAM,IAAI;;AAGrC,SAAS,WAAW,OAA2B;AAC7C,QAAO,OAAO,KAAK,MAAM,CAAC,SAAS,MAAM;;AAG3C,SAAgB,aAAa,KAAsB;AAGjD,KAAI,EAFc,OAAO,QAAQ,YAAY,OAAO,UAAU,IAAI,KAEhD,MAAM,KAAK,MAAM,OAAO,qBAAqB,CAC7D,OAAM,IAAI,MAAM,yCAAyC;CAG3D,MAAM,WAAW,IAAI,WAAW,EAAE;AAElC,CADa,IAAI,SAAS,SAAS,OAAO,CACrC,aAAa,GAAG,OAAO,IAAI,CAAC;AAEjC,QAAO;;;AAIT,MAAM,cAAc,OAAO,IAAI,yBAAyB;;;;AAKxD,IAAa,UAAb,MAAa,QAAQ;;;;CAInB,AAAgB;;CAGhB,CAAC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+B,8BAA8B,CAAC;;CAGlG,QAAQ,OAAO,aAAa,KAAc;AACxC,SAAO,QAAQ,OAAO,OAAO,QAAQ,YAAY,eAAe,OAAO,IAAI,aAAiC;;;AAUhH,SAAgB,WAAW,MAAgC;AACzD,KAAI,OAAO,QAAQ,SACjB,QAAO,QAAQ,WAAW,KAAK;UACtB,UAAU,KACnB,QAAO,KAAK;KAEZ,QAAO;;AAIX,SAAgB,mBAAmB,MAAwD;AACzF,KAAI,SAAS,OACX;AAEF,QAAO,WAAW,KAAK;;AAkBzB,MAAM,gBAAgB,IAAI,aAAa,CAAC,OAAO,QAAQ;;;;;;AAOvD,SAAgB,sBAAsB,OAAiC;CAErE,MAAM,OAAO,YADME,2BAAa,eAAe,aAAa,MAAM,CAAC,CAC/B;AACpC,QAAO,IAAI,QAAQ,WAAW,KAAK,KAAK,CAAC;;;;;;;AAQ3C,SAAgB,cAAc,SAA0B;AACtD,QAAO,QAAQ,WAAW,QAAQ;;;;;;;AAQpC,SAAgB,cAAc,SAA6B;AACzD,QAAO,IAAI,QAAQ,QAAQ,CAAC,UAAU"}
@@ -99,19 +99,6 @@ function getOptionalAddress(addr) {
99
99
  if (addr === void 0) return;
100
100
  return getAddress(addr);
101
101
  }
102
- /**
103
- * isValidAddress checks if a string is a valid Algorand address.
104
- * @param address - an Algorand address with checksum.
105
- * @returns true if valid, false otherwise
106
- */
107
- function isValidAddress(address) {
108
- try {
109
- Address.fromString(address);
110
- } catch {
111
- return false;
112
- }
113
- return true;
114
- }
115
102
  const APP_ID_PREFIX = new TextEncoder().encode("appID");
116
103
  /**
117
104
  * Get the escrow address of an application.
@@ -140,5 +127,5 @@ function encodeAddress(address) {
140
127
  }
141
128
 
142
129
  //#endregion
143
- export { ALGORAND_ADDRESS_BYTE_LENGTH, ALGORAND_CHECKSUM_BYTE_LENGTH, ALGORAND_ZERO_ADDRESS_STRING, Address, decodeAddress, encodeAddress, getAddress, getApplicationAddress, getOptionalAddress, isValidAddress };
130
+ export { ALGORAND_ADDRESS_BYTE_LENGTH, ALGORAND_CHECKSUM_BYTE_LENGTH, ALGORAND_ZERO_ADDRESS_STRING, Address, decodeAddress, encodeAddress, getAddress, getApplicationAddress, getOptionalAddress };
144
131
  //# sourceMappingURL=address.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"address.mjs","names":[],"sources":["../../../../packages/common/src/address.ts"],"sourcesContent":["import base32 from 'hi-base32'\nimport sha512 from 'js-sha512'\nimport { arrayEqual, concatArrays } from './array'\nimport { CHECKSUM_BYTE_LENGTH, HASH_BYTES_LENGTH } from './constants'\n\nexport const ALGORAND_ADDRESS_BYTE_LENGTH = 36\nexport const ALGORAND_CHECKSUM_BYTE_LENGTH = 4\nexport const ALGORAND_ADDRESS_LENGTH = 58\nexport const ALGORAND_ZERO_ADDRESS_STRING = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ'\n\nexport const MALFORMED_ADDRESS_ERROR_MSG = 'address seems to be malformed'\nexport const CHECKSUM_ADDRESS_ERROR_MSG = 'wrong checksum for address'\n\nexport function checksumFromPublicKey(publicKey: Uint8Array): Uint8Array {\n return Uint8Array.from(sha512.sha512_256.array(publicKey).slice(HASH_BYTES_LENGTH - CHECKSUM_BYTE_LENGTH, HASH_BYTES_LENGTH))\n}\n\nfunction genericHash(arr: sha512.Message) {\n return sha512.sha512_256.array(arr)\n}\n\nfunction bytesToHex(bytes: Uint8Array): string {\n return Buffer.from(bytes).toString('hex')\n}\n\nexport function encodeUint64(num: number | bigint) {\n const isInteger = typeof num === 'bigint' || Number.isInteger(num)\n\n if (!isInteger || num < 0 || num > BigInt('0xffffffffffffffff')) {\n throw new Error('Input is not a 64-bit unsigned integer')\n }\n\n const encoding = new Uint8Array(8)\n const view = new DataView(encoding.buffer)\n view.setBigUint64(0, BigInt(num))\n\n return encoding\n}\n\n/** Symbol used for instanceof checks across packages (CJS/ESM) */\nconst ADDR_SYMBOL = Symbol.for('algokit_common:Address')\n\n/**\n * Represents an Algorand address\n */\nexport class Address {\n /**\n * The binary form of the address. For standard accounts, this is the public key.\n */\n public readonly publicKey: Uint8Array;\n\n /** @internal */\n [ADDR_SYMBOL]: boolean\n\n /**\n * Create a new Address object from its binary form.\n * @param publicKey - The binary form of the address. Must be 32 bytes.\n */\n constructor(publicKey: Uint8Array) {\n this[ADDR_SYMBOL] = true\n if (publicKey.length !== ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: 0x${bytesToHex(publicKey)}, length ${publicKey.length}`)\n this.publicKey = publicKey\n }\n\n /**\n * Check if the address is equal to another address.\n */\n equals(other: Address): boolean {\n return other instanceof Address && arrayEqual(this.publicKey, other.publicKey)\n }\n\n /**\n * Compute the 4 byte checksum of the address.\n */\n checksum(): Uint8Array {\n return checksumFromPublicKey(this.publicKey)\n }\n\n /**\n * Encode the address into a string form.\n */\n toString(): string {\n const addr = base32.encode(concatArrays(this.publicKey, this.checksum()))\n return addr.slice(0, ALGORAND_ADDRESS_LENGTH) // removing the extra '===='\n }\n\n /**\n * Decode an address from a string.\n * @param address - The address to decode. Must be 58 characters long.\n * @returns An Address object corresponding to the input string.\n */\n static fromString(address: string): Address {\n if (typeof address !== 'string') throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected string, got ${typeof address}, ${address}`)\n if (address.length !== ALGORAND_ADDRESS_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected length ${ALGORAND_ADDRESS_LENGTH}, got ${address.length}: ${address}`)\n\n // try to decode\n const decoded = base32.decode.asBytes(address)\n // Sanity check\n if (decoded.length !== ALGORAND_ADDRESS_BYTE_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected byte length ${ALGORAND_ADDRESS_BYTE_LENGTH}, got ${decoded.length}`)\n\n // Find publickey and checksum\n const pk = new Uint8Array(decoded.slice(0, ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH))\n const cs = new Uint8Array(decoded.slice(ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH, ALGORAND_ADDRESS_BYTE_LENGTH))\n const checksum = checksumFromPublicKey(pk)\n // Check if the checksum and the address are equal\n if (!arrayEqual(checksum, cs)) throw new Error(`${CHECKSUM_ADDRESS_ERROR_MSG}: ${address} (${cs}, ${checksum})`)\n\n return new Address(pk)\n }\n\n /**\n * Get the zero address.\n */\n static zeroAddress(): Address {\n return new Address(new Uint8Array(ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH))\n }\n\n static [Symbol.hasInstance](obj: unknown) {\n return Boolean(obj && typeof obj === 'object' && ADDR_SYMBOL in obj && obj[ADDR_SYMBOL as keyof typeof obj])\n }\n}\n\nexport interface Addressable {\n addr: Readonly<Address>\n}\n\nexport type ReadableAddress = Addressable | Address | string\n\nexport function getAddress(addr: ReadableAddress): Address {\n if (typeof addr == 'string') {\n return Address.fromString(addr)\n } else if ('addr' in addr) {\n return addr.addr\n } else {\n return addr\n }\n}\n\nexport function getOptionalAddress(addr: ReadableAddress | undefined): Address | undefined {\n if (addr === undefined) {\n return undefined\n }\n return getAddress(addr)\n}\n\n/**\n * isValidAddress checks if a string is a valid Algorand address.\n * @param address - an Algorand address with checksum.\n * @returns true if valid, false otherwise\n */\nexport function isValidAddress(address: string): boolean {\n // Try to decode\n try {\n Address.fromString(address)\n } catch {\n return false\n }\n return true\n}\n\nconst APP_ID_PREFIX = new TextEncoder().encode('appID')\n\n/**\n * Get the escrow address of an application.\n * @param appID - The ID of the application.\n * @returns The address corresponding to that application's escrow account.\n */\nexport function getApplicationAddress(appID: number | bigint): Address {\n const toBeSigned = concatArrays(APP_ID_PREFIX, encodeUint64(appID))\n const hash = genericHash(toBeSigned)\n return new Address(Uint8Array.from(hash))\n}\n\n/**\n * decodeAddress takes an Algorand address in string form and decodes it into a Uint8Array.\n * @param address - an Algorand address with checksum.\n * @returns the decoded form of the address's public key and checksum\n */\nexport function decodeAddress(address: string): Address {\n return Address.fromString(address)\n}\n\n/**\n * encodeAddress takes an Algorand address as a Uint8Array and encodes it into a string with checksum.\n * @param address - a raw Algorand address\n * @returns the address and checksum encoded as a string.\n */\nexport function encodeAddress(address: Uint8Array): string {\n return new Address(address).toString()\n}\n"],"mappings":";;;;;;AAKA,MAAa,+BAA+B;AAC5C,MAAa,gCAAgC;AAC7C,MAAa,0BAA0B;AACvC,MAAa,+BAA+B;AAE5C,MAAa,8BAA8B;AAC3C,MAAa,6BAA6B;AAE1C,SAAgB,sBAAsB,WAAmC;AACvE,QAAO,WAAW,KAAK,OAAO,WAAW,MAAM,UAAU,CAAC,MAAM,oBAAoB,sBAAsB,kBAAkB,CAAC;;AAG/H,SAAS,YAAY,KAAqB;AACxC,QAAO,OAAO,WAAW,MAAM,IAAI;;AAGrC,SAAS,WAAW,OAA2B;AAC7C,QAAO,OAAO,KAAK,MAAM,CAAC,SAAS,MAAM;;AAG3C,SAAgB,aAAa,KAAsB;AAGjD,KAAI,EAFc,OAAO,QAAQ,YAAY,OAAO,UAAU,IAAI,KAEhD,MAAM,KAAK,MAAM,OAAO,qBAAqB,CAC7D,OAAM,IAAI,MAAM,yCAAyC;CAG3D,MAAM,WAAW,IAAI,WAAW,EAAE;AAElC,CADa,IAAI,SAAS,SAAS,OAAO,CACrC,aAAa,GAAG,OAAO,IAAI,CAAC;AAEjC,QAAO;;;AAIT,MAAM,cAAc,OAAO,IAAI,yBAAyB;;;;AAKxD,IAAa,UAAb,MAAa,QAAQ;;;;CAInB,AAAgB;;CAGhB,CAAC;;;;;CAMD,YAAY,WAAuB;AACjC,OAAK,eAAe;AACpB,MAAI,UAAU,WAAW,+BAA+B,8BACtD,OAAM,IAAI,MAAM,GAAG,4BAA4B,MAAM,WAAW,UAAU,CAAC,WAAW,UAAU,SAAS;AAC3G,OAAK,YAAY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O,QAAQ,WAAW,KAAK;UACtB,UAAU,KACnB,QAAO,KAAK;KAEZ,QAAO;;AAIX,SAAgB,mBAAmB,MAAwD;AACzF,KAAI,SAAS,OACX;AAEF,QAAO,WAAW,KAAK;;;;;;;AAQzB,SAAgB,eAAe,SAA0B;AAEvD,KAAI;AACF,UAAQ,WAAW,QAAQ;SACrB;AACN,SAAO;;AAET,QAAO;;AAGT,MAAM,gBAAgB,IAAI,aAAa,CAAC,OAAO,QAAQ;;;;;;AAOvD,SAAgB,sBAAsB,OAAiC;CAErE,MAAM,OAAO,YADM,aAAa,eAAe,aAAa,MAAM,CAAC,CAC/B;AACpC,QAAO,IAAI,QAAQ,WAAW,KAAK,KAAK,CAAC;;;;;;;AAQ3C,SAAgB,cAAc,SAA0B;AACtD,QAAO,QAAQ,WAAW,QAAQ;;;;;;;AAQpC,SAAgB,cAAc,SAA6B;AACzD,QAAO,IAAI,QAAQ,QAAQ,CAAC,UAAU"}
1
+ {"version":3,"file":"address.mjs","names":[],"sources":["../../../../packages/common/src/address.ts"],"sourcesContent":["import base32 from 'hi-base32'\nimport sha512 from 'js-sha512'\nimport { arrayEqual, concatArrays } from './array'\nimport { CHECKSUM_BYTE_LENGTH, HASH_BYTES_LENGTH } from './constants'\n\nexport const ALGORAND_ADDRESS_BYTE_LENGTH = 36\nexport const ALGORAND_CHECKSUM_BYTE_LENGTH = 4\nexport const ALGORAND_ADDRESS_LENGTH = 58\nexport const ALGORAND_ZERO_ADDRESS_STRING = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ'\n\nexport const MALFORMED_ADDRESS_ERROR_MSG = 'address seems to be malformed'\nexport const CHECKSUM_ADDRESS_ERROR_MSG = 'wrong checksum for address'\n\nexport function checksumFromPublicKey(publicKey: Uint8Array): Uint8Array {\n return Uint8Array.from(sha512.sha512_256.array(publicKey).slice(HASH_BYTES_LENGTH - CHECKSUM_BYTE_LENGTH, HASH_BYTES_LENGTH))\n}\n\nfunction genericHash(arr: sha512.Message) {\n return sha512.sha512_256.array(arr)\n}\n\nfunction bytesToHex(bytes: Uint8Array): string {\n return Buffer.from(bytes).toString('hex')\n}\n\nexport function encodeUint64(num: number | bigint) {\n const isInteger = typeof num === 'bigint' || Number.isInteger(num)\n\n if (!isInteger || num < 0 || num > BigInt('0xffffffffffffffff')) {\n throw new Error('Input is not a 64-bit unsigned integer')\n }\n\n const encoding = new Uint8Array(8)\n const view = new DataView(encoding.buffer)\n view.setBigUint64(0, BigInt(num))\n\n return encoding\n}\n\n/** Symbol used for instanceof checks across packages (CJS/ESM) */\nconst ADDR_SYMBOL = Symbol.for('algokit_common:Address')\n\n/**\n * Represents an Algorand address\n */\nexport class Address {\n /**\n * The binary form of the address. For standard accounts, this is the public key.\n */\n public readonly publicKey: Uint8Array;\n\n /** @internal */\n [ADDR_SYMBOL]: boolean\n\n /**\n * Create a new Address object from its binary form.\n * @param publicKey - The binary form of the address. Must be 32 bytes.\n */\n constructor(publicKey: Uint8Array) {\n this[ADDR_SYMBOL] = true\n if (publicKey.length !== ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: 0x${bytesToHex(publicKey)}, length ${publicKey.length}`)\n this.publicKey = publicKey\n }\n\n /**\n * Check if the address is equal to another address.\n */\n equals(other: Address): boolean {\n return other instanceof Address && arrayEqual(this.publicKey, other.publicKey)\n }\n\n /**\n * Compute the 4 byte checksum of the address.\n */\n checksum(): Uint8Array {\n return checksumFromPublicKey(this.publicKey)\n }\n\n /**\n * Encode the address into a string form.\n */\n toString(): string {\n const addr = base32.encode(concatArrays(this.publicKey, this.checksum()))\n return addr.slice(0, ALGORAND_ADDRESS_LENGTH) // removing the extra '===='\n }\n\n /**\n * Decode an address from a string.\n * @param address - The address to decode. Must be 58 characters long.\n * @returns An Address object corresponding to the input string.\n */\n static fromString(address: string): Address {\n if (typeof address !== 'string') throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected string, got ${typeof address}, ${address}`)\n if (address.length !== ALGORAND_ADDRESS_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected length ${ALGORAND_ADDRESS_LENGTH}, got ${address.length}: ${address}`)\n\n // try to decode\n const decoded = base32.decode.asBytes(address)\n // Sanity check\n if (decoded.length !== ALGORAND_ADDRESS_BYTE_LENGTH)\n throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected byte length ${ALGORAND_ADDRESS_BYTE_LENGTH}, got ${decoded.length}`)\n\n // Find publickey and checksum\n const pk = new Uint8Array(decoded.slice(0, ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH))\n const cs = new Uint8Array(decoded.slice(ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH, ALGORAND_ADDRESS_BYTE_LENGTH))\n const checksum = checksumFromPublicKey(pk)\n // Check if the checksum and the address are equal\n if (!arrayEqual(checksum, cs)) throw new Error(`${CHECKSUM_ADDRESS_ERROR_MSG}: ${address} (${cs}, ${checksum})`)\n\n return new Address(pk)\n }\n\n /**\n * Get the zero address.\n */\n static zeroAddress(): Address {\n return new Address(new Uint8Array(ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH))\n }\n\n static [Symbol.hasInstance](obj: unknown) {\n return Boolean(obj && typeof obj === 'object' && ADDR_SYMBOL in obj && obj[ADDR_SYMBOL as keyof typeof obj])\n }\n}\n\nexport interface Addressable {\n addr: Readonly<Address>\n}\n\nexport type ReadableAddress = Addressable | Address | string\n\nexport function getAddress(addr: ReadableAddress): Address {\n if (typeof addr == 'string') {\n return Address.fromString(addr)\n } else if ('addr' in addr) {\n return addr.addr\n } else {\n return addr\n }\n}\n\nexport function getOptionalAddress(addr: ReadableAddress | undefined): Address | undefined {\n if (addr === undefined) {\n return undefined\n }\n return getAddress(addr)\n}\n\n/**\n * isValidAddress checks if a string is a valid Algorand address.\n * @param address - an Algorand address with checksum.\n * @returns true if valid, false otherwise\n */\nexport function isValidAddress(address: string): boolean {\n // Try to decode\n try {\n Address.fromString(address)\n } catch {\n return false\n }\n return true\n}\n\nconst APP_ID_PREFIX = new TextEncoder().encode('appID')\n\n/**\n * Get the escrow address of an application.\n * @param appID - The ID of the application.\n * @returns The address corresponding to that application's escrow account.\n */\nexport function getApplicationAddress(appID: number | bigint): Address {\n const toBeSigned = concatArrays(APP_ID_PREFIX, encodeUint64(appID))\n const hash = genericHash(toBeSigned)\n return new Address(Uint8Array.from(hash))\n}\n\n/**\n * decodeAddress takes an Algorand address in string form and decodes it into a Uint8Array.\n * @param address - an Algorand address with checksum.\n * @returns the decoded form of the address's public key and checksum\n */\nexport function decodeAddress(address: string): Address {\n return Address.fromString(address)\n}\n\n/**\n * encodeAddress takes an Algorand address as a Uint8Array and encodes it into a string with checksum.\n * @param address - a raw Algorand address\n * @returns the address and checksum encoded as a string.\n */\nexport function encodeAddress(address: Uint8Array): string {\n return new Address(address).toString()\n}\n"],"mappings":";;;;;;AAKA,MAAa,+BAA+B;AAC5C,MAAa,gCAAgC;AAC7C,MAAa,0BAA0B;AACvC,MAAa,+BAA+B;AAE5C,MAAa,8BAA8B;AAC3C,MAAa,6BAA6B;AAE1C,SAAgB,sBAAsB,WAAmC;AACvE,QAAO,WAAW,KAAK,OAAO,WAAW,MAAM,UAAU,CAAC,MAAM,oBAAoB,sBAAsB,kBAAkB,CAAC;;AAG/H,SAAS,YAAY,KAAqB;AACxC,QAAO,OAAO,WAAW,MAAM,IAAI;;AAGrC,SAAS,WAAW,OAA2B;AAC7C,QAAO,OAAO,KAAK,MAAM,CAAC,SAAS,MAAM;;AAG3C,SAAgB,aAAa,KAAsB;AAGjD,KAAI,EAFc,OAAO,QAAQ,YAAY,OAAO,UAAU,IAAI,KAEhD,MAAM,KAAK,MAAM,OAAO,qBAAqB,CAC7D,OAAM,IAAI,MA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sB,GAAG;AAE1C,MAAI,CAAC,WAAW,UAAU,GAAG,CAAE,OAAM,IAAI,MAAM,GAAG,2BAA2B,IAAI,QAAQ,IAAI,GAAG,IAAI,SAAS,GAAG;AAEhH,SAAO,IAAI,QAAQ,GAAG;;;;;CAMxB,OAAO,cAAuB;AAC5B,SAAO,IAAI,QAAQ,IAAI,WAAW,+BAA+B,8BAA8B,CAAC;;CAGlG,QAAQ,OAAO,aAAa,KAAc;AACxC,SAAO,QAAQ,OAAO,OAAO,QAAQ,YAAY,eAAe,OAAO,IAAI,aAAiC;;;AAUhH,SAAgB,WAAW,MAAgC;AACzD,KAAI,OAAO,QAAQ,SACjB,QAAO,QAAQ,WAAW,KAAK;UACtB,UAAU,KACnB,QAAO,KAAK;KAEZ,QAAO;;AAIX,SAAgB,mBAAmB,MAAwD;AACzF,KAAI,SAAS,OACX;AAEF,QAAO,WAAW,KAAK;;AAkBzB,MAAM,gBAAgB,IAAI,aAAa,CAAC,OAAO,QAAQ;;;;;;AAOvD,SAAgB,sBAAsB,OAAiC;CAErE,MAAM,OAAO,YADM,aAAa,eAAe,aAAa,MAAM,CAAC,CAC/B;AACpC,QAAO,IAAI,QAAQ,WAAW,KAAK,KAAK,CAAC;;;;;;;AAQ3C,SAAgB,cAAc,SAA0B;AACtD,QAAO,QAAQ,WAAW,QAAQ;;;;;;;AAQpC,SAAgB,cAAc,SAA6B;AACzD,QAAO,IAAI,QAAQ,QAAQ,CAAC,UAAU"}
@@ -4,8 +4,9 @@ const require_codec = require('../codec.js');
4
4
  /**
5
5
  * Map codec - handles Maps with any key type (including Uint8Array, bigint, number)
6
6
  * Depending on the encoding format, the map is encoded differently:
7
- * - json: Only supports string keys and is represented as an object when encoding.
8
- * An exception is thrown upon encountering a non-string key.
7
+ * - json: Supports string and bigint keys. The map is represented as an object when encoding.
8
+ * Bigint keys are converted to/from strings (e.g., 1n becomes "1").
9
+ * An exception is thrown upon encountering an unsupported key type.
9
10
  * - msgpack: Preserves key types and is represented as a Map when encoding.
10
11
  */
11
12
  var MapCodec = class extends require_codec.Codec {
@@ -22,7 +23,7 @@ var MapCodec = class extends require_codec.Codec {
22
23
  }
23
24
  ensureKeyIsSupported(format) {
24
25
  if (format === "msgpack") return true;
25
- if (this.keyType !== "string") throw new Error(`Map key of type '${this.keyType}' is not supported in ${format} format`);
26
+ if (this.keyType !== "string" && this.keyType !== "bigint") throw new Error(`Map key of type '${this.keyType}' is not supported in ${format} format`);
26
27
  }
27
28
  toEncoded(value, format) {
28
29
  this.ensureKeyIsSupported(format);
@@ -49,7 +50,9 @@ var MapCodec = class extends require_codec.Codec {
49
50
  if (value instanceof Map) entries = Array.from(value.entries());
50
51
  else entries = Object.entries(value);
51
52
  for (const [encodedKey, encodedValue] of entries) {
52
- const key = this.keyCodec.decode(encodedKey, format);
53
+ let keyToDecode = encodedKey;
54
+ if (format === "json" && this.keyType === "bigint" && typeof encodedKey === "string") keyToDecode = BigInt(encodedKey);
55
+ const key = this.keyCodec.decode(keyToDecode, format);
53
56
  const val = this.valueCodec.decode(encodedValue, format);
54
57
  result.set(key, val);
55
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"map.js","names":["Codec","keyCodec: Codec<K, KEncoded>","valueCodec: Codec<V, VEncoded>","entries: Array<[KEncoded, VEncoded]>","obj: Record<string, VEncoded>"],"sources":["../../../../../../packages/common/src/codecs/composite/map.ts"],"sourcesContent":["import { Codec } from '../codec'\nimport type { EncodingFormat } from '../types'\n\n/**\n * Map codec - handles Maps with any key type (including Uint8Array, bigint, number)\n * Depending on the encoding format, the map is encoded differently:\n * - json: Only supports string keys and is represented as an object when encoding.\n * An exception is thrown upon encountering a non-string key.\n * - msgpack: Preserves key types and is represented as a Map when encoding.\n */\nexport class MapCodec<K, V, KEncoded = K, VEncoded = V> extends Codec<Map<K, V>, Map<KEncoded, VEncoded> | Record<string, VEncoded>> {\n private keyType: string\n\n constructor(\n private readonly keyCodec: Codec<K, KEncoded>,\n private readonly valueCodec: Codec<V, VEncoded>,\n ) {\n super()\n const defaultKeyValue = this.keyCodec.defaultValue()\n this.keyType = defaultKeyValue instanceof Uint8Array ? 'Uint8Array' : typeof defaultKeyValue\n }\n\n public defaultValue(): Map<K, V> {\n return new Map()\n }\n\n private ensureKeyIsSupported(format: EncodingFormat) {\n if (format === 'msgpack') {\n return true\n }\n if (this.keyType !== 'string') {\n throw new Error(`Map key of type '${this.keyType}' is not supported in ${format} format`)\n }\n }\n\n protected toEncoded(value: Map<K, V>, format: EncodingFormat): Map<KEncoded, VEncoded> | Record<string, VEncoded> {\n this.ensureKeyIsSupported(format)\n\n const entries: Array<[KEncoded, VEncoded]> = []\n\n for (const [k, v] of value.entries()) {\n const encodedKey = this.keyCodec.encode(k, format)\n const encodedValue = this.valueCodec.encode(v, format)\n entries.push([encodedKey, encodedValue])\n }\n if (format === 'json') {\n const obj: Record<string, VEncoded> = {}\n for (const [k, v] of entries) {\n const keyStr = typeof k === 'string' ? k : String(k)\n obj[keyStr] = v\n }\n return obj\n }\n\n return new Map(entries)\n }\n\n protected fromEncoded(value: Map<KEncoded, VEncoded> | Record<string, VEncoded>, format: EncodingFormat): Map<K, V> {\n this.ensureKeyIsSupported(format)\n\n const result = new Map<K, V>()\n\n let entries: Array<[KEncoded, VEncoded]>\n if (value instanceof Map) {\n entries = Array.from(value.entries())\n } else {\n entries = Object.entries(value) as Array<[KEncoded, VEncoded]>\n }\n\n for (const [encodedKey, encodedValue] of entries) {\n const key = this.keyCodec.decode(encodedKey as KEncoded, format)\n const val = this.valueCodec.decode(encodedValue, format)\n result.set(key, val)\n }\n\n return result\n }\n\n public isDefaultValue(value: Map<K, V>): boolean {\n return value.size === 0\n }\n}\n"],"mappings":";;;;;;;;;;AAUA,IAAa,WAAb,cAAgEA,oBAAqE;CACnI,AAAQ;CAER,YACE,AAAiBC,UACjB,AAAiBC,YACjB;AACA,SAAO;EAHU;EACA;EAGjB,MAAM,kBAAkB,KAAK,SAAS,cAAc;AACpD,OAAK,UAAU,2BAA2B,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>","entries: Array<[KEncoded, VEncoded]>","obj: Record<string, VEncoded>"],"sources":["../../../../../../packages/common/src/codecs/composite/map.ts"],"sourcesContent":["import { Codec } from '../codec'\nimport type { EncodingFormat } from '../types'\n\n/**\n * Map codec - handles Maps with any key type (including Uint8Array, bigint, number)\n * Depending on the encoding format, the map is encoded differently:\n * - json: Supports string and bigint keys. The map is represented as an object when encoding.\n * Bigint keys are converted to/from strings (e.g., 1n becomes \"1\").\n * An exception is thrown upon encountering an unsupported key type.\n * - msgpack: Preserves key types and is represented as a Map when encoding.\n */\nexport class MapCodec<K, V, KEncoded = K, VEncoded = V> extends Codec<Map<K, V>, Map<KEncoded, VEncoded> | Record<string, VEncoded>> {\n private keyType: string\n\n constructor(\n private readonly keyCodec: Codec<K, KEncoded>,\n private readonly valueCodec: Codec<V, VEncoded>,\n ) {\n super()\n const defaultKeyValue = this.keyCodec.defaultValue()\n this.keyType = defaultKeyValue instanceof Uint8Array ? 'Uint8Array' : typeof defaultKeyValue\n }\n\n public defaultValue(): Map<K, V> {\n return new Map()\n }\n\n private ensureKeyIsSupported(format: EncodingFormat) {\n if (format === 'msgpack') {\n return true\n }\n if (this.keyType !== 'string' && this.keyType !== 'bigint') {\n throw new Error(`Map key of type '${this.keyType}' is not supported in ${format} format`)\n }\n }\n\n protected toEncoded(value: Map<K, V>, format: EncodingFormat): Map<KEncoded, VEncoded> | Record<string, VEncoded> {\n this.ensureKeyIsSupported(format)\n\n const entries: Array<[KEncoded, VEncoded]> = []\n\n for (const [k, v] of value.entries()) {\n const encodedKey = this.keyCodec.encode(k, format)\n const encodedValue = this.valueCodec.encode(v, format)\n entries.push([encodedKey, encodedValue])\n }\n if (format === 'json') {\n const obj: Record<string, VEncoded> = {}\n for (const [k, v] of entries) {\n const keyStr = typeof k === 'string' ? k : String(k)\n obj[keyStr] = v\n }\n return obj\n }\n\n return new Map(entries)\n }\n\n protected fromEncoded(value: Map<KEncoded, VEncoded> | Record<string, VEncoded>, format: EncodingFormat): Map<K, V> {\n this.ensureKeyIsSupported(format)\n\n const result = new Map<K, V>()\n\n let entries: Array<[KEncoded, VEncoded]>\n if (value instanceof Map) {\n entries = Array.from(value.entries())\n } else {\n entries = Object.entries(value) as Array<[KEncoded, VEncoded]>\n }\n\n for (const [encodedKey, encodedValue] of entries) {\n let keyToDecode = encodedKey as KEncoded\n if (format === 'json' && this.keyType === 'bigint' && typeof encodedKey === 'string') {\n keyToDecode = BigInt(encodedKey) as KEncoded\n }\n const key = this.keyCodec.decode(keyToDecode, format)\n const val = this.valueCodec.decode(encodedValue, format)\n result.set(key, val)\n }\n\n return result\n }\n\n public isDefaultValue(value: Map<K, V>): boolean {\n return value.size === 0\n }\n}\n"],"mappings":";;;;;;;;;;;AAWA,IAAa,WAAb,cAAgEA,oBAAqE;CACnI,AAAQ;CAER,YACE,AAAiBC,UACjB,AAAiBC,YACjB;AACA,SAAO;EAHU;EACA;EAGjB,MAAM,kBAAkB,KAAK,SAAS,cAAc;AACpD,OAAK,UAAU,2BAA2B,aAAa,eAAe,OAAO;;CAG/E,AAAO,eAA0B;AAC/B,yBAAO,IAAI,KAAK;;CAGlB,AAAQ,qBAAqB,QAAwB;AACnD,MAAI,WAAW,UACb,QAAO;AAET,MAAI,KAAK,YAAY,YAAY,KAAK,YAAY,SAChD,OAAM,IAAI,MAAM,oBAAoB,KAAK,QAAQ,wBAAwB,OAAO,SAAS;;CAI7F,AAAU,UAAU,OAAkB,QAA4E;AAChH,OAAK,qBAAqB,OAAO;EAEjC,MAAMC,UAAuC,EAAE;AAE/C,OAAK,MAAM,CAAC,GAAG,MAAM,MAAM,SAAS,EAAE;GACpC,MAAM,aAAa,KAAK,SAAS,OAAO,GAAG,OAAO;GAClD,MAAM,eAAe,KAAK,WAAW,OAAO,GAAG,OAAO;AACtD,WAAQ,KAAK,CAAC,YAAY,aAAa,CAAC;;AAE1C,MAAI,WAAW,QAAQ;GACrB,MAAMC,MAAgC,EAAE;AACxC,QAAK,MAAM,CAAC,GAAG,MA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