@algorandfoundation/algokit-utils 10.0.0-alpha.7 → 10.0.0-alpha.9

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 (233) hide show
  1. package/_virtual/rolldown_runtime.js +20 -11
  2. package/_virtual/rolldown_runtime.mjs +10 -5
  3. package/algod-client/index.d.ts +2 -2
  4. package/package.json +1 -1
  5. package/packages/abi/src/abi-type.d.ts +1 -1
  6. package/packages/abi/src/abi-type.js +2 -1
  7. package/packages/abi/src/abi-type.js.map +1 -1
  8. package/packages/abi/src/abi-type.mjs +2 -1
  9. package/packages/abi/src/abi-type.mjs.map +1 -1
  10. package/packages/abi/src/arc56-contract.js +1 -0
  11. package/packages/abi/src/arc56-contract.js.map +1 -1
  12. package/packages/abi/src/arc56-contract.mjs +1 -0
  13. package/packages/abi/src/arc56-contract.mjs.map +1 -1
  14. package/packages/algod_client/src/apis/api-service.d.ts +44 -44
  15. package/packages/algod_client/src/apis/api-service.js +153 -153
  16. package/packages/algod_client/src/apis/api-service.js.map +1 -1
  17. package/packages/algod_client/src/apis/api-service.mjs +153 -153
  18. package/packages/algod_client/src/apis/api-service.mjs.map +1 -1
  19. package/packages/algod_client/src/core/api-error.js +3 -1
  20. package/packages/algod_client/src/core/api-error.js.map +1 -1
  21. package/packages/algod_client/src/core/api-error.mjs +3 -1
  22. package/packages/algod_client/src/core/api-error.mjs.map +1 -1
  23. package/packages/algod_client/src/core/model-runtime.js +4 -4
  24. package/packages/algod_client/src/core/model-runtime.js.map +1 -1
  25. package/packages/algod_client/src/core/model-runtime.mjs +6 -6
  26. package/packages/algod_client/src/core/model-runtime.mjs.map +1 -1
  27. package/packages/algod_client/src/models/account-participation.js +4 -4
  28. package/packages/algod_client/src/models/account-participation.js.map +1 -1
  29. package/packages/algod_client/src/models/account-participation.mjs +4 -4
  30. package/packages/algod_client/src/models/account-participation.mjs.map +1 -1
  31. package/packages/algod_client/src/models/asset-params.js +2 -1
  32. package/packages/algod_client/src/models/asset-params.js.map +1 -1
  33. package/packages/algod_client/src/models/asset-params.mjs +2 -1
  34. package/packages/algod_client/src/models/asset-params.mjs.map +1 -1
  35. package/packages/algod_client/src/models/block-response.js +1 -2
  36. package/packages/algod_client/src/models/block-response.js.map +1 -1
  37. package/packages/algod_client/src/models/block-response.mjs +2 -3
  38. package/packages/algod_client/src/models/block-response.mjs.map +1 -1
  39. package/packages/algod_client/src/models/block.d.ts +47 -27
  40. package/packages/algod_client/src/models/block.js +173 -97
  41. package/packages/algod_client/src/models/block.js.map +1 -1
  42. package/packages/algod_client/src/models/block.mjs +173 -97
  43. package/packages/algod_client/src/models/block.mjs.map +1 -1
  44. package/packages/algod_client/src/models/ledger-state-delta.js +1 -1
  45. package/packages/algod_client/src/models/ledger-state-delta.js.map +1 -1
  46. package/packages/algod_client/src/models/ledger-state-delta.mjs +2 -2
  47. package/packages/algod_client/src/models/ledger-state-delta.mjs.map +1 -1
  48. package/packages/algod_client/src/models/transaction-parameters-response.js +2 -2
  49. package/packages/algod_client/src/models/transaction-parameters-response.js.map +1 -1
  50. package/packages/algod_client/src/models/transaction-parameters-response.mjs +2 -2
  51. package/packages/algod_client/src/models/transaction-parameters-response.mjs.map +1 -1
  52. package/packages/common/src/codecs/composite/map.js +7 -4
  53. package/packages/common/src/codecs/composite/map.js.map +1 -1
  54. package/packages/common/src/codecs/composite/map.mjs +7 -4
  55. package/packages/common/src/codecs/composite/map.mjs.map +1 -1
  56. package/packages/common/src/codecs/composite/record.js +0 -1
  57. package/packages/common/src/codecs/composite/record.js.map +1 -1
  58. package/packages/common/src/codecs/primitives/address.js +0 -1
  59. package/packages/common/src/codecs/primitives/address.js.map +1 -1
  60. package/packages/common/src/codecs/primitives/bytes.js +0 -1
  61. package/packages/common/src/codecs/primitives/bytes.js.map +1 -1
  62. package/packages/common/src/codecs/primitives/fixed-bytes.js +0 -1
  63. package/packages/common/src/codecs/primitives/fixed-bytes.js.map +1 -1
  64. package/packages/common/src/codecs/wire.js +0 -1
  65. package/packages/common/src/codecs/wire.js.map +1 -1
  66. package/packages/common/src/msgpack.js +0 -1
  67. package/packages/common/src/msgpack.js.map +1 -1
  68. package/packages/indexer_client/src/apis/api-service.d.ts +1 -1
  69. package/packages/indexer_client/src/apis/api-service.js +12 -12
  70. package/packages/indexer_client/src/apis/api-service.js.map +1 -1
  71. package/packages/indexer_client/src/apis/api-service.mjs +12 -12
  72. package/packages/indexer_client/src/apis/api-service.mjs.map +1 -1
  73. package/packages/indexer_client/src/core/api-error.js +3 -1
  74. package/packages/indexer_client/src/core/api-error.js.map +1 -1
  75. package/packages/indexer_client/src/core/api-error.mjs +3 -1
  76. package/packages/indexer_client/src/core/api-error.mjs.map +1 -1
  77. package/packages/indexer_client/src/core/model-runtime.js +4 -4
  78. package/packages/indexer_client/src/core/model-runtime.js.map +1 -1
  79. package/packages/indexer_client/src/core/model-runtime.mjs +6 -6
  80. package/packages/indexer_client/src/core/model-runtime.mjs.map +1 -1
  81. package/packages/indexer_client/src/models/account-participation.js +4 -4
  82. package/packages/indexer_client/src/models/account-participation.js.map +1 -1
  83. package/packages/indexer_client/src/models/account-participation.mjs +4 -4
  84. package/packages/indexer_client/src/models/account-participation.mjs.map +1 -1
  85. package/packages/indexer_client/src/models/asset-params.js +2 -1
  86. package/packages/indexer_client/src/models/asset-params.js.map +1 -1
  87. package/packages/indexer_client/src/models/asset-params.mjs +2 -1
  88. package/packages/indexer_client/src/models/asset-params.mjs.map +1 -1
  89. package/packages/indexer_client/src/models/block.js +8 -8
  90. package/packages/indexer_client/src/models/block.js.map +1 -1
  91. package/packages/indexer_client/src/models/block.mjs +8 -8
  92. package/packages/indexer_client/src/models/block.mjs.map +1 -1
  93. package/packages/indexer_client/src/models/eval-delta-key-value.d.ts +1 -1
  94. package/packages/indexer_client/src/models/eval-delta-key-value.js +2 -2
  95. package/packages/indexer_client/src/models/eval-delta-key-value.js.map +1 -1
  96. package/packages/indexer_client/src/models/eval-delta-key-value.mjs +2 -2
  97. package/packages/indexer_client/src/models/eval-delta-key-value.mjs.map +1 -1
  98. package/packages/indexer_client/src/models/eval-delta.d.ts +1 -1
  99. package/packages/indexer_client/src/models/eval-delta.js +2 -2
  100. package/packages/indexer_client/src/models/eval-delta.js.map +1 -1
  101. package/packages/indexer_client/src/models/eval-delta.mjs +2 -2
  102. package/packages/indexer_client/src/models/eval-delta.mjs.map +1 -1
  103. package/packages/indexer_client/src/models/hb-proof-fields.js +6 -6
  104. package/packages/indexer_client/src/models/hb-proof-fields.js.map +1 -1
  105. package/packages/indexer_client/src/models/hb-proof-fields.mjs +6 -6
  106. package/packages/indexer_client/src/models/hb-proof-fields.mjs.map +1 -1
  107. package/packages/indexer_client/src/models/state-proof-verifier.js +2 -2
  108. package/packages/indexer_client/src/models/state-proof-verifier.js.map +1 -1
  109. package/packages/indexer_client/src/models/state-proof-verifier.mjs +2 -2
  110. package/packages/indexer_client/src/models/state-proof-verifier.mjs.map +1 -1
  111. package/packages/indexer_client/src/models/teal-key-value.d.ts +1 -1
  112. package/packages/indexer_client/src/models/teal-key-value.js +2 -2
  113. package/packages/indexer_client/src/models/teal-key-value.js.map +1 -1
  114. package/packages/indexer_client/src/models/teal-key-value.mjs +2 -2
  115. package/packages/indexer_client/src/models/teal-key-value.mjs.map +1 -1
  116. package/packages/indexer_client/src/models/transaction-heartbeat.js +2 -1
  117. package/packages/indexer_client/src/models/transaction-heartbeat.js.map +1 -1
  118. package/packages/indexer_client/src/models/transaction-heartbeat.mjs +2 -1
  119. package/packages/indexer_client/src/models/transaction-heartbeat.mjs.map +1 -1
  120. package/packages/indexer_client/src/models/transaction-keyreg.js +4 -4
  121. package/packages/indexer_client/src/models/transaction-keyreg.js.map +1 -1
  122. package/packages/indexer_client/src/models/transaction-keyreg.mjs +4 -4
  123. package/packages/indexer_client/src/models/transaction-keyreg.mjs.map +1 -1
  124. package/packages/indexer_client/src/models/transaction-signature-logicsig.js +2 -1
  125. package/packages/indexer_client/src/models/transaction-signature-logicsig.js.map +1 -1
  126. package/packages/indexer_client/src/models/transaction-signature-logicsig.mjs +2 -1
  127. package/packages/indexer_client/src/models/transaction-signature-logicsig.mjs.map +1 -1
  128. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.js +3 -3
  129. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.js.map +1 -1
  130. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.mjs +3 -3
  131. package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.mjs.map +1 -1
  132. package/packages/indexer_client/src/models/transaction.js +4 -3
  133. package/packages/indexer_client/src/models/transaction.js.map +1 -1
  134. package/packages/indexer_client/src/models/transaction.mjs +4 -3
  135. package/packages/indexer_client/src/models/transaction.mjs.map +1 -1
  136. package/packages/kmd_client/src/apis/api-service.d.ts +5 -5
  137. package/packages/kmd_client/src/apis/api-service.js +32 -32
  138. package/packages/kmd_client/src/apis/api-service.js.map +1 -1
  139. package/packages/kmd_client/src/apis/api-service.mjs +32 -32
  140. package/packages/kmd_client/src/apis/api-service.mjs.map +1 -1
  141. package/packages/kmd_client/src/core/api-error.js +3 -1
  142. package/packages/kmd_client/src/core/api-error.js.map +1 -1
  143. package/packages/kmd_client/src/core/api-error.mjs +3 -1
  144. package/packages/kmd_client/src/core/api-error.mjs.map +1 -1
  145. package/packages/kmd_client/src/core/model-runtime.js +4 -4
  146. package/packages/kmd_client/src/core/model-runtime.js.map +1 -1
  147. package/packages/kmd_client/src/core/model-runtime.mjs +6 -6
  148. package/packages/kmd_client/src/core/model-runtime.mjs.map +1 -1
  149. package/packages/sdk/src/encoding/encoding.js +12 -2
  150. package/packages/sdk/src/encoding/encoding.js.map +1 -1
  151. package/packages/sdk/src/encoding/encoding.mjs +12 -1
  152. package/packages/sdk/src/encoding/encoding.mjs.map +1 -1
  153. package/packages/sdk/src/encoding/schema/map.js +0 -2
  154. package/packages/sdk/src/encoding/schema/map.js.map +1 -1
  155. package/packages/transact/src/logicsig.js +3 -3
  156. package/packages/transact/src/logicsig.js.map +1 -1
  157. package/packages/transact/src/logicsig.mjs +3 -3
  158. package/packages/transact/src/logicsig.mjs.map +1 -1
  159. package/packages/transact/src/multisig.js +24 -24
  160. package/packages/transact/src/multisig.js.map +1 -1
  161. package/packages/transact/src/multisig.mjs +24 -24
  162. package/packages/transact/src/multisig.mjs.map +1 -1
  163. package/packages/transact/src/transactions/app-call.d.ts +2 -2
  164. package/packages/transact/src/transactions/app-call.js.map +1 -1
  165. package/packages/transact/src/transactions/app-call.mjs.map +1 -1
  166. package/packages/transact/src/transactions/signed-transaction-meta.js +2 -2
  167. package/packages/transact/src/transactions/signed-transaction-meta.js.map +1 -1
  168. package/packages/transact/src/transactions/signed-transaction-meta.mjs +2 -2
  169. package/packages/transact/src/transactions/signed-transaction-meta.mjs.map +1 -1
  170. package/packages/transact/src/transactions/signed-transaction.d.ts +2 -2
  171. package/packages/transact/src/transactions/signed-transaction.js.map +1 -1
  172. package/packages/transact/src/transactions/signed-transaction.mjs.map +1 -1
  173. package/packages/transact/src/transactions/transaction-meta.js +7 -1
  174. package/packages/transact/src/transactions/transaction-meta.js.map +1 -1
  175. package/packages/transact/src/transactions/transaction-meta.mjs +7 -1
  176. package/packages/transact/src/transactions/transaction-meta.mjs.map +1 -1
  177. package/packages/transact/src/transactions/transaction.js +1 -0
  178. package/packages/transact/src/transactions/transaction.js.map +1 -1
  179. package/packages/transact/src/transactions/transaction.mjs +1 -0
  180. package/packages/transact/src/transactions/transaction.mjs.map +1 -1
  181. package/sdk/index.js +1 -1
  182. package/testing/fixtures/algorand-fixture.d.ts +3 -3
  183. package/testing/fixtures/algorand-fixture.js.map +1 -1
  184. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  185. package/transaction/transaction.js +2 -2
  186. package/transaction/transaction.js.map +1 -1
  187. package/transaction/transaction.mjs +2 -2
  188. package/transaction/transaction.mjs.map +1 -1
  189. package/transactions/app-call.d.ts +2 -1
  190. package/transactions/app-call.js.map +1 -1
  191. package/transactions/app-call.mjs.map +1 -1
  192. package/types/account-manager.js +1 -1
  193. package/types/account-manager.js.map +1 -1
  194. package/types/account-manager.mjs +1 -1
  195. package/types/account-manager.mjs.map +1 -1
  196. package/types/algorand-client-transaction-creator.d.ts +80 -66
  197. package/types/algorand-client-transaction-creator.js +8 -0
  198. package/types/algorand-client-transaction-creator.js.map +1 -1
  199. package/types/algorand-client-transaction-creator.mjs +8 -0
  200. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  201. package/types/algorand-client-transaction-sender.d.ts +80 -66
  202. package/types/algorand-client-transaction-sender.js +8 -1
  203. package/types/algorand-client-transaction-sender.js.map +1 -1
  204. package/types/algorand-client-transaction-sender.mjs +8 -0
  205. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  206. package/types/app-client.d.ts +83 -78
  207. package/types/app-client.js +0 -1
  208. package/types/app-client.js.map +1 -1
  209. package/types/app-deployer.js +1 -1
  210. package/types/app-deployer.js.map +1 -1
  211. package/types/app-deployer.mjs +1 -1
  212. package/types/app-deployer.mjs.map +1 -1
  213. package/types/app-factory.d.ts +42 -39
  214. package/types/app-manager.d.ts +2 -0
  215. package/types/app-manager.js +5 -4
  216. package/types/app-manager.js.map +1 -1
  217. package/types/app-manager.mjs +5 -4
  218. package/types/app-manager.mjs.map +1 -1
  219. package/types/asset-manager.js +1 -1
  220. package/types/asset-manager.js.map +1 -1
  221. package/types/asset-manager.mjs +1 -1
  222. package/types/asset-manager.mjs.map +1 -1
  223. package/types/composer.d.ts +8 -0
  224. package/types/composer.js +11 -4
  225. package/types/composer.js.map +1 -1
  226. package/types/composer.mjs +11 -3
  227. package/types/composer.mjs.map +1 -1
  228. package/types/kmd-account-manager.d.ts +1 -0
  229. package/types/kmd-account-manager.js +21 -10
  230. package/types/kmd-account-manager.js.map +1 -1
  231. package/types/kmd-account-manager.mjs +22 -11
  232. package/types/kmd-account-manager.mjs.map +1 -1
  233. package/types/testing.d.ts +2 -2
@@ -1,6 +1,7 @@
1
1
  const require_abi_type = require('./abi-type.js');
2
2
 
3
3
  //#region packages/abi/src/arc56-contract.ts
4
+ /** ARC-56 spec */
4
5
  /** Storage Helper Functions */
5
6
  /**
6
7
  * Resolves a storage type string (ABI type, AVM type, or struct name) into an ABIType or AVMType
@@ -1 +1 @@
1
- {"version":3,"file":"arc56-contract.js","names":["ABIStructType","ABIType","result: Record<string, ABIStorageKey>","result: Record<string, ABIStorageMap>"],"sources":["../../../../packages/abi/src/arc56-contract.ts"],"sourcesContent":["/****************/\n/** ARC-56 spec */\n/****************/\n\nimport { ABIStructType, ABIType } from './abi-type'\n\n/** Describes a single key in app storage with parsed ABI types */\nexport type ABIStorageKey = {\n /** The bytes of the key encoded as base64 */\n key: string\n /** The parsed type of the key (ABI type or AVM type) */\n keyType: ABIType | AVMType\n /** The parsed type of the value (ABI type or AVM type) */\n valueType: ABIType | AVMType\n /** Description of what this storage key holds */\n desc?: string\n}\n\n/** Describes a storage map with parsed ABI types */\nexport type ABIStorageMap = {\n /** The parsed type of the keys in the map (ABI type or AVM type) */\n keyType: ABIType | AVMType\n /** The parsed type of the values in the map (ABI type or AVM type) */\n valueType: ABIType | AVMType\n /** Description of what the key-value pairs in this mapping hold */\n desc?: string\n /** The base64-encoded prefix of the map keys */\n prefix?: string\n}\n\n/** Describes the entire contract. This type is an extension of the type described in ARC-4 */\nexport type Arc56Contract = {\n /** The ARCs used and/or supported by this contract. All contracts implicitly support ARC4 and ARC56 */\n arcs: number[]\n /** A user-friendly name for the contract */\n name: string\n /** Optional, user-friendly description for the type */\n desc?: string\n /**\n * Optional object listing the contract instances across different networks.\n * The key is the base64 genesis hash of the network, and the value contains\n * information about the deployed contract in the network indicated by the\n * key. A key containing the human-readable name of the network MAY be\n * included, but the corresponding genesis hash key MUST also be defined\n */\n networks?: {\n [network: string]: {\n /** The app ID of the deployed contract in this network */\n appID: number\n }\n }\n /** Named structs used by the application. Each struct field appears in the same order as ABI encoding. */\n structs: { [structName: StructName]: StructField[] }\n /** All of the methods that the contract implements */\n methods: Arc56Method[]\n state: {\n /** Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application */\n schema: {\n global: {\n ints: number\n bytes: number\n }\n local: {\n ints: number\n bytes: number\n }\n }\n /** Mapping of human-readable names to StorageKey objects */\n keys: {\n global: { [name: string]: StorageKey }\n local: { [name: string]: StorageKey }\n box: { [name: string]: StorageKey }\n }\n /** Mapping of human-readable names to StorageMap objects */\n maps: {\n global: { [name: string]: StorageMap }\n local: { [name: string]: StorageMap }\n box: { [name: string]: StorageMap }\n }\n }\n /** Supported bare actions for the contract. An action is a combination of call/create and an OnComplete */\n bareActions: {\n /** OnCompletes this method allows when appID === 0 */\n create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]\n /** OnCompletes this method allows when appID !== 0 */\n call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[]\n }\n /** Information about the TEAL programs */\n sourceInfo?: {\n /** Approval program information */\n approval: ProgramSourceInfo\n /** Clear program information */\n clear: ProgramSourceInfo\n }\n /** The pre-compiled TEAL that may contain template variables. MUST be omitted if included as part of ARC23 */\n source?: {\n /** The approval program */\n approval: string\n /** The clear program */\n clear: string\n }\n /** The compiled bytecode for the application. MUST be omitted if included as part of ARC23 */\n byteCode?: {\n /** The approval program */\n approval: string\n /** The clear program */\n clear: string\n }\n /** Information used to get the given byteCode and/or PC values in sourceInfo. MUST be given if byteCode or PC values are present */\n compilerInfo?: {\n /** The name of the compiler */\n compiler: 'algod' | 'puya'\n /** Compiler version information */\n compilerVersion: {\n major: number\n minor: number\n patch: number\n commitHash?: string\n }\n }\n /** ARC-28 events that MAY be emitted by this contract */\n events?: Array<Event>\n /** A mapping of template variable names as they appear in the TEAL (not including TMPL_ prefix) to their respective types and values (if applicable) */\n templateVariables?: {\n [name: string]: {\n /** The type of the template variable */\n type: ABITypeName | AVMType | StructName\n /** If given, the base64 encoded value used for the given app/program */\n value?: string\n }\n }\n /** The scratch variables used during runtime */\n scratchVariables?: {\n [name: string]: {\n slot: number\n type: ABITypeName | AVMType | StructName\n }\n }\n}\n\n/** Describes a method in the contract. This type is an extension of the type described in ARC-4 */\nexport type Arc56Method = {\n /** The name of the method */\n name: string\n /** Optional, user-friendly description for the method */\n desc?: string\n /** The arguments of the method, in order */\n args: Array<{\n /** The type of the argument. The `struct` field should also be checked to determine if this arg is a struct. */\n type: ABITypeName\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n /** Optional, user-friendly name for the argument */\n name?: string\n /** Optional, user-friendly description for the argument */\n desc?: string\n /** The default value that clients should use. */\n defaultValue?: {\n /** Base64 encoded bytes, base64 ARC4 encoded uint64, or UTF-8 method selector */\n data: string\n /** How the data is encoded. This is the encoding for the data provided here, not the arg type */\n type?: ABITypeName | AVMType\n /** Where the default value is coming from\n * - box: The data key signifies the box key to read the value from\n * - global: The data key signifies the global state key to read the value from\n * - local: The data key signifies the local state key to read the value from (for the sender)\n * - literal: the value is a literal and should be passed directly as the argument\n * - method: The utf8 signature of the method in this contract to call to get the default value. If the method has arguments, they all must have default values. The method **MUST** be readonly so simulate can be used to get the default value\n */\n source: 'box' | 'global' | 'local' | 'literal' | 'method'\n }\n }>\n /** Information about the method's return value */\n returns: {\n /** The type of the return value, or \"void\" to indicate no return value. The `struct` field should also be checked to determine if this return value is a struct. */\n type: ABITypeName\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n /** Optional, user-friendly description for the return value */\n desc?: string\n }\n /** an action is a combination of call/create and an OnComplete */\n actions: {\n /** OnCompletes this method allows when appID === 0 */\n create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]\n /** OnCompletes this method allows when appID !== 0 */\n call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[]\n }\n /** If this method does not write anything to the ledger (ARC-22) */\n readonly?: boolean\n /** ARC-28 events that MAY be emitted by this method */\n events?: Array<Event>\n /** Information that clients can use when calling the method */\n recommendations?: {\n /** The number of inner transactions the caller should cover the fees for */\n innerTransactionCount?: number\n /** Recommended box references to include */\n boxes?: {\n /** The app ID for the box */\n app?: number\n /** The base64 encoded box key */\n key: string\n /** The number of bytes being read from the box */\n readBytes: number\n /** The number of bytes being written to the box */\n writeBytes: number\n }\n /** Recommended foreign accounts */\n accounts?: string[]\n /** Recommended foreign apps */\n apps?: number[]\n /** Recommended foreign assets */\n assets?: number[]\n }\n}\n\n/** ARC-28 event */\nexport type Event = {\n /** The name of the event */\n name: string\n /** Optional, user-friendly description for the event */\n desc?: string\n /** The arguments of the event, in order */\n args: Array<{\n /** The type of the argument. The `struct` field should also be checked to determine if this arg is a struct. */\n type: ABITypeName\n /** Optional, user-friendly name for the argument */\n name?: string\n /** Optional, user-friendly description for the argument */\n desc?: string\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n }>\n}\n\n/** An ABI-encoded type */\nexport type ABITypeName = string\n\n/** The name of a defined struct */\nexport type StructName = string\n\n/** Raw byteslice without the length prefixed that is specified in ARC-4 */\nexport type AVMBytes = 'AVMBytes'\n\n/** A utf-8 string without the length prefix that is specified in ARC-4 */\nexport type AVMString = 'AVMString'\n\n/** A 64-bit unsigned integer */\nexport type AVMUint64 = 'AVMUint64'\n\n/** A native AVM type */\nexport type AVMType = AVMBytes | AVMString | AVMUint64\n\n/** Information about a single field in a struct */\nexport type StructField = {\n /** The name of the struct field */\n name: string\n /** The type of the struct field's value */\n type: ABITypeName | StructName | StructField[]\n}\n\n/** Describes a single key in app storage */\nexport type StorageKey = {\n /** Description of what this storage key holds */\n desc?: string\n /** The type of the key */\n keyType: ABITypeName | AVMType | StructName\n\n /** The type of the value */\n valueType: ABITypeName | AVMType | StructName\n /** The bytes of the key encoded as base64 */\n key: string\n}\n\n/** Describes a mapping of key-value pairs in storage */\nexport type StorageMap = {\n /** Description of what the key-value pairs in this mapping hold */\n desc?: string\n /** The type of the keys in the map */\n keyType: ABITypeName | AVMType | StructName\n /** The type of the values in the map */\n valueType: ABITypeName | AVMType | StructName\n /** The base64-encoded prefix of the map keys*/\n prefix?: string\n}\n\ntype SourceInfo = {\n /** The program counter value(s). Could be offset if pcOffsetMethod is not \"none\" */\n pc: Array<number>\n /** A human-readable string that describes the error when the program fails at the given PC */\n errorMessage?: string\n /** The TEAL line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients */\n teal?: number\n /** The original source file and line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients */\n source?: string\n}\n\nexport type ProgramSourceInfo = {\n /** The source information for the program */\n sourceInfo: SourceInfo[]\n /** How the program counter offset is calculated\n * - none: The pc values in sourceInfo are not offset\n * - cblocks: The pc values in sourceInfo are offset by the PC of the first op following the last cblock at the top of the program\n */\n pcOffsetMethod: 'none' | 'cblocks'\n}\n\n/*************************/\n/** Storage Helper Functions */\n/*************************/\n\n/**\n * Resolves a storage type string (ABI type, AVM type, or struct name) into an ABIType or AVMType\n * @param typeStr The type string to resolve\n * @param structs The structs defined in the contract\n * @returns The parsed ABIType or AVMType string\n */\nfunction resolveStorageType(typeStr: string, structs: Record<string, StructField[]>): ABIType | AVMType {\n // Check if it's an AVM type\n if (typeStr === 'AVMBytes' || typeStr === 'AVMString' || typeStr === 'AVMUint64') {\n return typeStr as AVMType\n }\n\n // Check if it's a struct type\n if (structs[typeStr]) {\n return ABIStructType.fromStruct(typeStr, structs)\n }\n\n // Otherwise parse as ABI type\n try {\n return ABIType.from(typeStr)\n } catch (error) {\n throw new Error(`Failed to parse storage type '${typeStr}': ${error}`)\n }\n}\n\n/**\n * Converts a StorageKey to an ABIStorageKey with parsed types\n * @param storageKey The storage key to convert\n * @param structs The structs defined in the contract\n * @returns The converted ABIStorageKey\n */\nfunction convertStorageKey(storageKey: StorageKey, structs: Record<string, StructField[]>): ABIStorageKey {\n const keyType = resolveStorageType(storageKey.keyType, structs)\n const valueType = resolveStorageType(storageKey.valueType, structs)\n\n return {\n key: storageKey.key,\n keyType,\n valueType,\n desc: storageKey.desc,\n }\n}\n\n/**\n * Converts a StorageMap to an ABIStorageMap with parsed types\n * @param storageMap The storage map to convert\n * @param structs The structs defined in the contract\n * @returns The converted ABIStorageMap\n */\nfunction convertStorageMap(storageMap: StorageMap, structs: Record<string, StructField[]>): ABIStorageMap {\n const keyType = resolveStorageType(storageMap.keyType, structs)\n const valueType = resolveStorageType(storageMap.valueType, structs)\n\n return {\n keyType,\n valueType,\n desc: storageMap.desc,\n prefix: storageMap.prefix,\n }\n}\n\n/**\n * Get a specific global storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getGlobalABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.global[keyName]\n if (!storageKey) {\n throw new Error(`Global storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get a specific local storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getLocalABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.local[keyName]\n if (!storageKey) {\n throw new Error(`Local storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get a specific box storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getBoxABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.box[keyName]\n if (!storageKey) {\n throw new Error(`Box storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get all global storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getGlobalABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.global)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get all local storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getLocalABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.local)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get all box storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getBoxABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.box)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get a specific global storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getGlobalABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.global[mapName]\n if (!storageMap) {\n throw new Error(`Global storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get a specific local storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getLocalABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.local[mapName]\n if (!storageMap) {\n throw new Error(`Local storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get a specific box storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getBoxABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.box[mapName]\n if (!storageMap) {\n throw new Error(`Box storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get all global storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getGlobalABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.global)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n\n/**\n * Get all local storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getLocalABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.local)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n\n/**\n * Get all box storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getBoxABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.box)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n"],"mappings":";;;;;;;;;;AA6TA,SAAS,mBAAmB,SAAiB,SAA2D;AAEtG,KAAI,YAAY,cAAc,YAAY,eAAe,YAAY,YACnE,QAAO;AAIT,KAAI,QAAQ,SACV,QAAOA,+BAAc,WAAW,SAAS,QAAQ;AAInD,KAAI;AACF,SAAOC,yBAAQ,KAAK,QAAQ;UACrB,OAAO;AACd,QAAM,IAAI,MAAM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AY,SAAS,QAAQ;AAEhE,QAAO;;;;;;;AAQT,SAAgB,uBAAuB,UAAwD;CAC7F,MAAMA,SAAwC,EAAE;AAChD,MAAK,MAAM,CAAC,MAAM,eAAe,OAAO,QAAQ,SAAS,MAAM,KAAK,MAAM,CACxE,QAAO,QAAQ,kBAAkB,YAAY,SAAS,QAAQ;AAEhE,QAAO;;;;;;;AAQT,SAAgB,qBAAqB,UAAwD;CAC3F,MAAMA,SAAwC,EAAE;AAChD,MAAK,MAAM,CAAC,MAAM,eAAe,OAAO,QAAQ,SAAS,MAAM,KAAK,IAAI,CACtE,QAAO,QAAQ,kBAAkB,YAAY,SAAS,QAAQ;AAEhE,QAAO"}
1
+ {"version":3,"file":"arc56-contract.js","names":["ABIStructType","ABIType","result: Record<string, ABIStorageKey>","result: Record<string, ABIStorageMap>"],"sources":["../../../../packages/abi/src/arc56-contract.ts"],"sourcesContent":["/****************/\n/** ARC-56 spec */\n/****************/\n\nimport { ABIStructType, ABIType } from './abi-type'\n\n/** Describes a single key in app storage with parsed ABI types */\nexport type ABIStorageKey = {\n /** The bytes of the key encoded as base64 */\n key: string\n /** The parsed type of the key (ABI type or AVM type) */\n keyType: ABIType | AVMType\n /** The parsed type of the value (ABI type or AVM type) */\n valueType: ABIType | AVMType\n /** Description of what this storage key holds */\n desc?: string\n}\n\n/** Describes a storage map with parsed ABI types */\nexport type ABIStorageMap = {\n /** The parsed type of the keys in the map (ABI type or AVM type) */\n keyType: ABIType | AVMType\n /** The parsed type of the values in the map (ABI type or AVM type) */\n valueType: ABIType | AVMType\n /** Description of what the key-value pairs in this mapping hold */\n desc?: string\n /** The base64-encoded prefix of the map keys */\n prefix?: string\n}\n\n/** Describes the entire contract. This type is an extension of the type described in ARC-4 */\nexport type Arc56Contract = {\n /** The ARCs used and/or supported by this contract. All contracts implicitly support ARC4 and ARC56 */\n arcs: number[]\n /** A user-friendly name for the contract */\n name: string\n /** Optional, user-friendly description for the type */\n desc?: string\n /**\n * Optional object listing the contract instances across different networks.\n * The key is the base64 genesis hash of the network, and the value contains\n * information about the deployed contract in the network indicated by the\n * key. A key containing the human-readable name of the network MAY be\n * included, but the corresponding genesis hash key MUST also be defined\n */\n networks?: {\n [network: string]: {\n /** The app ID of the deployed contract in this network */\n appID: number\n }\n }\n /** Named structs used by the application. Each struct field appears in the same order as ABI encoding. */\n structs: { [structName: StructName]: StructField[] }\n /** All of the methods that the contract implements */\n methods: Arc56Method[]\n state: {\n /** Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application */\n schema: {\n global: {\n ints: number\n bytes: number\n }\n local: {\n ints: number\n bytes: number\n }\n }\n /** Mapping of human-readable names to StorageKey objects */\n keys: {\n global: { [name: string]: StorageKey }\n local: { [name: string]: StorageKey }\n box: { [name: string]: StorageKey }\n }\n /** Mapping of human-readable names to StorageMap objects */\n maps: {\n global: { [name: string]: StorageMap }\n local: { [name: string]: StorageMap }\n box: { [name: string]: StorageMap }\n }\n }\n /** Supported bare actions for the contract. An action is a combination of call/create and an OnComplete */\n bareActions: {\n /** OnCompletes this method allows when appID === 0 */\n create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]\n /** OnCompletes this method allows when appID !== 0 */\n call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[]\n }\n /** Information about the TEAL programs */\n sourceInfo?: {\n /** Approval program information */\n approval: ProgramSourceInfo\n /** Clear program information */\n clear: ProgramSourceInfo\n }\n /** The pre-compiled TEAL that may contain template variables. MUST be omitted if included as part of ARC23 */\n source?: {\n /** The approval program */\n approval: string\n /** The clear program */\n clear: string\n }\n /** The compiled bytecode for the application. MUST be omitted if included as part of ARC23 */\n byteCode?: {\n /** The approval program */\n approval: string\n /** The clear program */\n clear: string\n }\n /** Information used to get the given byteCode and/or PC values in sourceInfo. MUST be given if byteCode or PC values are present */\n compilerInfo?: {\n /** The name of the compiler */\n compiler: 'algod' | 'puya'\n /** Compiler version information */\n compilerVersion: {\n major: number\n minor: number\n patch: number\n commitHash?: string\n }\n }\n /** ARC-28 events that MAY be emitted by this contract */\n events?: Array<Event>\n /** A mapping of template variable names as they appear in the TEAL (not including TMPL_ prefix) to their respective types and values (if applicable) */\n templateVariables?: {\n [name: string]: {\n /** The type of the template variable */\n type: ABITypeName | AVMType | StructName\n /** If given, the base64 encoded value used for the given app/program */\n value?: string\n }\n }\n /** The scratch variables used during runtime */\n scratchVariables?: {\n [name: string]: {\n slot: number\n type: ABITypeName | AVMType | StructName\n }\n }\n}\n\n/** Describes a method in the contract. This type is an extension of the type described in ARC-4 */\nexport type Arc56Method = {\n /** The name of the method */\n name: string\n /** Optional, user-friendly description for the method */\n desc?: string\n /** The arguments of the method, in order */\n args: Array<{\n /** The type of the argument. The `struct` field should also be checked to determine if this arg is a struct. */\n type: ABITypeName\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n /** Optional, user-friendly name for the argument */\n name?: string\n /** Optional, user-friendly description for the argument */\n desc?: string\n /** The default value that clients should use. */\n defaultValue?: {\n /** Base64 encoded bytes, base64 ARC4 encoded uint64, or UTF-8 method selector */\n data: string\n /** How the data is encoded. This is the encoding for the data provided here, not the arg type */\n type?: ABITypeName | AVMType\n /** Where the default value is coming from\n * - box: The data key signifies the box key to read the value from\n * - global: The data key signifies the global state key to read the value from\n * - local: The data key signifies the local state key to read the value from (for the sender)\n * - literal: the value is a literal and should be passed directly as the argument\n * - method: The utf8 signature of the method in this contract to call to get the default value. If the method has arguments, they all must have default values. The method **MUST** be readonly so simulate can be used to get the default value\n */\n source: 'box' | 'global' | 'local' | 'literal' | 'method'\n }\n }>\n /** Information about the method's return value */\n returns: {\n /** The type of the return value, or \"void\" to indicate no return value. The `struct` field should also be checked to determine if this return value is a struct. */\n type: ABITypeName\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n /** Optional, user-friendly description for the return value */\n desc?: string\n }\n /** an action is a combination of call/create and an OnComplete */\n actions: {\n /** OnCompletes this method allows when appID === 0 */\n create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]\n /** OnCompletes this method allows when appID !== 0 */\n call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[]\n }\n /** If this method does not write anything to the ledger (ARC-22) */\n readonly?: boolean\n /** ARC-28 events that MAY be emitted by this method */\n events?: Array<Event>\n /** Information that clients can use when calling the method */\n recommendations?: {\n /** The number of inner transactions the caller should cover the fees for */\n innerTransactionCount?: number\n /** Recommended box references to include */\n boxes?: {\n /** The app ID for the box */\n app?: number\n /** The base64 encoded box key */\n key: string\n /** The number of bytes being read from the box */\n readBytes: number\n /** The number of bytes being written to the box */\n writeBytes: number\n }\n /** Recommended foreign accounts */\n accounts?: string[]\n /** Recommended foreign apps */\n apps?: number[]\n /** Recommended foreign assets */\n assets?: number[]\n }\n}\n\n/** ARC-28 event */\nexport type Event = {\n /** The name of the event */\n name: string\n /** Optional, user-friendly description for the event */\n desc?: string\n /** The arguments of the event, in order */\n args: Array<{\n /** The type of the argument. The `struct` field should also be checked to determine if this arg is a struct. */\n type: ABITypeName\n /** Optional, user-friendly name for the argument */\n name?: string\n /** Optional, user-friendly description for the argument */\n desc?: string\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n }>\n}\n\n/** An ABI-encoded type */\nexport type ABITypeName = string\n\n/** The name of a defined struct */\nexport type StructName = string\n\n/** Raw byteslice without the length prefixed that is specified in ARC-4 */\nexport type AVMBytes = 'AVMBytes'\n\n/** A utf-8 string without the length prefix that is specified in ARC-4 */\nexport type AVMString = 'AVMString'\n\n/** A 64-bit unsigned integer */\nexport type AVMUint64 = 'AVMUint64'\n\n/** A native AVM type */\nexport type AVMType = AVMBytes | AVMString | AVMUint64\n\n/** Information about a single field in a struct */\nexport type StructField = {\n /** The name of the struct field */\n name: string\n /** The type of the struct field's value */\n type: ABITypeName | StructName | StructField[]\n}\n\n/** Describes a single key in app storage */\nexport type StorageKey = {\n /** Description of what this storage key holds */\n desc?: string\n /** The type of the key */\n keyType: ABITypeName | AVMType | StructName\n\n /** The type of the value */\n valueType: ABITypeName | AVMType | StructName\n /** The bytes of the key encoded as base64 */\n key: string\n}\n\n/** Describes a mapping of key-value pairs in storage */\nexport type StorageMap = {\n /** Description of what the key-value pairs in this mapping hold */\n desc?: string\n /** The type of the keys in the map */\n keyType: ABITypeName | AVMType | StructName\n /** The type of the values in the map */\n valueType: ABITypeName | AVMType | StructName\n /** The base64-encoded prefix of the map keys*/\n prefix?: string\n}\n\ntype SourceInfo = {\n /** The program counter value(s). Could be offset if pcOffsetMethod is not \"none\" */\n pc: Array<number>\n /** A human-readable string that describes the error when the program fails at the given PC */\n errorMessage?: string\n /** The TEAL line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients */\n teal?: number\n /** The original source file and line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients */\n source?: string\n}\n\nexport type ProgramSourceInfo = {\n /** The source information for the program */\n sourceInfo: SourceInfo[]\n /** How the program counter offset is calculated\n * - none: The pc values in sourceInfo are not offset\n * - cblocks: The pc values in sourceInfo are offset by the PC of the first op following the last cblock at the top of the program\n */\n pcOffsetMethod: 'none' | 'cblocks'\n}\n\n/*************************/\n/** Storage Helper Functions */\n/*************************/\n\n/**\n * Resolves a storage type string (ABI type, AVM type, or struct name) into an ABIType or AVMType\n * @param typeStr The type string to resolve\n * @param structs The structs defined in the contract\n * @returns The parsed ABIType or AVMType string\n */\nfunction resolveStorageType(typeStr: string, structs: Record<string, StructField[]>): ABIType | AVMType {\n // Check if it's an AVM type\n if (typeStr === 'AVMBytes' || typeStr === 'AVMString' || typeStr === 'AVMUint64') {\n return typeStr as AVMType\n }\n\n // Check if it's a struct type\n if (structs[typeStr]) {\n return ABIStructType.fromStruct(typeStr, structs)\n }\n\n // Otherwise parse as ABI type\n try {\n return ABIType.from(typeStr)\n } catch (error) {\n throw new Error(`Failed to parse storage type '${typeStr}': ${error}`)\n }\n}\n\n/**\n * Converts a StorageKey to an ABIStorageKey with parsed types\n * @param storageKey The storage key to convert\n * @param structs The structs defined in the contract\n * @returns The converted ABIStorageKey\n */\nfunction convertStorageKey(storageKey: StorageKey, structs: Record<string, StructField[]>): ABIStorageKey {\n const keyType = resolveStorageType(storageKey.keyType, structs)\n const valueType = resolveStorageType(storageKey.valueType, structs)\n\n return {\n key: storageKey.key,\n keyType,\n valueType,\n desc: storageKey.desc,\n }\n}\n\n/**\n * Converts a StorageMap to an ABIStorageMap with parsed types\n * @param storageMap The storage map to convert\n * @param structs The structs defined in the contract\n * @returns The converted ABIStorageMap\n */\nfunction convertStorageMap(storageMap: StorageMap, structs: Record<string, StructField[]>): ABIStorageMap {\n const keyType = resolveStorageType(storageMap.keyType, structs)\n const valueType = resolveStorageType(storageMap.valueType, structs)\n\n return {\n keyType,\n valueType,\n desc: storageMap.desc,\n prefix: storageMap.prefix,\n }\n}\n\n/**\n * Get a specific global storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getGlobalABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.global[keyName]\n if (!storageKey) {\n throw new Error(`Global storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get a specific local storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getLocalABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.local[keyName]\n if (!storageKey) {\n throw new Error(`Local storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get a specific box storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getBoxABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.box[keyName]\n if (!storageKey) {\n throw new Error(`Box storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get all global storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getGlobalABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.global)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get all local storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getLocalABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.local)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get all box storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getBoxABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.box)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get a specific global storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getGlobalABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.global[mapName]\n if (!storageMap) {\n throw new Error(`Global storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get a specific local storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getLocalABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.local[mapName]\n if (!storageMap) {\n throw new Error(`Local storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get a specific box storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getBoxABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.box[mapName]\n if (!storageMap) {\n throw new Error(`Box storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get all global storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getGlobalABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.global)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n\n/**\n * Get all local storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getLocalABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.local)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n\n/**\n * Get all box storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getBoxABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.box)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n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AAI,MAAM,oBAAoB,QAAQ,2BAA2B,SAAS,KAAK,GAAG;AAE1F,QAAO,kBAAkB,YAAY,SAAS,QAAQ;;;;;;;AAQxD,SAAgB,wBAAwB,UAAwD;CAC9F,MAAMC,SAAwC,EAAE;AAChD,MAAK,MAAM,CAAC,MAAM,eAAe,OAAO,QAAQ,SAAS,MAAM,KAAK,OAAO,CACzE,QAAO,QAAQ,kBAAkB,YAAY,SAAS,QAAQ;AAEhE,QAAO;;;;;;;AAQT,SAAgB,uBAAuB,UAAwD;CAC7F,MAAMA,SAAwC,EAAE;AAChD,MAAK,MAAM,CAAC,MAAM,eAAe,OAAO,QAAQ,SAAS,MAAM,KAAK,MAAM,CACxE,QAAO,QAAQ,kBAAkB,YAAY,SAAS,QAAQ;AAEhE,QAAO;;;;;;;AAQT,SAAgB,qBAAqB,UAAwD;CAC3F,MAAMA,SAAwC,EAAE;AAChD,MAAK,MAAM,CAAC,MAAM,eAAe,OAAO,QAAQ,SAAS,MAAM,KAAK,IAAI,CACtE,QAAO,QAAQ,kBAAkB,YAAY,SAAS,QAAQ;AAEhE,QAAO"}
@@ -1,6 +1,7 @@
1
1
  import { ABIStructType, ABIType } from "./abi-type.mjs";
2
2
 
3
3
  //#region packages/abi/src/arc56-contract.ts
4
+ /** ARC-56 spec */
4
5
  /** Storage Helper Functions */
5
6
  /**
6
7
  * Resolves a storage type string (ABI type, AVM type, or struct name) into an ABIType or AVMType
@@ -1 +1 @@
1
- {"version":3,"file":"arc56-contract.mjs","names":["result: Record<string, ABIStorageKey>","result: Record<string, ABIStorageMap>"],"sources":["../../../../packages/abi/src/arc56-contract.ts"],"sourcesContent":["/****************/\n/** ARC-56 spec */\n/****************/\n\nimport { ABIStructType, ABIType } from './abi-type'\n\n/** Describes a single key in app storage with parsed ABI types */\nexport type ABIStorageKey = {\n /** The bytes of the key encoded as base64 */\n key: string\n /** The parsed type of the key (ABI type or AVM type) */\n keyType: ABIType | AVMType\n /** The parsed type of the value (ABI type or AVM type) */\n valueType: ABIType | AVMType\n /** Description of what this storage key holds */\n desc?: string\n}\n\n/** Describes a storage map with parsed ABI types */\nexport type ABIStorageMap = {\n /** The parsed type of the keys in the map (ABI type or AVM type) */\n keyType: ABIType | AVMType\n /** The parsed type of the values in the map (ABI type or AVM type) */\n valueType: ABIType | AVMType\n /** Description of what the key-value pairs in this mapping hold */\n desc?: string\n /** The base64-encoded prefix of the map keys */\n prefix?: string\n}\n\n/** Describes the entire contract. This type is an extension of the type described in ARC-4 */\nexport type Arc56Contract = {\n /** The ARCs used and/or supported by this contract. All contracts implicitly support ARC4 and ARC56 */\n arcs: number[]\n /** A user-friendly name for the contract */\n name: string\n /** Optional, user-friendly description for the type */\n desc?: string\n /**\n * Optional object listing the contract instances across different networks.\n * The key is the base64 genesis hash of the network, and the value contains\n * information about the deployed contract in the network indicated by the\n * key. A key containing the human-readable name of the network MAY be\n * included, but the corresponding genesis hash key MUST also be defined\n */\n networks?: {\n [network: string]: {\n /** The app ID of the deployed contract in this network */\n appID: number\n }\n }\n /** Named structs used by the application. Each struct field appears in the same order as ABI encoding. */\n structs: { [structName: StructName]: StructField[] }\n /** All of the methods that the contract implements */\n methods: Arc56Method[]\n state: {\n /** Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application */\n schema: {\n global: {\n ints: number\n bytes: number\n }\n local: {\n ints: number\n bytes: number\n }\n }\n /** Mapping of human-readable names to StorageKey objects */\n keys: {\n global: { [name: string]: StorageKey }\n local: { [name: string]: StorageKey }\n box: { [name: string]: StorageKey }\n }\n /** Mapping of human-readable names to StorageMap objects */\n maps: {\n global: { [name: string]: StorageMap }\n local: { [name: string]: StorageMap }\n box: { [name: string]: StorageMap }\n }\n }\n /** Supported bare actions for the contract. An action is a combination of call/create and an OnComplete */\n bareActions: {\n /** OnCompletes this method allows when appID === 0 */\n create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]\n /** OnCompletes this method allows when appID !== 0 */\n call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[]\n }\n /** Information about the TEAL programs */\n sourceInfo?: {\n /** Approval program information */\n approval: ProgramSourceInfo\n /** Clear program information */\n clear: ProgramSourceInfo\n }\n /** The pre-compiled TEAL that may contain template variables. MUST be omitted if included as part of ARC23 */\n source?: {\n /** The approval program */\n approval: string\n /** The clear program */\n clear: string\n }\n /** The compiled bytecode for the application. MUST be omitted if included as part of ARC23 */\n byteCode?: {\n /** The approval program */\n approval: string\n /** The clear program */\n clear: string\n }\n /** Information used to get the given byteCode and/or PC values in sourceInfo. MUST be given if byteCode or PC values are present */\n compilerInfo?: {\n /** The name of the compiler */\n compiler: 'algod' | 'puya'\n /** Compiler version information */\n compilerVersion: {\n major: number\n minor: number\n patch: number\n commitHash?: string\n }\n }\n /** ARC-28 events that MAY be emitted by this contract */\n events?: Array<Event>\n /** A mapping of template variable names as they appear in the TEAL (not including TMPL_ prefix) to their respective types and values (if applicable) */\n templateVariables?: {\n [name: string]: {\n /** The type of the template variable */\n type: ABITypeName | AVMType | StructName\n /** If given, the base64 encoded value used for the given app/program */\n value?: string\n }\n }\n /** The scratch variables used during runtime */\n scratchVariables?: {\n [name: string]: {\n slot: number\n type: ABITypeName | AVMType | StructName\n }\n }\n}\n\n/** Describes a method in the contract. This type is an extension of the type described in ARC-4 */\nexport type Arc56Method = {\n /** The name of the method */\n name: string\n /** Optional, user-friendly description for the method */\n desc?: string\n /** The arguments of the method, in order */\n args: Array<{\n /** The type of the argument. The `struct` field should also be checked to determine if this arg is a struct. */\n type: ABITypeName\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n /** Optional, user-friendly name for the argument */\n name?: string\n /** Optional, user-friendly description for the argument */\n desc?: string\n /** The default value that clients should use. */\n defaultValue?: {\n /** Base64 encoded bytes, base64 ARC4 encoded uint64, or UTF-8 method selector */\n data: string\n /** How the data is encoded. This is the encoding for the data provided here, not the arg type */\n type?: ABITypeName | AVMType\n /** Where the default value is coming from\n * - box: The data key signifies the box key to read the value from\n * - global: The data key signifies the global state key to read the value from\n * - local: The data key signifies the local state key to read the value from (for the sender)\n * - literal: the value is a literal and should be passed directly as the argument\n * - method: The utf8 signature of the method in this contract to call to get the default value. If the method has arguments, they all must have default values. The method **MUST** be readonly so simulate can be used to get the default value\n */\n source: 'box' | 'global' | 'local' | 'literal' | 'method'\n }\n }>\n /** Information about the method's return value */\n returns: {\n /** The type of the return value, or \"void\" to indicate no return value. The `struct` field should also be checked to determine if this return value is a struct. */\n type: ABITypeName\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n /** Optional, user-friendly description for the return value */\n desc?: string\n }\n /** an action is a combination of call/create and an OnComplete */\n actions: {\n /** OnCompletes this method allows when appID === 0 */\n create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]\n /** OnCompletes this method allows when appID !== 0 */\n call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[]\n }\n /** If this method does not write anything to the ledger (ARC-22) */\n readonly?: boolean\n /** ARC-28 events that MAY be emitted by this method */\n events?: Array<Event>\n /** Information that clients can use when calling the method */\n recommendations?: {\n /** The number of inner transactions the caller should cover the fees for */\n innerTransactionCount?: number\n /** Recommended box references to include */\n boxes?: {\n /** The app ID for the box */\n app?: number\n /** The base64 encoded box key */\n key: string\n /** The number of bytes being read from the box */\n readBytes: number\n /** The number of bytes being written to the box */\n writeBytes: number\n }\n /** Recommended foreign accounts */\n accounts?: string[]\n /** Recommended foreign apps */\n apps?: number[]\n /** Recommended foreign assets */\n assets?: number[]\n }\n}\n\n/** ARC-28 event */\nexport type Event = {\n /** The name of the event */\n name: string\n /** Optional, user-friendly description for the event */\n desc?: string\n /** The arguments of the event, in order */\n args: Array<{\n /** The type of the argument. The `struct` field should also be checked to determine if this arg is a struct. */\n type: ABITypeName\n /** Optional, user-friendly name for the argument */\n name?: string\n /** Optional, user-friendly description for the argument */\n desc?: string\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n }>\n}\n\n/** An ABI-encoded type */\nexport type ABITypeName = string\n\n/** The name of a defined struct */\nexport type StructName = string\n\n/** Raw byteslice without the length prefixed that is specified in ARC-4 */\nexport type AVMBytes = 'AVMBytes'\n\n/** A utf-8 string without the length prefix that is specified in ARC-4 */\nexport type AVMString = 'AVMString'\n\n/** A 64-bit unsigned integer */\nexport type AVMUint64 = 'AVMUint64'\n\n/** A native AVM type */\nexport type AVMType = AVMBytes | AVMString | AVMUint64\n\n/** Information about a single field in a struct */\nexport type StructField = {\n /** The name of the struct field */\n name: string\n /** The type of the struct field's value */\n type: ABITypeName | StructName | StructField[]\n}\n\n/** Describes a single key in app storage */\nexport type StorageKey = {\n /** Description of what this storage key holds */\n desc?: string\n /** The type of the key */\n keyType: ABITypeName | AVMType | StructName\n\n /** The type of the value */\n valueType: ABITypeName | AVMType | StructName\n /** The bytes of the key encoded as base64 */\n key: string\n}\n\n/** Describes a mapping of key-value pairs in storage */\nexport type StorageMap = {\n /** Description of what the key-value pairs in this mapping hold */\n desc?: string\n /** The type of the keys in the map */\n keyType: ABITypeName | AVMType | StructName\n /** The type of the values in the map */\n valueType: ABITypeName | AVMType | StructName\n /** The base64-encoded prefix of the map keys*/\n prefix?: string\n}\n\ntype SourceInfo = {\n /** The program counter value(s). Could be offset if pcOffsetMethod is not \"none\" */\n pc: Array<number>\n /** A human-readable string that describes the error when the program fails at the given PC */\n errorMessage?: string\n /** The TEAL line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients */\n teal?: number\n /** The original source file and line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients */\n source?: string\n}\n\nexport type ProgramSourceInfo = {\n /** The source information for the program */\n sourceInfo: SourceInfo[]\n /** How the program counter offset is calculated\n * - none: The pc values in sourceInfo are not offset\n * - cblocks: The pc values in sourceInfo are offset by the PC of the first op following the last cblock at the top of the program\n */\n pcOffsetMethod: 'none' | 'cblocks'\n}\n\n/*************************/\n/** Storage Helper Functions */\n/*************************/\n\n/**\n * Resolves a storage type string (ABI type, AVM type, or struct name) into an ABIType or AVMType\n * @param typeStr The type string to resolve\n * @param structs The structs defined in the contract\n * @returns The parsed ABIType or AVMType string\n */\nfunction resolveStorageType(typeStr: string, structs: Record<string, StructField[]>): ABIType | AVMType {\n // Check if it's an AVM type\n if (typeStr === 'AVMBytes' || typeStr === 'AVMString' || typeStr === 'AVMUint64') {\n return typeStr as AVMType\n }\n\n // Check if it's a struct type\n if (structs[typeStr]) {\n return ABIStructType.fromStruct(typeStr, structs)\n }\n\n // Otherwise parse as ABI type\n try {\n return ABIType.from(typeStr)\n } catch (error) {\n throw new Error(`Failed to parse storage type '${typeStr}': ${error}`)\n }\n}\n\n/**\n * Converts a StorageKey to an ABIStorageKey with parsed types\n * @param storageKey The storage key to convert\n * @param structs The structs defined in the contract\n * @returns The converted ABIStorageKey\n */\nfunction convertStorageKey(storageKey: StorageKey, structs: Record<string, StructField[]>): ABIStorageKey {\n const keyType = resolveStorageType(storageKey.keyType, structs)\n const valueType = resolveStorageType(storageKey.valueType, structs)\n\n return {\n key: storageKey.key,\n keyType,\n valueType,\n desc: storageKey.desc,\n }\n}\n\n/**\n * Converts a StorageMap to an ABIStorageMap with parsed types\n * @param storageMap The storage map to convert\n * @param structs The structs defined in the contract\n * @returns The converted ABIStorageMap\n */\nfunction convertStorageMap(storageMap: StorageMap, structs: Record<string, StructField[]>): ABIStorageMap {\n const keyType = resolveStorageType(storageMap.keyType, structs)\n const valueType = resolveStorageType(storageMap.valueType, structs)\n\n return {\n keyType,\n valueType,\n desc: storageMap.desc,\n prefix: storageMap.prefix,\n }\n}\n\n/**\n * Get a specific global storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getGlobalABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.global[keyName]\n if (!storageKey) {\n throw new Error(`Global storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get a specific local storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getLocalABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.local[keyName]\n if (!storageKey) {\n throw new Error(`Local storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get a specific box storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getBoxABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.box[keyName]\n if (!storageKey) {\n throw new Error(`Box storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get all global storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getGlobalABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.global)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get all local storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getLocalABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.local)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get all box storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getBoxABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.box)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get a specific global storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getGlobalABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.global[mapName]\n if (!storageMap) {\n throw new Error(`Global storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get a specific local storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getLocalABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.local[mapName]\n if (!storageMap) {\n throw new Error(`Local storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get a specific box storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getBoxABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.box[mapName]\n if (!storageMap) {\n throw new Error(`Box storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get all global storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getGlobalABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.global)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n\n/**\n * Get all local storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getLocalABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.local)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n\n/**\n * Get all box storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getBoxABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.box)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n"],"mappings":";;;;;;;;;;AA6TA,SAAS,mBAAmB,SAAiB,SAA2D;AAEtG,KAAI,YAAY,cAAc,YAAY,eAAe,YAAY,YACnE,QAAO;AAIT,KAAI,QAAQ,SACV,QAAO,cAAc,WAAW,SAAS,QAAQ;AAInD,KAAI;AACF,SAAO,QAAQ,KAAK,QAAQ;UACrB,OAAO;AACd,QAAM,IAAI,MAAM,iCAAiC,QAAQ,KAAK,QAAQ;;;;;;;;;AAU1E,SAAS,kBAAkB,YAAwB,SAAuD;CACxG,MAAM,UAAU,mBAAmB,WAAW,SAAS,QAAQ;CAC/D,MAAM,YAAY,mBAAmB,WAAW,WAAW,QAAQ;AAEnE,QAAO;EACL,KAAK,WAAW;EAChB;EACA;EACA,MAAM,WAAW;EAClB;;;;;;;;AASH,SAAS,kBAAkB,YAAwB,SAAuD;AAIxG,QAAO;EACL,SAJc,mBAAmB,WAAW,SAAS,QAAQ;EAK7D,WAJgB,mBAAmB,WAAW,WAAW,QAAQ;EAKjE,MAAM,WAAW;EACjB,QAAQ,WAAW;EACpB;;;;;;;;;AAUH,SAAgB,uBAAuB,UAAyB,SAAgC;CAC9F,MAAM,aAAa,SAAS,MAAM,KAAK,OAAO;AAC9C,KAAI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packages/abi/src/arc56-contract.ts"],"sourcesContent":["/****************/\n/** ARC-56 spec */\n/****************/\n\nimport { ABIStructType, ABIType } from './abi-type'\n\n/** Describes a single key in app storage with parsed ABI types */\nexport type ABIStorageKey = {\n /** The bytes of the key encoded as base64 */\n key: string\n /** The parsed type of the key (ABI type or AVM type) */\n keyType: ABIType | AVMType\n /** The parsed type of the value (ABI type or AVM type) */\n valueType: ABIType | AVMType\n /** Description of what this storage key holds */\n desc?: string\n}\n\n/** Describes a storage map with parsed ABI types */\nexport type ABIStorageMap = {\n /** The parsed type of the keys in the map (ABI type or AVM type) */\n keyType: ABIType | AVMType\n /** The parsed type of the values in the map (ABI type or AVM type) */\n valueType: ABIType | AVMType\n /** Description of what the key-value pairs in this mapping hold */\n desc?: string\n /** The base64-encoded prefix of the map keys */\n prefix?: string\n}\n\n/** Describes the entire contract. This type is an extension of the type described in ARC-4 */\nexport type Arc56Contract = {\n /** The ARCs used and/or supported by this contract. All contracts implicitly support ARC4 and ARC56 */\n arcs: number[]\n /** A user-friendly name for the contract */\n name: string\n /** Optional, user-friendly description for the type */\n desc?: string\n /**\n * Optional object listing the contract instances across different networks.\n * The key is the base64 genesis hash of the network, and the value contains\n * information about the deployed contract in the network indicated by the\n * key. A key containing the human-readable name of the network MAY be\n * included, but the corresponding genesis hash key MUST also be defined\n */\n networks?: {\n [network: string]: {\n /** The app ID of the deployed contract in this network */\n appID: number\n }\n }\n /** Named structs used by the application. Each struct field appears in the same order as ABI encoding. */\n structs: { [structName: StructName]: StructField[] }\n /** All of the methods that the contract implements */\n methods: Arc56Method[]\n state: {\n /** Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application */\n schema: {\n global: {\n ints: number\n bytes: number\n }\n local: {\n ints: number\n bytes: number\n }\n }\n /** Mapping of human-readable names to StorageKey objects */\n keys: {\n global: { [name: string]: StorageKey }\n local: { [name: string]: StorageKey }\n box: { [name: string]: StorageKey }\n }\n /** Mapping of human-readable names to StorageMap objects */\n maps: {\n global: { [name: string]: StorageMap }\n local: { [name: string]: StorageMap }\n box: { [name: string]: StorageMap }\n }\n }\n /** Supported bare actions for the contract. An action is a combination of call/create and an OnComplete */\n bareActions: {\n /** OnCompletes this method allows when appID === 0 */\n create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]\n /** OnCompletes this method allows when appID !== 0 */\n call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[]\n }\n /** Information about the TEAL programs */\n sourceInfo?: {\n /** Approval program information */\n approval: ProgramSourceInfo\n /** Clear program information */\n clear: ProgramSourceInfo\n }\n /** The pre-compiled TEAL that may contain template variables. MUST be omitted if included as part of ARC23 */\n source?: {\n /** The approval program */\n approval: string\n /** The clear program */\n clear: string\n }\n /** The compiled bytecode for the application. MUST be omitted if included as part of ARC23 */\n byteCode?: {\n /** The approval program */\n approval: string\n /** The clear program */\n clear: string\n }\n /** Information used to get the given byteCode and/or PC values in sourceInfo. MUST be given if byteCode or PC values are present */\n compilerInfo?: {\n /** The name of the compiler */\n compiler: 'algod' | 'puya'\n /** Compiler version information */\n compilerVersion: {\n major: number\n minor: number\n patch: number\n commitHash?: string\n }\n }\n /** ARC-28 events that MAY be emitted by this contract */\n events?: Array<Event>\n /** A mapping of template variable names as they appear in the TEAL (not including TMPL_ prefix) to their respective types and values (if applicable) */\n templateVariables?: {\n [name: string]: {\n /** The type of the template variable */\n type: ABITypeName | AVMType | StructName\n /** If given, the base64 encoded value used for the given app/program */\n value?: string\n }\n }\n /** The scratch variables used during runtime */\n scratchVariables?: {\n [name: string]: {\n slot: number\n type: ABITypeName | AVMType | StructName\n }\n }\n}\n\n/** Describes a method in the contract. This type is an extension of the type described in ARC-4 */\nexport type Arc56Method = {\n /** The name of the method */\n name: string\n /** Optional, user-friendly description for the method */\n desc?: string\n /** The arguments of the method, in order */\n args: Array<{\n /** The type of the argument. The `struct` field should also be checked to determine if this arg is a struct. */\n type: ABITypeName\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n /** Optional, user-friendly name for the argument */\n name?: string\n /** Optional, user-friendly description for the argument */\n desc?: string\n /** The default value that clients should use. */\n defaultValue?: {\n /** Base64 encoded bytes, base64 ARC4 encoded uint64, or UTF-8 method selector */\n data: string\n /** How the data is encoded. This is the encoding for the data provided here, not the arg type */\n type?: ABITypeName | AVMType\n /** Where the default value is coming from\n * - box: The data key signifies the box key to read the value from\n * - global: The data key signifies the global state key to read the value from\n * - local: The data key signifies the local state key to read the value from (for the sender)\n * - literal: the value is a literal and should be passed directly as the argument\n * - method: The utf8 signature of the method in this contract to call to get the default value. If the method has arguments, they all must have default values. The method **MUST** be readonly so simulate can be used to get the default value\n */\n source: 'box' | 'global' | 'local' | 'literal' | 'method'\n }\n }>\n /** Information about the method's return value */\n returns: {\n /** The type of the return value, or \"void\" to indicate no return value. The `struct` field should also be checked to determine if this return value is a struct. */\n type: ABITypeName\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n /** Optional, user-friendly description for the return value */\n desc?: string\n }\n /** an action is a combination of call/create and an OnComplete */\n actions: {\n /** OnCompletes this method allows when appID === 0 */\n create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]\n /** OnCompletes this method allows when appID !== 0 */\n call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[]\n }\n /** If this method does not write anything to the ledger (ARC-22) */\n readonly?: boolean\n /** ARC-28 events that MAY be emitted by this method */\n events?: Array<Event>\n /** Information that clients can use when calling the method */\n recommendations?: {\n /** The number of inner transactions the caller should cover the fees for */\n innerTransactionCount?: number\n /** Recommended box references to include */\n boxes?: {\n /** The app ID for the box */\n app?: number\n /** The base64 encoded box key */\n key: string\n /** The number of bytes being read from the box */\n readBytes: number\n /** The number of bytes being written to the box */\n writeBytes: number\n }\n /** Recommended foreign accounts */\n accounts?: string[]\n /** Recommended foreign apps */\n apps?: number[]\n /** Recommended foreign assets */\n assets?: number[]\n }\n}\n\n/** ARC-28 event */\nexport type Event = {\n /** The name of the event */\n name: string\n /** Optional, user-friendly description for the event */\n desc?: string\n /** The arguments of the event, in order */\n args: Array<{\n /** The type of the argument. The `struct` field should also be checked to determine if this arg is a struct. */\n type: ABITypeName\n /** Optional, user-friendly name for the argument */\n name?: string\n /** Optional, user-friendly description for the argument */\n desc?: string\n /** If the type is a struct, the name of the struct */\n struct?: StructName\n }>\n}\n\n/** An ABI-encoded type */\nexport type ABITypeName = string\n\n/** The name of a defined struct */\nexport type StructName = string\n\n/** Raw byteslice without the length prefixed that is specified in ARC-4 */\nexport type AVMBytes = 'AVMBytes'\n\n/** A utf-8 string without the length prefix that is specified in ARC-4 */\nexport type AVMString = 'AVMString'\n\n/** A 64-bit unsigned integer */\nexport type AVMUint64 = 'AVMUint64'\n\n/** A native AVM type */\nexport type AVMType = AVMBytes | AVMString | AVMUint64\n\n/** Information about a single field in a struct */\nexport type StructField = {\n /** The name of the struct field */\n name: string\n /** The type of the struct field's value */\n type: ABITypeName | StructName | StructField[]\n}\n\n/** Describes a single key in app storage */\nexport type StorageKey = {\n /** Description of what this storage key holds */\n desc?: string\n /** The type of the key */\n keyType: ABITypeName | AVMType | StructName\n\n /** The type of the value */\n valueType: ABITypeName | AVMType | StructName\n /** The bytes of the key encoded as base64 */\n key: string\n}\n\n/** Describes a mapping of key-value pairs in storage */\nexport type StorageMap = {\n /** Description of what the key-value pairs in this mapping hold */\n desc?: string\n /** The type of the keys in the map */\n keyType: ABITypeName | AVMType | StructName\n /** The type of the values in the map */\n valueType: ABITypeName | AVMType | StructName\n /** The base64-encoded prefix of the map keys*/\n prefix?: string\n}\n\ntype SourceInfo = {\n /** The program counter value(s). Could be offset if pcOffsetMethod is not \"none\" */\n pc: Array<number>\n /** A human-readable string that describes the error when the program fails at the given PC */\n errorMessage?: string\n /** The TEAL line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients */\n teal?: number\n /** The original source file and line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients */\n source?: string\n}\n\nexport type ProgramSourceInfo = {\n /** The source information for the program */\n sourceInfo: SourceInfo[]\n /** How the program counter offset is calculated\n * - none: The pc values in sourceInfo are not offset\n * - cblocks: The pc values in sourceInfo are offset by the PC of the first op following the last cblock at the top of the program\n */\n pcOffsetMethod: 'none' | 'cblocks'\n}\n\n/*************************/\n/** Storage Helper Functions */\n/*************************/\n\n/**\n * Resolves a storage type string (ABI type, AVM type, or struct name) into an ABIType or AVMType\n * @param typeStr The type string to resolve\n * @param structs The structs defined in the contract\n * @returns The parsed ABIType or AVMType string\n */\nfunction resolveStorageType(typeStr: string, structs: Record<string, StructField[]>): ABIType | AVMType {\n // Check if it's an AVM type\n if (typeStr === 'AVMBytes' || typeStr === 'AVMString' || typeStr === 'AVMUint64') {\n return typeStr as AVMType\n }\n\n // Check if it's a struct type\n if (structs[typeStr]) {\n return ABIStructType.fromStruct(typeStr, structs)\n }\n\n // Otherwise parse as ABI type\n try {\n return ABIType.from(typeStr)\n } catch (error) {\n throw new Error(`Failed to parse storage type '${typeStr}': ${error}`)\n }\n}\n\n/**\n * Converts a StorageKey to an ABIStorageKey with parsed types\n * @param storageKey The storage key to convert\n * @param structs The structs defined in the contract\n * @returns The converted ABIStorageKey\n */\nfunction convertStorageKey(storageKey: StorageKey, structs: Record<string, StructField[]>): ABIStorageKey {\n const keyType = resolveStorageType(storageKey.keyType, structs)\n const valueType = resolveStorageType(storageKey.valueType, structs)\n\n return {\n key: storageKey.key,\n keyType,\n valueType,\n desc: storageKey.desc,\n }\n}\n\n/**\n * Converts a StorageMap to an ABIStorageMap with parsed types\n * @param storageMap The storage map to convert\n * @param structs The structs defined in the contract\n * @returns The converted ABIStorageMap\n */\nfunction convertStorageMap(storageMap: StorageMap, structs: Record<string, StructField[]>): ABIStorageMap {\n const keyType = resolveStorageType(storageMap.keyType, structs)\n const valueType = resolveStorageType(storageMap.valueType, structs)\n\n return {\n keyType,\n valueType,\n desc: storageMap.desc,\n prefix: storageMap.prefix,\n }\n}\n\n/**\n * Get a specific global storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getGlobalABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.global[keyName]\n if (!storageKey) {\n throw new Error(`Global storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get a specific local storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getLocalABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.local[keyName]\n if (!storageKey) {\n throw new Error(`Local storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get a specific box storage key with parsed ABI types\n * @param contract The ARC-56 contract\n * @param keyName The name of the storage key\n * @returns The ABIStorageKey with parsed types\n * @throws Error if the key is not found\n */\nexport function getBoxABIStorageKey(contract: Arc56Contract, keyName: string): ABIStorageKey {\n const storageKey = contract.state.keys.box[keyName]\n if (!storageKey) {\n throw new Error(`Box storage key '${keyName}' not found in contract '${contract.name}'`)\n }\n return convertStorageKey(storageKey, contract.structs)\n}\n\n/**\n * Get all global storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getGlobalABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.global)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get all local storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getLocalABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.local)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get all box storage keys with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage key names to ABIStorageKey objects\n */\nexport function getBoxABIStorageKeys(contract: Arc56Contract): Record<string, ABIStorageKey> {\n const result: Record<string, ABIStorageKey> = {}\n for (const [name, storageKey] of Object.entries(contract.state.keys.box)) {\n result[name] = convertStorageKey(storageKey, contract.structs)\n }\n return result\n}\n\n/**\n * Get a specific global storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getGlobalABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.global[mapName]\n if (!storageMap) {\n throw new Error(`Global storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get a specific local storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getLocalABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.local[mapName]\n if (!storageMap) {\n throw new Error(`Local storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get a specific box storage map with parsed ABI types\n * @param contract The ARC-56 contract\n * @param mapName The name of the storage map\n * @returns The ABIStorageMap with parsed types\n * @throws Error if the map is not found\n */\nexport function getBoxABIStorageMap(contract: Arc56Contract, mapName: string): ABIStorageMap {\n const storageMap = contract.state.maps.box[mapName]\n if (!storageMap) {\n throw new Error(`Box storage map '${mapName}' not found in contract '${contract.name}'`)\n }\n return convertStorageMap(storageMap, contract.structs)\n}\n\n/**\n * Get all global storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getGlobalABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.global)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n\n/**\n * Get all local storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getLocalABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.local)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n\n/**\n * Get all box storage maps with parsed ABI types\n * @param contract The ARC-56 contract\n * @returns A record of storage map names to ABIStorageMap objects\n */\nexport function getBoxABIStorageMaps(contract: Arc56Contract): Record<string, ABIStorageMap> {\n const result: Record<string, ABIStorageMap> = {}\n for (const [name, storageMap] of Object.entries(contract.state.maps.box)) {\n result[name] = convertStorageMap(storageMap, contract.structs)\n }\n return result\n}\n"],"mappings":";;;;;;;;;;;AA6TA,SAAS,mBAAmB,SAAiB,SAA2D;AAEtG,KAAI,YAAY,cAAc,YAAY,eAAe,YAAY,YACnE,QAAO;AAIT,KAAI,QAAQ,SACV,QAAO,cAAc,WAAW,SAAS,QAAQ;AAInD,KAAI;AACF,SAAO,QAAQ,KAAK,QAAQ;UACrB,OAAO;AACd,QAAM,IAAI,MAAM,iCAAiC,QAAQ,KAAK,QAAQ;;;;;;;;;AAU1E,SAAS,kBAAkB,YAAwB,SAAuD;CACxG,MAAM,UAAU,mBAAmB,WAAW,SAAS,QAAQ;CAC/D,MAAM,YAAY,mBAAmB,WAAW,WAAW,QAAQ;AAEnE,QAAO;EACL,KAAK,WAAW;EAChB;EACA;EACA,MAAM,WAAW;EAClB;;;;;;;;AASH,SAAS,kBAAkB,YAAwB,S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F,MAAMA,SAAwC,EAAE;AAChD,MAAK,MAAM,CAAC,MAAM,eAAe,OAAO,QAAQ,SAAS,MAAM,KAAK,IAAI,CACtE,QAAO,QAAQ,kBAAkB,YAAY,SAAS,QAAQ;AAEhE,QAAO"}
@@ -52,84 +52,66 @@ declare class AlgodApi {
52
52
  /**
53
53
  * Given an application ID and box name, it returns the round, box name, and value (each base64 encoded). Box names must be in the goal app call arg encoding form 'encoding:value'. For ints, use the form 'int:1234'. For raw bytes, use the form 'b64:A=='. For printable strings, use the form 'str:hello'. For addresses, use the form 'addr:XYZ...'.
54
54
  */
55
- private _getApplicationBoxByName;
55
+ private _applicationBoxByName;
56
56
  /**
57
57
  * Given an application ID, return all Box names. No particular ordering is guaranteed. Request fails when client or server-side configured limits prevent returning all Box names.
58
58
  */
59
- getApplicationBoxes(applicationId: number | bigint, params?: {
59
+ applicationBoxes(applicationId: number | bigint, params?: {
60
60
  max?: number;
61
61
  }): Promise<BoxesResponse>;
62
62
  /**
63
63
  * Given a application ID, it returns application information including creator, approval and clear programs, global and local schemas, and global state.
64
64
  */
65
- getApplicationById(applicationId: number | bigint): Promise<Application>;
65
+ applicationById(applicationId: number | bigint): Promise<Application>;
66
66
  /**
67
67
  * Given a asset ID, it returns asset information including creator, name, total supply and special addresses.
68
68
  */
69
- getAssetById(assetId: number | bigint): Promise<Asset>;
70
- getBlock(round: number | bigint, params?: {
69
+ assetById(assetId: number | bigint): Promise<Asset>;
70
+ block(round: number | bigint, params?: {
71
71
  headerOnly?: boolean;
72
72
  }): Promise<BlockResponse>;
73
- getBlockHash(round: number | bigint): Promise<BlockHashResponse>;
73
+ blockHash(round: number | bigint): Promise<BlockHashResponse>;
74
74
  /**
75
75
  * Gets the current timestamp offset.
76
76
  */
77
- getBlockTimeStampOffset(): Promise<GetBlockTimeStampOffsetResponse>;
78
- getBlockTxIds(round: number | bigint): Promise<BlockTxidsResponse>;
77
+ blockTimeStampOffset(): Promise<GetBlockTimeStampOffsetResponse>;
78
+ blockTxIds(round: number | bigint): Promise<BlockTxidsResponse>;
79
79
  /**
80
80
  * Returns the entire genesis file in json.
81
81
  */
82
- getGenesis(): Promise<Genesis>;
82
+ genesis(): Promise<Genesis>;
83
+ healthCheck(): Promise<void>;
83
84
  /**
84
85
  * Get ledger deltas for a round.
85
86
  */
86
- getLedgerStateDelta(round: number | bigint): Promise<LedgerStateDelta>;
87
+ ledgerStateDelta(round: number | bigint): Promise<LedgerStateDelta>;
87
88
  /**
88
89
  * Get a ledger delta for a given transaction group.
89
90
  */
90
- getLedgerStateDeltaForTransactionGroup(id: string): Promise<LedgerStateDelta>;
91
- getLightBlockHeaderProof(round: number | bigint): Promise<LightBlockHeaderProof>;
91
+ ledgerStateDeltaForTransactionGroup(id: string): Promise<LedgerStateDelta>;
92
+ lightBlockHeaderProof(round: number | bigint): Promise<LightBlockHeaderProof>;
93
+ /**
94
+ * Given a transaction ID of a recently submitted transaction, it returns information about it. There are several cases when this might succeed:
95
+ * - transaction committed (committed round > 0)
96
+ * - transaction still in the pool (committed round = 0, pool error = "")
97
+ * - transaction removed from pool due to error (committed round = 0, pool error != "")
98
+ * Or the transaction may have happened sufficiently long ago that the node no longer remembers it, and this will return an error.
99
+ */
100
+ pendingTransactionInformation(txId: string): Promise<PendingTransactionResponse>;
92
101
  /**
93
102
  * Get the list of pending transactions, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.
94
103
  */
95
- getPendingTransactions(params?: {
104
+ pendingTransactions(params?: {
96
105
  max?: number;
97
106
  }): Promise<PendingTransactionsResponse>;
98
107
  /**
99
108
  * Get the list of pending transactions by address, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.
100
109
  */
101
- getPendingTransactionsByAddress(address: ReadableAddress, params?: {
110
+ pendingTransactionsByAddress(address: ReadableAddress, params?: {
102
111
  max?: number;
103
112
  }): Promise<PendingTransactionsResponse>;
104
- getReady(): Promise<void>;
105
- getStateProof(round: number | bigint): Promise<StateProof>;
106
- getStatus(): Promise<NodeStatusResponse>;
107
- getSupply(): Promise<SupplyResponse>;
108
- /**
109
- * Gets the minimum sync round for the ledger.
110
- */
111
- getSyncRound(): Promise<GetSyncRoundResponse>;
112
- /**
113
- * Get ledger deltas for transaction groups in a given round.
114
- */
115
- getTransactionGroupLedgerStateDeltasForRound(round: number | bigint): Promise<TransactionGroupLedgerStateDeltasForRoundResponse>;
116
- getTransactionProof(round: number | bigint, txId: string, params?: {
117
- hashtype?: 'sha512_256' | 'sha256';
118
- }): Promise<TransactionProof>;
119
- /**
120
- * Retrieves the supported API versions, binary build versions, and genesis information.
121
- */
122
- getVersion(): Promise<Version>;
123
- healthCheck(): Promise<void>;
124
- /**
125
- * Given a transaction ID of a recently submitted transaction, it returns information about it. There are several cases when this might succeed:
126
- * - transaction committed (committed round > 0)
127
- * - transaction still in the pool (committed round = 0, pool error = "")
128
- * - transaction removed from pool due to error (committed round = 0, pool error != "")
129
- * Or the transaction may have happened sufficiently long ago that the node no longer remembers it, and this will return an error.
130
- */
131
- pendingTransactionInformation(txId: string): Promise<PendingTransactionResponse>;
132
113
  private _rawTransaction;
114
+ ready(): Promise<void>;
133
115
  /**
134
116
  * Sets the timestamp offset (seconds) for blocks in dev mode. Providing an offset of 0 will unset this value and try to use the real clock for the timestamp.
135
117
  */
@@ -139,10 +121,17 @@ declare class AlgodApi {
139
121
  */
140
122
  setSyncRound(round: number | bigint): Promise<void>;
141
123
  simulateTransactions(body: SimulateRequest): Promise<SimulateResponse>;
124
+ stateProof(round: number | bigint): Promise<StateProof>;
125
+ status(): Promise<NodeStatusResponse>;
142
126
  /**
143
127
  * Waits for a block to appear after round {round} and returns the node's status at the time. There is a 1 minute timeout, when reached the current status is returned regardless of whether or not it is the round after the given round.
144
128
  */
145
129
  statusAfterBlock(round: number | bigint): Promise<NodeStatusResponse>;
130
+ supply(): Promise<SupplyResponse>;
131
+ /**
132
+ * Gets the minimum sync round for the ledger.
133
+ */
134
+ syncRound(): Promise<GetSyncRoundResponse>;
146
135
  /**
147
136
  * Given TEAL source code in plain text, return base64 encoded program bytes and base32 SHA512_256 hash of program bytes (Address style). This endpoint is only enabled when a node's configuration file sets EnableDeveloperAPI to true.
148
137
  */
@@ -153,11 +142,22 @@ declare class AlgodApi {
153
142
  * Given the program bytes, return the TEAL source code in plain text. This endpoint is only enabled when a node's configuration file sets EnableDeveloperAPI to true.
154
143
  */
155
144
  tealDisassemble(body: Uint8Array): Promise<DisassembleResponse>;
145
+ /**
146
+ * Get ledger deltas for transaction groups in a given round.
147
+ */
148
+ transactionGroupLedgerStateDeltasForRound(round: number | bigint): Promise<TransactionGroupLedgerStateDeltasForRoundResponse>;
156
149
  private _transactionParams;
150
+ transactionProof(round: number | bigint, txId: string, params?: {
151
+ hashtype?: 'sha512_256' | 'sha256';
152
+ }): Promise<TransactionProof>;
157
153
  /**
158
154
  * Unset the ledger sync round.
159
155
  */
160
156
  unsetSyncRound(): Promise<void>;
157
+ /**
158
+ * Retrieves the supported API versions, binary build versions, and genesis information.
159
+ */
160
+ version(): Promise<Version>;
161
161
  /**
162
162
  * Send a signed transaction or array of signed transactions to the network.
163
163
  */
@@ -165,7 +165,7 @@ declare class AlgodApi {
165
165
  /**
166
166
  * Given an application ID and box name, it returns the round, box name, and value.
167
167
  */
168
- getApplicationBoxByName(applicationId: number | bigint, boxName: Uint8Array): Promise<Box>;
168
+ applicationBoxByName(applicationId: number | bigint, boxName: Uint8Array): Promise<Box>;
169
169
  /**
170
170
  * Returns the common needed parameters for a new transaction.
171
171
  */
@@ -173,7 +173,7 @@ declare class AlgodApi {
173
173
  /**
174
174
  * Returns the common needed parameters for a new transaction.
175
175
  */
176
- getTransactionParams(): Promise<SuggestedParams>;
176
+ transactionParams(): Promise<SuggestedParams>;
177
177
  /**
178
178
  * Simulate an encoded signed transaction or array of encoded signed transactions.
179
179
  */