@aptos-labs/ts-sdk 5.2.0 → 6.0.0

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 (333) hide show
  1. package/README.md +18 -0
  2. package/dist/common/{account-DvGDel4s.d.ts → account-Dpz_N9h-.d.ts} +225 -7
  3. package/dist/common/chunk-4RHBBU7C.js +4 -0
  4. package/dist/common/chunk-4RHBBU7C.js.map +1 -0
  5. package/dist/common/cli/index.d.ts +1 -1
  6. package/dist/common/cli/index.js +1 -1
  7. package/dist/common/cli/index.js.map +1 -1
  8. package/dist/common/index.d.ts +228 -28
  9. package/dist/common/index.js +39 -34
  10. package/dist/common/index.js.map +1 -1
  11. package/dist/esm/{Ed25519Account-C25CwEJi.d.mts → Ed25519Account-BW_kXHC2.d.mts} +1 -1
  12. package/dist/esm/account/AbstractKeylessAccount.d.mts +3 -3
  13. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  14. package/dist/esm/account/AbstractedAccount.d.mts +2 -2
  15. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  16. package/dist/esm/account/Account.d.mts +2 -2
  17. package/dist/esm/account/Account.mjs +1 -1
  18. package/dist/esm/account/AccountUtils.d.mts +3 -3
  19. package/dist/esm/account/AccountUtils.mjs +1 -1
  20. package/dist/esm/account/DerivableAbstractedAccount.d.mts +2 -2
  21. package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
  22. package/dist/esm/account/Ed25519Account.d.mts +2 -2
  23. package/dist/esm/account/Ed25519Account.mjs +1 -1
  24. package/dist/esm/account/EphemeralKeyPair.d.mts +1 -1
  25. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  26. package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
  27. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  28. package/dist/esm/account/KeylessAccount.d.mts +3 -3
  29. package/dist/esm/account/KeylessAccount.mjs +1 -1
  30. package/dist/esm/account/MultiEd25519Account.d.mts +2 -2
  31. package/dist/esm/account/MultiEd25519Account.mjs +1 -1
  32. package/dist/esm/account/MultiKeyAccount.d.mts +3 -3
  33. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  34. package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
  35. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  36. package/dist/esm/account/index.d.mts +3 -3
  37. package/dist/esm/account/index.mjs +1 -1
  38. package/dist/esm/account/utils.d.mts +1 -1
  39. package/dist/esm/account/utils.mjs +1 -1
  40. package/dist/esm/{account-Bwu9vUe3.d.mts → account-CcxnCdYZ.d.mts} +220 -7
  41. package/dist/esm/api/account/abstraction.d.mts +1 -1
  42. package/dist/esm/api/account/abstraction.mjs +1 -1
  43. package/dist/esm/api/account.d.mts +2 -2
  44. package/dist/esm/api/account.mjs +1 -1
  45. package/dist/esm/api/ans.d.mts +92 -26
  46. package/dist/esm/api/ans.mjs +1 -1
  47. package/dist/esm/api/aptos.d.mts +4 -3
  48. package/dist/esm/api/aptos.mjs +1 -1
  49. package/dist/esm/api/aptosConfig.d.mts +1 -1
  50. package/dist/esm/api/coin.d.mts +1 -1
  51. package/dist/esm/api/coin.mjs +1 -1
  52. package/dist/esm/api/digitalAsset.d.mts +2 -2
  53. package/dist/esm/api/digitalAsset.mjs +1 -1
  54. package/dist/esm/api/faucet.d.mts +1 -1
  55. package/dist/esm/api/faucet.mjs +1 -1
  56. package/dist/esm/api/fungibleAsset.d.mts +2 -2
  57. package/dist/esm/api/fungibleAsset.mjs +1 -1
  58. package/dist/esm/api/general.d.mts +1 -1
  59. package/dist/esm/api/general.mjs +1 -1
  60. package/dist/esm/api/index.d.mts +4 -3
  61. package/dist/esm/api/index.mjs +1 -1
  62. package/dist/esm/api/keyless.d.mts +3 -3
  63. package/dist/esm/api/keyless.mjs +1 -1
  64. package/dist/esm/api/object.d.mts +1 -1
  65. package/dist/esm/api/object.mjs +1 -1
  66. package/dist/esm/api/staking.d.mts +1 -1
  67. package/dist/esm/api/staking.mjs +1 -1
  68. package/dist/esm/api/table.d.mts +1 -1
  69. package/dist/esm/api/table.mjs +1 -1
  70. package/dist/esm/api/transaction.d.mts +2 -2
  71. package/dist/esm/api/transaction.mjs +1 -1
  72. package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
  73. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  74. package/dist/esm/api/transactionSubmission/helpers.d.mts +1 -1
  75. package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
  76. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  77. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  78. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  79. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  80. package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
  81. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  82. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  83. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  84. package/dist/esm/api/utils.d.mts +1 -1
  85. package/dist/esm/api/utils.mjs +1 -1
  86. package/dist/esm/bcs/consts.d.mts +1 -1
  87. package/dist/esm/bcs/deserializer.d.mts +1 -1
  88. package/dist/esm/bcs/index.d.mts +1 -1
  89. package/dist/esm/bcs/index.mjs +1 -1
  90. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
  91. package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
  92. package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
  93. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  94. package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
  95. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  96. package/dist/esm/bcs/serializer.d.mts +1 -1
  97. package/dist/esm/chunk-2DPQMXUG.mjs +4 -0
  98. package/dist/esm/chunk-2DPQMXUG.mjs.map +1 -0
  99. package/dist/esm/chunk-54C2P534.mjs +2 -0
  100. package/dist/esm/chunk-54C2P534.mjs.map +1 -0
  101. package/dist/esm/{chunk-IKTH33UN.mjs → chunk-56IXVVXX.mjs} +2 -2
  102. package/dist/esm/{chunk-K2TQQFRV.mjs → chunk-76SVQZDX.mjs} +2 -2
  103. package/dist/esm/{chunk-A2G3V23K.mjs → chunk-BGZDJ5SM.mjs} +2 -2
  104. package/dist/esm/{chunk-TRIYATBI.mjs → chunk-CUXCVNES.mjs} +2 -2
  105. package/dist/esm/chunk-DE5K76I2.mjs +1 -0
  106. package/dist/esm/{chunk-UXUMXAUZ.mjs → chunk-F3NI6N7R.mjs} +2 -2
  107. package/dist/esm/chunk-FW6UHAQV.mjs +2 -0
  108. package/dist/esm/{chunk-VS5NYRHW.mjs.map → chunk-FW6UHAQV.mjs.map} +1 -1
  109. package/dist/esm/{chunk-J426EZGD.mjs → chunk-JN65XG2P.mjs} +2 -2
  110. package/dist/esm/{chunk-UL777LTI.mjs → chunk-LS2HRAVW.mjs} +24 -19
  111. package/dist/esm/chunk-LS2HRAVW.mjs.map +1 -0
  112. package/dist/esm/chunk-NK3Y3PV3.mjs +2 -0
  113. package/dist/esm/{chunk-5ABS6RDR.mjs.map → chunk-NK3Y3PV3.mjs.map} +1 -1
  114. package/dist/esm/chunk-NP2IAUME.mjs +2 -0
  115. package/dist/esm/chunk-NP2IAUME.mjs.map +1 -0
  116. package/dist/esm/{chunk-G2VFBYHG.mjs → chunk-NTLOKAPD.mjs} +2 -2
  117. package/dist/esm/{chunk-IFWE34P5.mjs → chunk-PXJEKGEG.mjs} +2 -2
  118. package/dist/esm/chunk-QEHKRR3I.mjs +2 -0
  119. package/dist/esm/chunk-QEHKRR3I.mjs.map +1 -0
  120. package/dist/esm/chunk-RQN6LA7E.mjs +2 -0
  121. package/dist/esm/{chunk-AEXYYFIZ.mjs.map → chunk-RQN6LA7E.mjs.map} +1 -1
  122. package/dist/esm/{chunk-HIAEKFG6.mjs → chunk-WZ6FL7CH.mjs} +2 -2
  123. package/dist/esm/{chunk-LND3GTJ3.mjs → chunk-X674XJNJ.mjs} +2 -2
  124. package/dist/esm/cli/index.d.mts +1 -1
  125. package/dist/esm/cli/index.mjs +1 -1
  126. package/dist/esm/cli/localNode.mjs +1 -1
  127. package/dist/esm/cli/move.d.mts +1 -1
  128. package/dist/esm/client/core.d.mts +1 -1
  129. package/dist/esm/client/core.mjs +1 -1
  130. package/dist/esm/client/get.d.mts +1 -1
  131. package/dist/esm/client/get.mjs +1 -1
  132. package/dist/esm/client/index.d.mts +1 -1
  133. package/dist/esm/client/index.mjs +1 -1
  134. package/dist/esm/client/post.d.mts +1 -1
  135. package/dist/esm/client/post.mjs +1 -1
  136. package/dist/esm/core/account/index.d.mts +1 -1
  137. package/dist/esm/core/account/index.mjs +1 -1
  138. package/dist/esm/core/account/utils/address.d.mts +1 -1
  139. package/dist/esm/core/account/utils/address.mjs +1 -1
  140. package/dist/esm/core/account/utils/index.d.mts +1 -1
  141. package/dist/esm/core/account/utils/index.mjs +1 -1
  142. package/dist/esm/core/accountAddress.d.mts +1 -1
  143. package/dist/esm/core/accountAddress.mjs +1 -1
  144. package/dist/esm/core/authenticationKey.d.mts +1 -1
  145. package/dist/esm/core/authenticationKey.mjs +1 -1
  146. package/dist/esm/core/crypto/abstraction.d.mts +1 -1
  147. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  148. package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
  149. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  150. package/dist/esm/core/crypto/ed25519.d.mts +1 -1
  151. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  152. package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
  153. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  154. package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
  155. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  156. package/dist/esm/core/crypto/index.d.mts +2 -2
  157. package/dist/esm/core/crypto/index.mjs +1 -1
  158. package/dist/esm/core/crypto/keyless.d.mts +2 -2
  159. package/dist/esm/core/crypto/keyless.mjs +1 -1
  160. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  161. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  162. package/dist/esm/core/crypto/multiKey.d.mts +1 -1
  163. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  164. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  165. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  166. package/dist/esm/core/crypto/proof.d.mts +1 -1
  167. package/dist/esm/core/crypto/proof.mjs +1 -1
  168. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  169. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  170. package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
  171. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  172. package/dist/esm/core/crypto/secp256r1.d.mts +1 -1
  173. package/dist/esm/core/crypto/secp256r1.mjs +1 -1
  174. package/dist/esm/core/crypto/signature.d.mts +1 -1
  175. package/dist/esm/core/crypto/signature.mjs +1 -1
  176. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  177. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  178. package/dist/esm/core/crypto/types.d.mts +1 -1
  179. package/dist/esm/core/crypto/utils.d.mts +1 -1
  180. package/dist/esm/core/crypto/utils.mjs +1 -1
  181. package/dist/esm/core/hex.d.mts +1 -1
  182. package/dist/esm/core/index.d.mts +2 -2
  183. package/dist/esm/core/index.mjs +1 -1
  184. package/dist/esm/errors/index.d.mts +1 -1
  185. package/dist/esm/errors/index.mjs +1 -1
  186. package/dist/esm/{federatedKeyless-BfOrG2BM.d.mts → federatedKeyless-BzaYmP03.d.mts} +1 -1
  187. package/dist/esm/index.d.mts +5 -4
  188. package/dist/esm/index.mjs +1 -1
  189. package/dist/esm/internal/abstraction.d.mts +1 -1
  190. package/dist/esm/internal/abstraction.mjs +1 -1
  191. package/dist/esm/internal/account.d.mts +2 -2
  192. package/dist/esm/internal/account.mjs +1 -1
  193. package/dist/esm/internal/ans.d.mts +85 -33
  194. package/dist/esm/internal/ans.mjs +1 -1
  195. package/dist/esm/internal/coin.d.mts +1 -1
  196. package/dist/esm/internal/coin.mjs +1 -1
  197. package/dist/esm/internal/digitalAsset.d.mts +2 -2
  198. package/dist/esm/internal/digitalAsset.mjs +1 -1
  199. package/dist/esm/internal/faucet.d.mts +1 -1
  200. package/dist/esm/internal/faucet.mjs +1 -1
  201. package/dist/esm/internal/fungibleAsset.d.mts +2 -2
  202. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  203. package/dist/esm/internal/general.d.mts +1 -1
  204. package/dist/esm/internal/general.mjs +1 -1
  205. package/dist/esm/internal/keyless.d.mts +3 -3
  206. package/dist/esm/internal/keyless.mjs +1 -1
  207. package/dist/esm/internal/object.d.mts +1 -1
  208. package/dist/esm/internal/object.mjs +1 -1
  209. package/dist/esm/internal/staking.d.mts +1 -1
  210. package/dist/esm/internal/staking.mjs +1 -1
  211. package/dist/esm/internal/table.d.mts +1 -1
  212. package/dist/esm/internal/table.mjs +1 -1
  213. package/dist/esm/internal/transaction.d.mts +1 -1
  214. package/dist/esm/internal/transaction.mjs +1 -1
  215. package/dist/esm/internal/transactionSubmission.d.mts +2 -2
  216. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  217. package/dist/esm/internal/utils/index.d.mts +1 -1
  218. package/dist/esm/internal/utils/index.mjs +1 -1
  219. package/dist/esm/internal/utils/utils.d.mts +1 -1
  220. package/dist/esm/internal/utils/utils.mjs +1 -1
  221. package/dist/esm/internal/view.d.mts +1 -1
  222. package/dist/esm/internal/view.mjs +1 -1
  223. package/dist/esm/transactions/authenticator/account.d.mts +1 -1
  224. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  225. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  226. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  227. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  228. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  229. package/dist/esm/transactions/index.d.mts +2 -2
  230. package/dist/esm/transactions/index.mjs +1 -1
  231. package/dist/esm/transactions/instances/chainId.d.mts +1 -1
  232. package/dist/esm/transactions/instances/identifier.d.mts +1 -1
  233. package/dist/esm/transactions/instances/index.d.mts +1 -1
  234. package/dist/esm/transactions/instances/index.mjs +1 -1
  235. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  236. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  237. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
  238. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  239. package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
  240. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  241. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  242. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  243. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  244. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  245. package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
  246. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  247. package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
  248. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  249. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  250. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
  251. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  252. package/dist/esm/transactions/management/index.d.mts +2 -2
  253. package/dist/esm/transactions/management/index.mjs +1 -1
  254. package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
  255. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  256. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +32 -2
  257. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  258. package/dist/esm/transactions/transactionBuilder/index.d.mts +2 -2
  259. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  260. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -1
  261. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  262. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
  263. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  264. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
  265. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  266. package/dist/esm/transactions/typeTag/index.d.mts +1 -1
  267. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  268. package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
  269. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  270. package/dist/esm/transactions/types.d.mts +1 -1
  271. package/dist/esm/types/ans.d.mts +109 -0
  272. package/dist/esm/types/ans.mjs +2 -0
  273. package/dist/esm/types/ans.mjs.map +1 -0
  274. package/dist/esm/types/generated/operations.d.mts +5 -0
  275. package/dist/esm/types/generated/queries.d.mts +27 -27
  276. package/dist/esm/types/generated/queries.mjs +1 -1
  277. package/dist/esm/types/generated/types.d.mts +191 -7
  278. package/dist/esm/types/generated/types.mjs +1 -1
  279. package/dist/esm/types/generated/types.mjs.map +1 -1
  280. package/dist/esm/types/index.d.mts +2 -1
  281. package/dist/esm/types/index.mjs +1 -1
  282. package/dist/esm/types/types.d.mts +1 -1
  283. package/dist/esm/types/types.mjs +1 -1
  284. package/dist/esm/utils/helpers.d.mts +1 -1
  285. package/dist/esm/utils/helpers.mjs +1 -1
  286. package/dist/esm/utils/index.d.mts +1 -1
  287. package/dist/esm/utils/index.mjs +1 -1
  288. package/dist/esm/utils/normalizeBundle.d.mts +1 -1
  289. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  290. package/dist/esm/version.d.mts +1 -1
  291. package/dist/esm/version.mjs +1 -1
  292. package/package.json +2 -2
  293. package/src/api/ans.ts +70 -25
  294. package/src/bcs/serializable/movePrimitives.ts +12 -14
  295. package/src/bcs/serializable/moveStructs.ts +205 -1
  296. package/src/internal/ans.ts +279 -109
  297. package/src/internal/queries/getNames.graphql +5 -0
  298. package/src/transactions/instances/transactionPayload.ts +27 -1
  299. package/src/transactions/transactionBuilder/helpers.ts +67 -1
  300. package/src/transactions/transactionBuilder/remoteAbi.ts +124 -1
  301. package/src/transactions/transactionBuilder/transactionBuilder.ts +4 -4
  302. package/src/transactions/types.ts +20 -2
  303. package/src/types/ans.ts +110 -0
  304. package/src/types/generated/operations.ts +1 -0
  305. package/src/types/generated/queries.ts +163 -76
  306. package/src/types/generated/types.ts +216 -6
  307. package/src/types/index.ts +1 -0
  308. package/src/types/types.ts +58 -0
  309. package/src/version.ts +1 -1
  310. package/dist/common/chunk-JQCMXTY7.js +0 -4
  311. package/dist/common/chunk-JQCMXTY7.js.map +0 -1
  312. package/dist/esm/chunk-5ABS6RDR.mjs +0 -2
  313. package/dist/esm/chunk-6XLLQB5P.mjs +0 -2
  314. package/dist/esm/chunk-6XLLQB5P.mjs.map +0 -1
  315. package/dist/esm/chunk-76PXED26.mjs +0 -4
  316. package/dist/esm/chunk-76PXED26.mjs.map +0 -1
  317. package/dist/esm/chunk-AEXYYFIZ.mjs +0 -2
  318. package/dist/esm/chunk-BIQOJ3OK.mjs +0 -2
  319. package/dist/esm/chunk-BIQOJ3OK.mjs.map +0 -1
  320. package/dist/esm/chunk-FD6FGKYY.mjs +0 -1
  321. package/dist/esm/chunk-UL777LTI.mjs.map +0 -1
  322. package/dist/esm/chunk-VS5NYRHW.mjs +0 -2
  323. /package/dist/esm/{chunk-IKTH33UN.mjs.map → chunk-56IXVVXX.mjs.map} +0 -0
  324. /package/dist/esm/{chunk-K2TQQFRV.mjs.map → chunk-76SVQZDX.mjs.map} +0 -0
  325. /package/dist/esm/{chunk-A2G3V23K.mjs.map → chunk-BGZDJ5SM.mjs.map} +0 -0
  326. /package/dist/esm/{chunk-TRIYATBI.mjs.map → chunk-CUXCVNES.mjs.map} +0 -0
  327. /package/dist/esm/{chunk-FD6FGKYY.mjs.map → chunk-DE5K76I2.mjs.map} +0 -0
  328. /package/dist/esm/{chunk-UXUMXAUZ.mjs.map → chunk-F3NI6N7R.mjs.map} +0 -0
  329. /package/dist/esm/{chunk-J426EZGD.mjs.map → chunk-JN65XG2P.mjs.map} +0 -0
  330. /package/dist/esm/{chunk-G2VFBYHG.mjs.map → chunk-NTLOKAPD.mjs.map} +0 -0
  331. /package/dist/esm/{chunk-IFWE34P5.mjs.map → chunk-PXJEKGEG.mjs.map} +0 -0
  332. /package/dist/esm/{chunk-HIAEKFG6.mjs.map → chunk-WZ6FL7CH.mjs.map} +0 -0
  333. /package/dist/esm/{chunk-LND3GTJ3.mjs.map → chunk-X674XJNJ.mjs.map} +0 -0
@@ -1658,6 +1658,73 @@ export type CoinInfosStreamCursorValueInput = {
1658
1658
  transaction_version_created?: InputMaybe<Scalars["bigint"]["input"]>;
1659
1659
  };
1660
1660
 
1661
+ /** columns and relationships of "coin_supply" */
1662
+ export type CoinSupply = {
1663
+ coin_type: Scalars["String"]["output"];
1664
+ coin_type_hash: Scalars["String"]["output"];
1665
+ supply: Scalars["numeric"]["output"];
1666
+ transaction_epoch: Scalars["bigint"]["output"];
1667
+ transaction_timestamp: Scalars["timestamp"]["output"];
1668
+ transaction_version: Scalars["bigint"]["output"];
1669
+ };
1670
+
1671
+ /** Boolean expression to filter rows from the table "coin_supply". All fields are combined with a logical 'AND'. */
1672
+ export type CoinSupplyBoolExp = {
1673
+ _and?: InputMaybe<Array<CoinSupplyBoolExp>>;
1674
+ _not?: InputMaybe<CoinSupplyBoolExp>;
1675
+ _or?: InputMaybe<Array<CoinSupplyBoolExp>>;
1676
+ coin_type?: InputMaybe<StringComparisonExp>;
1677
+ coin_type_hash?: InputMaybe<StringComparisonExp>;
1678
+ supply?: InputMaybe<NumericComparisonExp>;
1679
+ transaction_epoch?: InputMaybe<BigintComparisonExp>;
1680
+ transaction_timestamp?: InputMaybe<TimestampComparisonExp>;
1681
+ transaction_version?: InputMaybe<BigintComparisonExp>;
1682
+ };
1683
+
1684
+ /** Ordering options when selecting data from "coin_supply". */
1685
+ export type CoinSupplyOrderBy = {
1686
+ coin_type?: InputMaybe<OrderBy>;
1687
+ coin_type_hash?: InputMaybe<OrderBy>;
1688
+ supply?: InputMaybe<OrderBy>;
1689
+ transaction_epoch?: InputMaybe<OrderBy>;
1690
+ transaction_timestamp?: InputMaybe<OrderBy>;
1691
+ transaction_version?: InputMaybe<OrderBy>;
1692
+ };
1693
+
1694
+ /** select columns of table "coin_supply" */
1695
+ export enum CoinSupplySelectColumn {
1696
+ /** column name */
1697
+ CoinType = "coin_type",
1698
+ /** column name */
1699
+ CoinTypeHash = "coin_type_hash",
1700
+ /** column name */
1701
+ Supply = "supply",
1702
+ /** column name */
1703
+ TransactionEpoch = "transaction_epoch",
1704
+ /** column name */
1705
+ TransactionTimestamp = "transaction_timestamp",
1706
+ /** column name */
1707
+ TransactionVersion = "transaction_version",
1708
+ }
1709
+
1710
+ /** Streaming cursor of the table "coin_supply" */
1711
+ export type CoinSupplyStreamCursorInput = {
1712
+ /** Stream column input with initial value */
1713
+ initial_value: CoinSupplyStreamCursorValueInput;
1714
+ /** cursor ordering */
1715
+ ordering?: InputMaybe<CursorOrdering>;
1716
+ };
1717
+
1718
+ /** Initial value of the column from where the streaming should start */
1719
+ export type CoinSupplyStreamCursorValueInput = {
1720
+ coin_type?: InputMaybe<Scalars["String"]["input"]>;
1721
+ coin_type_hash?: InputMaybe<Scalars["String"]["input"]>;
1722
+ supply?: InputMaybe<Scalars["numeric"]["input"]>;
1723
+ transaction_epoch?: InputMaybe<Scalars["bigint"]["input"]>;
1724
+ transaction_timestamp?: InputMaybe<Scalars["timestamp"]["input"]>;
1725
+ transaction_version?: InputMaybe<Scalars["bigint"]["input"]>;
1726
+ };
1727
+
1661
1728
  /** columns and relationships of "legacy_migration_v1.collection_datas" */
1662
1729
  export type CollectionDatas = {
1663
1730
  collection_data_id_hash?: Maybe<Scalars["String"]["output"]>;
@@ -6403,6 +6470,38 @@ export type PublicKeyAuthKeys = {
6403
6470
  signature_type: Scalars["String"]["output"];
6404
6471
  };
6405
6472
 
6473
+ /** aggregated selection of "public_key_auth_keys" */
6474
+ export type PublicKeyAuthKeysAggregate = {
6475
+ aggregate?: Maybe<PublicKeyAuthKeysAggregateFields>;
6476
+ nodes: Array<PublicKeyAuthKeys>;
6477
+ };
6478
+
6479
+ /** aggregate fields of "public_key_auth_keys" */
6480
+ export type PublicKeyAuthKeysAggregateFields = {
6481
+ avg?: Maybe<PublicKeyAuthKeysAvgFields>;
6482
+ count: Scalars["Int"]["output"];
6483
+ max?: Maybe<PublicKeyAuthKeysMaxFields>;
6484
+ min?: Maybe<PublicKeyAuthKeysMinFields>;
6485
+ stddev?: Maybe<PublicKeyAuthKeysStddevFields>;
6486
+ stddev_pop?: Maybe<PublicKeyAuthKeysStddevPopFields>;
6487
+ stddev_samp?: Maybe<PublicKeyAuthKeysStddevSampFields>;
6488
+ sum?: Maybe<PublicKeyAuthKeysSumFields>;
6489
+ var_pop?: Maybe<PublicKeyAuthKeysVarPopFields>;
6490
+ var_samp?: Maybe<PublicKeyAuthKeysVarSampFields>;
6491
+ variance?: Maybe<PublicKeyAuthKeysVarianceFields>;
6492
+ };
6493
+
6494
+ /** aggregate fields of "public_key_auth_keys" */
6495
+ export type PublicKeyAuthKeysAggregateFieldsCountArgs = {
6496
+ columns?: InputMaybe<Array<PublicKeyAuthKeysSelectColumn>>;
6497
+ distinct?: InputMaybe<Scalars["Boolean"]["input"]>;
6498
+ };
6499
+
6500
+ /** aggregate avg on columns */
6501
+ export type PublicKeyAuthKeysAvgFields = {
6502
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
6503
+ };
6504
+
6406
6505
  /** Boolean expression to filter rows from the table "public_key_auth_keys". All fields are combined with a logical 'AND'. */
6407
6506
  export type PublicKeyAuthKeysBoolExp = {
6408
6507
  _and?: InputMaybe<Array<PublicKeyAuthKeysBoolExp>>;
@@ -6417,6 +6516,26 @@ export type PublicKeyAuthKeysBoolExp = {
6417
6516
  signature_type?: InputMaybe<StringComparisonExp>;
6418
6517
  };
6419
6518
 
6519
+ /** aggregate max on columns */
6520
+ export type PublicKeyAuthKeysMaxFields = {
6521
+ account_public_key?: Maybe<Scalars["String"]["output"]>;
6522
+ auth_key?: Maybe<Scalars["String"]["output"]>;
6523
+ last_transaction_version?: Maybe<Scalars["bigint"]["output"]>;
6524
+ public_key?: Maybe<Scalars["String"]["output"]>;
6525
+ public_key_type?: Maybe<Scalars["String"]["output"]>;
6526
+ signature_type?: Maybe<Scalars["String"]["output"]>;
6527
+ };
6528
+
6529
+ /** aggregate min on columns */
6530
+ export type PublicKeyAuthKeysMinFields = {
6531
+ account_public_key?: Maybe<Scalars["String"]["output"]>;
6532
+ auth_key?: Maybe<Scalars["String"]["output"]>;
6533
+ last_transaction_version?: Maybe<Scalars["bigint"]["output"]>;
6534
+ public_key?: Maybe<Scalars["String"]["output"]>;
6535
+ public_key_type?: Maybe<Scalars["String"]["output"]>;
6536
+ signature_type?: Maybe<Scalars["String"]["output"]>;
6537
+ };
6538
+
6420
6539
  /** Ordering options when selecting data from "public_key_auth_keys". */
6421
6540
  export type PublicKeyAuthKeysOrderBy = {
6422
6541
  account_public_key?: InputMaybe<OrderBy>;
@@ -6446,6 +6565,21 @@ export enum PublicKeyAuthKeysSelectColumn {
6446
6565
  SignatureType = "signature_type",
6447
6566
  }
6448
6567
 
6568
+ /** aggregate stddev on columns */
6569
+ export type PublicKeyAuthKeysStddevFields = {
6570
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
6571
+ };
6572
+
6573
+ /** aggregate stddev_pop on columns */
6574
+ export type PublicKeyAuthKeysStddevPopFields = {
6575
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
6576
+ };
6577
+
6578
+ /** aggregate stddev_samp on columns */
6579
+ export type PublicKeyAuthKeysStddevSampFields = {
6580
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
6581
+ };
6582
+
6449
6583
  /** Streaming cursor of the table "public_key_auth_keys" */
6450
6584
  export type PublicKeyAuthKeysStreamCursorInput = {
6451
6585
  /** Stream column input with initial value */
@@ -6465,6 +6599,26 @@ export type PublicKeyAuthKeysStreamCursorValueInput = {
6465
6599
  signature_type?: InputMaybe<Scalars["String"]["input"]>;
6466
6600
  };
6467
6601
 
6602
+ /** aggregate sum on columns */
6603
+ export type PublicKeyAuthKeysSumFields = {
6604
+ last_transaction_version?: Maybe<Scalars["bigint"]["output"]>;
6605
+ };
6606
+
6607
+ /** aggregate var_pop on columns */
6608
+ export type PublicKeyAuthKeysVarPopFields = {
6609
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
6610
+ };
6611
+
6612
+ /** aggregate var_samp on columns */
6613
+ export type PublicKeyAuthKeysVarSampFields = {
6614
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
6615
+ };
6616
+
6617
+ /** aggregate variance on columns */
6618
+ export type PublicKeyAuthKeysVarianceFields = {
6619
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
6620
+ };
6621
+
6468
6622
  export type QueryRoot = {
6469
6623
  /** fetch data from the table: "account_transactions" */
6470
6624
  account_transactions: Array<AccountTransactions>;
@@ -6500,6 +6654,10 @@ export type QueryRoot = {
6500
6654
  coin_balances: Array<CoinBalances>;
6501
6655
  /** fetch data from the table: "legacy_migration_v1.coin_infos" */
6502
6656
  coin_infos: Array<CoinInfos>;
6657
+ /** fetch data from the table: "coin_supply" */
6658
+ coin_supply: Array<CoinSupply>;
6659
+ /** fetch data from the table: "coin_supply" using primary key columns */
6660
+ coin_supply_by_pk?: Maybe<CoinSupply>;
6503
6661
  /** fetch data from the table: "legacy_migration_v1.collection_datas" */
6504
6662
  collection_datas: Array<CollectionDatas>;
6505
6663
  /** fetch data from the table: "legacy_migration_v1.current_ans_lookup" */
@@ -6638,6 +6796,8 @@ export type QueryRoot = {
6638
6796
  proposal_votes_by_pk?: Maybe<ProposalVotes>;
6639
6797
  /** fetch data from the table: "public_key_auth_keys" */
6640
6798
  public_key_auth_keys: Array<PublicKeyAuthKeys>;
6799
+ /** fetch aggregated fields from the table: "public_key_auth_keys" */
6800
+ public_key_auth_keys_aggregate: PublicKeyAuthKeysAggregate;
6641
6801
  /** fetch data from the table: "public_key_auth_keys" using primary key columns */
6642
6802
  public_key_auth_keys_by_pk?: Maybe<PublicKeyAuthKeys>;
6643
6803
  /** fetch data from the table: "signatures" */
@@ -6799,6 +6959,19 @@ export type QueryRootCoinInfosArgs = {
6799
6959
  where?: InputMaybe<CoinInfosBoolExp>;
6800
6960
  };
6801
6961
 
6962
+ export type QueryRootCoinSupplyArgs = {
6963
+ distinct_on?: InputMaybe<Array<CoinSupplySelectColumn>>;
6964
+ limit?: InputMaybe<Scalars["Int"]["input"]>;
6965
+ offset?: InputMaybe<Scalars["Int"]["input"]>;
6966
+ order_by?: InputMaybe<Array<CoinSupplyOrderBy>>;
6967
+ where?: InputMaybe<CoinSupplyBoolExp>;
6968
+ };
6969
+
6970
+ export type QueryRootCoinSupplyByPkArgs = {
6971
+ coin_type_hash: Scalars["String"]["input"];
6972
+ transaction_version: Scalars["bigint"]["input"];
6973
+ };
6974
+
6802
6975
  export type QueryRootCollectionDatasArgs = {
6803
6976
  distinct_on?: InputMaybe<Array<CollectionDatasSelectColumn>>;
6804
6977
  limit?: InputMaybe<Scalars["Int"]["input"]>;
@@ -7274,6 +7447,14 @@ export type QueryRootPublicKeyAuthKeysArgs = {
7274
7447
  where?: InputMaybe<PublicKeyAuthKeysBoolExp>;
7275
7448
  };
7276
7449
 
7450
+ export type QueryRootPublicKeyAuthKeysAggregateArgs = {
7451
+ distinct_on?: InputMaybe<Array<PublicKeyAuthKeysSelectColumn>>;
7452
+ limit?: InputMaybe<Scalars["Int"]["input"]>;
7453
+ offset?: InputMaybe<Scalars["Int"]["input"]>;
7454
+ order_by?: InputMaybe<Array<PublicKeyAuthKeysOrderBy>>;
7455
+ where?: InputMaybe<PublicKeyAuthKeysBoolExp>;
7456
+ };
7457
+
7277
7458
  export type QueryRootPublicKeyAuthKeysByPkArgs = {
7278
7459
  auth_key: Scalars["String"]["input"];
7279
7460
  public_key: Scalars["String"]["input"];
@@ -7548,6 +7729,12 @@ export type SubscriptionRoot = {
7548
7729
  coin_infos: Array<CoinInfos>;
7549
7730
  /** fetch data from the table in a streaming manner: "legacy_migration_v1.coin_infos" */
7550
7731
  coin_infos_stream: Array<CoinInfos>;
7732
+ /** fetch data from the table: "coin_supply" */
7733
+ coin_supply: Array<CoinSupply>;
7734
+ /** fetch data from the table: "coin_supply" using primary key columns */
7735
+ coin_supply_by_pk?: Maybe<CoinSupply>;
7736
+ /** fetch data from the table in a streaming manner: "coin_supply" */
7737
+ coin_supply_stream: Array<CoinSupply>;
7551
7738
  /** fetch data from the table: "legacy_migration_v1.collection_datas" */
7552
7739
  collection_datas: Array<CollectionDatas>;
7553
7740
  /** fetch data from the table in a streaming manner: "legacy_migration_v1.collection_datas" */
@@ -7756,6 +7943,8 @@ export type SubscriptionRoot = {
7756
7943
  proposal_votes_stream: Array<ProposalVotes>;
7757
7944
  /** fetch data from the table: "public_key_auth_keys" */
7758
7945
  public_key_auth_keys: Array<PublicKeyAuthKeys>;
7946
+ /** fetch aggregated fields from the table: "public_key_auth_keys" */
7947
+ public_key_auth_keys_aggregate: PublicKeyAuthKeysAggregate;
7759
7948
  /** fetch data from the table: "public_key_auth_keys" using primary key columns */
7760
7949
  public_key_auth_keys_by_pk?: Maybe<PublicKeyAuthKeys>;
7761
7950
  /** fetch data from the table in a streaming manner: "public_key_auth_keys" */
@@ -7991,6 +8180,25 @@ export type SubscriptionRootCoinInfosStreamArgs = {
7991
8180
  where?: InputMaybe<CoinInfosBoolExp>;
7992
8181
  };
7993
8182
 
8183
+ export type SubscriptionRootCoinSupplyArgs = {
8184
+ distinct_on?: InputMaybe<Array<CoinSupplySelectColumn>>;
8185
+ limit?: InputMaybe<Scalars["Int"]["input"]>;
8186
+ offset?: InputMaybe<Scalars["Int"]["input"]>;
8187
+ order_by?: InputMaybe<Array<CoinSupplyOrderBy>>;
8188
+ where?: InputMaybe<CoinSupplyBoolExp>;
8189
+ };
8190
+
8191
+ export type SubscriptionRootCoinSupplyByPkArgs = {
8192
+ coin_type_hash: Scalars["String"]["input"];
8193
+ transaction_version: Scalars["bigint"]["input"];
8194
+ };
8195
+
8196
+ export type SubscriptionRootCoinSupplyStreamArgs = {
8197
+ batch_size: Scalars["Int"]["input"];
8198
+ cursor: Array<InputMaybe<CoinSupplyStreamCursorInput>>;
8199
+ where?: InputMaybe<CoinSupplyBoolExp>;
8200
+ };
8201
+
7994
8202
  export type SubscriptionRootCollectionDatasArgs = {
7995
8203
  distinct_on?: InputMaybe<Array<CollectionDatasSelectColumn>>;
7996
8204
  limit?: InputMaybe<Scalars["Int"]["input"]>;
@@ -8676,6 +8884,14 @@ export type SubscriptionRootPublicKeyAuthKeysArgs = {
8676
8884
  where?: InputMaybe<PublicKeyAuthKeysBoolExp>;
8677
8885
  };
8678
8886
 
8887
+ export type SubscriptionRootPublicKeyAuthKeysAggregateArgs = {
8888
+ distinct_on?: InputMaybe<Array<PublicKeyAuthKeysSelectColumn>>;
8889
+ limit?: InputMaybe<Scalars["Int"]["input"]>;
8890
+ offset?: InputMaybe<Scalars["Int"]["input"]>;
8891
+ order_by?: InputMaybe<Array<PublicKeyAuthKeysOrderBy>>;
8892
+ where?: InputMaybe<PublicKeyAuthKeysBoolExp>;
8893
+ };
8894
+
8679
8895
  export type SubscriptionRootPublicKeyAuthKeysByPkArgs = {
8680
8896
  auth_key: Scalars["String"]["input"];
8681
8897
  public_key: Scalars["String"]["input"];
@@ -10311,7 +10527,6 @@ export type UserTransactions = {
10311
10527
  gas_unit_price: Scalars["numeric"]["output"];
10312
10528
  max_gas_amount: Scalars["numeric"]["output"];
10313
10529
  parent_signature_type: Scalars["String"]["output"];
10314
- replay_protection_nonce?: Maybe<Scalars["numeric"]["output"]>;
10315
10530
  sender: Scalars["String"]["output"];
10316
10531
  sequence_number?: Maybe<Scalars["bigint"]["output"]>;
10317
10532
  timestamp: Scalars["timestamp"]["output"];
@@ -10333,7 +10548,6 @@ export type UserTransactionsBoolExp = {
10333
10548
  gas_unit_price?: InputMaybe<NumericComparisonExp>;
10334
10549
  max_gas_amount?: InputMaybe<NumericComparisonExp>;
10335
10550
  parent_signature_type?: InputMaybe<StringComparisonExp>;
10336
- replay_protection_nonce?: InputMaybe<NumericComparisonExp>;
10337
10551
  sender?: InputMaybe<StringComparisonExp>;
10338
10552
  sequence_number?: InputMaybe<BigintComparisonExp>;
10339
10553
  timestamp?: InputMaybe<TimestampComparisonExp>;
@@ -10352,7 +10566,6 @@ export type UserTransactionsOrderBy = {
10352
10566
  gas_unit_price?: InputMaybe<OrderBy>;
10353
10567
  max_gas_amount?: InputMaybe<OrderBy>;
10354
10568
  parent_signature_type?: InputMaybe<OrderBy>;
10355
- replay_protection_nonce?: InputMaybe<OrderBy>;
10356
10569
  sender?: InputMaybe<OrderBy>;
10357
10570
  sequence_number?: InputMaybe<OrderBy>;
10358
10571
  timestamp?: InputMaybe<OrderBy>;
@@ -10382,8 +10595,6 @@ export enum UserTransactionsSelectColumn {
10382
10595
  /** column name */
10383
10596
  ParentSignatureType = "parent_signature_type",
10384
10597
  /** column name */
10385
- ReplayProtectionNonce = "replay_protection_nonce",
10386
- /** column name */
10387
10598
  Sender = "sender",
10388
10599
  /** column name */
10389
10600
  SequenceNumber = "sequence_number",
@@ -10413,7 +10624,6 @@ export type UserTransactionsStreamCursorValueInput = {
10413
10624
  gas_unit_price?: InputMaybe<Scalars["numeric"]["input"]>;
10414
10625
  max_gas_amount?: InputMaybe<Scalars["numeric"]["input"]>;
10415
10626
  parent_signature_type?: InputMaybe<Scalars["String"]["input"]>;
10416
- replay_protection_nonce?: InputMaybe<Scalars["numeric"]["input"]>;
10417
10627
  sender?: InputMaybe<Scalars["String"]["input"]>;
10418
10628
  sequence_number?: InputMaybe<Scalars["bigint"]["input"]>;
10419
10629
  timestamp?: InputMaybe<Scalars["timestamp"]["input"]>;
@@ -1,2 +1,3 @@
1
1
  export * from "./indexer";
2
2
  export * from "./types";
3
+ export * from "./ans";
@@ -71,6 +71,13 @@ export enum ScriptTransactionArgumentVariants {
71
71
  U32 = 7,
72
72
  U256 = 8,
73
73
  Serialized = 9,
74
+ // NOTE: Added in bytecode version v9, do not reorder!
75
+ I8 = 10,
76
+ I16 = 11,
77
+ I32 = 12,
78
+ I64 = 13,
79
+ I128 = 14,
80
+ I256 = 15,
74
81
  }
75
82
 
76
83
  /**
@@ -1361,6 +1368,36 @@ export type MoveUint128Type = string;
1361
1368
  */
1362
1369
  export type MoveUint256Type = string;
1363
1370
 
1371
+ /**
1372
+ * A number representing a Move int8 type.
1373
+ */
1374
+ export type MoveInt8Type = number;
1375
+
1376
+ /**
1377
+ * A 16-bit signed integer used in the Move programming language.
1378
+ */
1379
+ export type MoveInt16Type = number;
1380
+
1381
+ /**
1382
+ * A 32-bit signed integer type used in Move programming.
1383
+ */
1384
+ export type MoveInt32Type = number;
1385
+
1386
+ /**
1387
+ * A string representation of a 64-bit signed integer used in Move programming.
1388
+ */
1389
+ export type MoveInt64Type = string;
1390
+
1391
+ /**
1392
+ * A string representing a 128-bit signed integer in the Move programming language.
1393
+ */
1394
+ export type MoveInt128Type = string;
1395
+
1396
+ /**
1397
+ * A string representation of a 256-bit signed integer used in Move programming.
1398
+ */
1399
+ export type MoveInt256Type = string;
1400
+
1364
1401
  /**
1365
1402
  * A string representing a Move address.
1366
1403
  */
@@ -1402,6 +1439,12 @@ export type MoveType =
1402
1439
  | MoveUint64Type
1403
1440
  | MoveUint128Type
1404
1441
  | MoveUint256Type
1442
+ | MoveInt8Type
1443
+ | MoveInt16Type
1444
+ | MoveInt32Type
1445
+ | MoveInt64Type
1446
+ | MoveInt128Type
1447
+ | MoveInt256Type
1405
1448
  | MoveAddressType
1406
1449
  | MoveObjectType
1407
1450
  | MoveStructType
@@ -1418,6 +1461,10 @@ export type MoveType =
1418
1461
  *
1419
1462
  * `u64, u128, u256 -> string`
1420
1463
  *
1464
+ * `i8, i16, i32 -> number`
1465
+ *
1466
+ * `i64, i128, i256 -> string`
1467
+ *
1421
1468
  * `String -> string`
1422
1469
  *
1423
1470
  * `Address -> 0x${string}`
@@ -1439,6 +1486,12 @@ export type MoveValue =
1439
1486
  | MoveUint64Type
1440
1487
  | MoveUint128Type
1441
1488
  | MoveUint256Type
1489
+ | MoveInt8Type
1490
+ | MoveInt16Type
1491
+ | MoveInt32Type
1492
+ | MoveInt64Type
1493
+ | MoveInt128Type
1494
+ | MoveInt256Type
1442
1495
  | MoveAddressType
1443
1496
  | MoveObjectType
1444
1497
  | MoveStructId
@@ -1520,6 +1573,11 @@ export type MoveStruct = {
1520
1573
  * the Move source code. This attribute is only relevant for v2 events.
1521
1574
  */
1522
1575
  is_event: boolean;
1576
+ /**
1577
+ * True if the struct is an enum (e.g. enum MyEnum { A, B, C }), false if it is a
1578
+ * regular struct (e.g. struct MyStruct { a: u8, b: u8 }).
1579
+ */
1580
+ is_enum: boolean;
1523
1581
  /**
1524
1582
  * Abilities associated with the struct
1525
1583
  */
package/src/version.ts CHANGED
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * hardcoded for now, we would want to have it injected dynamically
8
8
  */
9
- export const VERSION = "5.2.0";
9
+ export const VERSION = "6.0.0";
@@ -1,4 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var L=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var d=(r,e,t,n)=>{for(var s=n>1?void 0:n?$(e,t):e,o=r.length-1,c;o>=0;o--)(c=r[o])&&(s=(n?c(e,t,s):c(s))||s);return n&&s&&L(e,t,s),s};var u=class extends Error{constructor(e,t){super(e),this.invalidReason=t}};var _utils = require('@noble/hashes/utils');var j=(n=>(n.TOO_SHORT="too_short",n.INVALID_LENGTH="invalid_length",n.INVALID_HEX_CHARS="invalid_hex_chars",n))(j||{}),x= exports.v =class r{constructor(e){this.data=e}toUint8Array(){return this.data}toStringWithoutPrefix(){return _utils.bytesToHex.call(void 0, this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(e){let t=e;if(t.startsWith("0x")&&(t=t.slice(2)),t.length===0)throw new u("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(t.length%2!==0)throw new u("Hex string must be an even number of hex characters.","invalid_length");try{return new r(_utils.hexToBytes.call(void 0, t))}catch(n){throw new u(`Hex string contains invalid hex characters: ${_optionalChain([n, 'optionalAccess', _2 => _2.message])}`,"invalid_hex_chars")}}static fromHexInput(e){return e instanceof Uint8Array?new r(e):r.fromHexString(e)}static hexInputToUint8Array(e){return e instanceof Uint8Array?e:r.fromHexString(e).toUint8Array()}static hexInputToString(e){return r.fromHexInput(e).toString()}static hexInputToStringWithoutPrefix(e){return r.fromHexInput(e).toStringWithoutPrefix()}static isValid(e){try{return r.fromHexString(e),{valid:!0}}catch(t){return{valid:!1,invalidReason:_optionalChain([t, 'optionalAccess', _3 => _3.invalidReason]),invalidReasonMessage:_optionalChain([t, 'optionalAccess', _4 => _4.message])}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((t,n)=>t===e.data[n])}},Be= exports.w =r=>new TextDecoder().decode(x.fromHexInput(r).toUint8Array());var U=255,M= exports.c =65535,f= exports.d =4294967295,m= exports.e =18446744073709551615n,I= exports.f =340282366920938463463374607431768211455n,T= exports.g =115792089237316195423570985008687907853269984665640564039457584007913129639935n,v= exports.h =-128,B= exports.i =127,N= exports.j =-32768,E= exports.k =32767,C= exports.l =-2147483648,w= exports.m =2147483647,k= exports.n =-9223372036854775808n,O= exports.o =9223372036854775807n,G= exports.p =-170141183460469231731687303715884105728n,D= exports.q =170141183460469231731687303715884105727n,z= exports.r =-57896044618658097711785492504343953926634992332820282019728792003956564819968n,F= exports.s =57896044618658097711785492504343953926634992332820282019728792003956564819967n;var b=class{bcsToBytes(){let e=new g;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return x.fromHexInput(e)}toStringWithoutPrefix(){return this.bcsToHex().toStringWithoutPrefix()}toString(){return`0x${this.toStringWithoutPrefix()}`}},g= exports.y =class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,n){this.ensureBufferWillHandleSize(t);let s=new DataView(this.buffer,this.offset);e.apply(s,[0,n,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){K(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(f),n=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(n))}serializeU128(e){let t=BigInt(e)&m,n=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(n)}serializeU256(e){let t=BigInt(e)&I,n=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(n)}serializeI8(e){this.serializeWithFunction(DataView.prototype.setInt8,1,e)}serializeI16(e){this.serializeWithFunction(DataView.prototype.setInt16,2,e)}serializeI32(e){this.serializeWithFunction(DataView.prototype.setInt32,4,e)}serializeI64(e){let t=BigInt(e),n=t<0?(BigInt(1)<<BigInt(64))+t:t,s=n&BigInt(f),o=n>>BigInt(32);this.serializeU32(Number(s)),this.serializeU32(Number(o))}serializeI128(e){let t=BigInt(e),n=t<0?(BigInt(1)<<BigInt(128))+t:t,s=n&m,o=n>>BigInt(64);this.serializeU64(s),this.serializeU64(o)}serializeI256(e){let t=BigInt(e),n=t<0?(BigInt(1)<<BigInt(256))+t:t,s=n&I,o=n>>BigInt(128);this.serializeU128(s),this.serializeU128(o)}serializeU32AsUleb128(e){let t=e,n=[];for(;t>>>7;)n.push(t&127|128),t>>>=7;n.push(t),this.appendToBuffer(new Uint8Array(n))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}serializeOption(e,t){let n=e!==void 0;this.serializeBool(n),n&&(typeof e=="string"?this.serializeStr(e):e instanceof Uint8Array?t!==void 0?this.serializeFixedBytes(e):this.serializeBytes(e):e.serialize(this))}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};d([l(0,U)],g.prototype,"serializeU8",1),d([l(0,M)],g.prototype,"serializeU16",1),d([l(0,f)],g.prototype,"serializeU32",1),d([l(BigInt(0),m)],g.prototype,"serializeU64",1),d([l(BigInt(0),I)],g.prototype,"serializeU128",1),d([l(BigInt(0),T)],g.prototype,"serializeU256",1),d([l(v,B)],g.prototype,"serializeI8",1),d([l(N,E)],g.prototype,"serializeI16",1),d([l(C,w)],g.prototype,"serializeI32",1),d([l(k,O)],g.prototype,"serializeI64",1),d([l(G,D)],g.prototype,"serializeI128",1),d([l(z,F)],g.prototype,"serializeI256",1),d([l(0,f)],g.prototype,"serializeU32AsUleb128",1);function K(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var Y=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function Z(r,e,t){let n=BigInt(r);if(n>BigInt(t)||n<BigInt(e))throw new Error(Y(r,e,t))}function l(r,e){return(t,n,s)=>{let o=s.value;return s.value=function(_){return Z(_,r,e),o.apply(this,[_])},s}}var Q=(s=>(s.JSON="application/json",s.BCS="application/x-bcs",s.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",s.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",s))(Q||{}),J= exports.D =(i=>(i[i.Bool=0]="Bool",i[i.U8=1]="U8",i[i.U64=2]="U64",i[i.U128=3]="U128",i[i.Address=4]="Address",i[i.Signer=5]="Signer",i[i.Vector=6]="Vector",i[i.Struct=7]="Struct",i[i.U16=8]="U16",i[i.U32=9]="U32",i[i.U256=10]="U256",i[i.I8=11]="I8",i[i.I16=12]="I16",i[i.I32=13]="I32",i[i.I64=14]="I64",i[i.I128=15]="I128",i[i.I256=16]="I256",i[i.Reference=254]="Reference",i[i.Generic=255]="Generic",i))(J||{}),H= exports.E =(p=>(p[p.U8=0]="U8",p[p.U64=1]="U64",p[p.U128=2]="U128",p[p.Address=3]="Address",p[p.U8Vector=4]="U8Vector",p[p.Bool=5]="Bool",p[p.U16=6]="U16",p[p.U32=7]="U32",p[p.U256=8]="U256",p[p.Serialized=9]="Serialized",p))(H||{}),V= exports.F =(s=>(s[s.Script=0]="Script",s[s.EntryFunction=2]="EntryFunction",s[s.Multisig=3]="Multisig",s[s.Payload=4]="Payload",s))(V||{}),ee= exports.G =(e=>(e[e.V1=0]="V1",e))(ee||{}),te= exports.H =(n=>(n[n.Script=0]="Script",n[n.EntryFunction=1]="EntryFunction",n[n.Empty=2]="Empty",n))(te||{}),re= exports.I =(e=>(e[e.V1=0]="V1",e))(re||{}),ne= exports.J =(t=>(t[t.MultiAgentTransaction=0]="MultiAgentTransaction",t[t.FeePayerTransaction=1]="FeePayerTransaction",t))(ne||{}),se= exports.K =(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.MultiAgent=2]="MultiAgent",o[o.FeePayer=3]="FeePayer",o[o.SingleSender=4]="SingleSender",o))(se||{}),oe= exports.L =(c=>(c[c.Ed25519=0]="Ed25519",c[c.MultiEd25519=1]="MultiEd25519",c[c.SingleKey=2]="SingleKey",c[c.MultiKey=3]="MultiKey",c[c.NoAccountAuthenticator=4]="NoAccountAuthenticator",c[c.Abstraction=5]="Abstraction",c))(oe||{}),ie= exports.M =(n=>(n.Ed25519="ed25519",n.Secp256k1="secp256k1",n.Secp256r1="secp256r1",n))(ie||{}),ae= exports.N =(o=>(o[o.Ed25519=0]="Ed25519",o[o.Secp256k1=1]="Secp256k1",o[o.Secp256r1=2]="Secp256r1",o[o.Keyless=3]="Keyless",o[o.FederatedKeyless=4]="FederatedKeyless",o))(ae||{});function Ge(r){switch(r){case 0:return"ed25519";case 1:return"secp256k1";case 2:return"secp256r1";case 3:return"keyless";case 4:return"federated_keyless";default:throw new Error("Unknown public key variant")}}var pe=(s=>(s[s.Ed25519=0]="Ed25519",s[s.Secp256k1=1]="Secp256k1",s[s.WebAuthn=2]="WebAuthn",s[s.Keyless=3]="Keyless",s))(pe||{}),ce= exports.Q =(e=>(e[e.Ed25519=0]="Ed25519",e))(ce||{}),ue= exports.R =(e=>(e[e.Ed25519=0]="Ed25519",e))(ue||{}),ge= exports.S =(e=>(e[e.ZkProof=0]="ZkProof",e))(ge||{}),de= exports.T =(e=>(e[e.Groth16=0]="Groth16",e))(de||{}),le= exports.U =(_=>(_.Pending="pending_transaction",_.User="user_transaction",_.Genesis="genesis_transaction",_.BlockMetadata="block_metadata_transaction",_.StateCheckpoint="state_checkpoint_transaction",_.Validator="validator_transaction",_.BlockEpilogue="block_epilogue_transaction",_))(le||{});function De(r){return r.type==="pending_transaction"}function ze(r){return r.type==="user_transaction"}function Fe(r){return r.type==="genesis_transaction"}function He(r){return r.type==="block_metadata_transaction"}function We(r){return r.type==="state_checkpoint_transaction"}function Pe(r){return r.type==="validator_transaction"}function Le(r){return r.type==="block_epilogue_transaction"}function $e(r){return"signature"in r&&r.type==="ed25519_signature"}function Xe(r){return"signature"in r&&r.signature==="secp256k1_ecdsa_signature"}function qe(r){return r.type==="multi_agent_signature"}function je(r){return r.type==="fee_payer_signature"}function Ke(r){return r.type==="multi_ed25519_signature"}function Ye(r){return r.type==="single_sender"}var ye=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(ye||{}),_e= exports.ha =(s=>(s.STORE="store",s.DROP="drop",s.KEY="key",s.COPY="copy",s))(_e||{}),he= exports.ia =(t=>(t.VALIDATOR="validator",t.FULL_NODE="full_node",t))(he||{}),xe= exports.ja =(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.SingleKey=2]="SingleKey",s[s.MultiKey=3]="MultiKey",s))(xe||{}),fe= exports.ka =(t=>(t[t.Ed25519=0]="Ed25519",t[t.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",t))(fe||{}),W= exports.la =(o=>(o[o.DeriveAuid=251]="DeriveAuid",o[o.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",o[o.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",o[o.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",o[o.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",o))(W||{});var Ie=(h=>(h.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",h.INVALID_HEX_CHARS="invalid_hex_chars",h.TOO_SHORT="too_short",h.TOO_LONG="too_long",h.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",h.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",h.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",h.INVALID_PADDING_STRICTNESS="INVALID_PADDING_STRICTNESS",h))(Ie||{}),a=class a extends b{constructor(e){if(super(),e.length!==a.LENGTH)throw new u("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=_utils.bytesToHex.call(void 0, this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return _utils.bytesToHex.call(void 0, this.data)}toStringShort(){return`0x${this.toStringShortWithoutPrefix()}`}toStringShortWithoutPrefix(){let e=_utils.bytesToHex.call(void 0, this.data).replace(/^0+/,"");return e===""?"0":e}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let t=e.deserializeFixedBytes(a.LENGTH);return new a(t)}static fromStringStrict(e){if(!e.startsWith("0x"))throw new u("Hex string must start with a leading 0x.","leading_zero_x_required");let t=a.fromString(e);if(e.length!==a.LONG_STRING_LENGTH+2)if(t.isSpecial()){if(e.length!==3)throw new u(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new u(`The given hex string ${e} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return t}static fromString(e,{maxMissingChars:t=4}={}){let n=e;if(e.startsWith("0x")&&(n=e.slice(2)),n.length===0)throw new u("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new u("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");if(t>63||t<0)throw new u(`maxMissingChars must be between or equal to 0 and 63. Received ${t}`,"INVALID_PADDING_STRICTNESS");let s;try{s=_utils.hexToBytes.call(void 0, n.padStart(64,"0"))}catch(c){throw new u(`Hex characters are invalid: ${_optionalChain([c, 'optionalAccess', _5 => _5.message])}`,"invalid_hex_chars")}let o=new a(s);if(n.length<64-t&&!o.isSpecial())throw new u(`Hex string is too short, must be ${64-t} to 64 chars long, excluding the leading 0x. You may need to fix
2
- the addresss by padding it with 0s before passing it to \`fromString\` (e.g. <addressString>.padStart(64, '0')).
3
- Received ${e}`,"too_short");return o}static from(e,{maxMissingChars:t=4}={}){return typeof e=="string"?a.fromString(e,{maxMissingChars:t}):e instanceof Uint8Array?new a(e):e}static fromStrict(e){return typeof e=="string"?a.fromStringStrict(e):e instanceof Uint8Array?new a(e):e}static isValid(e){try{return e.strict?a.fromStrict(e.input):a.from(e.input),{valid:!0}}catch(t){return{valid:!1,invalidReason:_optionalChain([t, 'optionalAccess', _6 => _6.invalidReason]),invalidReasonMessage:_optionalChain([t, 'optionalAccess', _7 => _7.message])}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((t,n)=>t===e.data[n])}};a.LENGTH=32,a.LONG_STRING_LENGTH=64,a.ZERO=a.from("0x0"),a.ONE=a.from("0x1"),a.TWO=a.from("0x2"),a.THREE=a.from("0x3"),a.FOUR=a.from("0x4"),a.A=a.from("0xA");var y=a;var _sha3 = require('@noble/hashes/sha3');var R=(r,e)=>{let t=r.bcsToBytes(),n=typeof e=="string"?Buffer.from(e,"utf8"):e,s=new Uint8Array([...t,...n,254]);return new y(_sha3.sha3_256.call(void 0, s))},gt= exports.pa =(r,e)=>{let t=r.bcsToBytes(),n=typeof e=="string"?Buffer.from(e,"utf8"):e,s=new Uint8Array([...t,...n,255]);return new y(_sha3.sha3_256.call(void 0, s))},dt= exports.qa =(r,e)=>{let t=r.bcsToBytes(),n=e.bcsToBytes(),s=new Uint8Array([...t,...n,252]);return new y(_sha3.sha3_256.call(void 0, s))},lt= exports.ra =(r,e,t)=>{let n=`${e}::${t}`;return R(r,n)};var _jsbase64 = require('js-base64');async function ft(r){return new Promise(e=>{setTimeout(e,r)})}function mt(r){return r instanceof Error?r.message:String(r)}var It=()=>Math.floor(Date.now()/1e3);function bt(r){let e=new Date(r*1e3);return e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),Math.floor(e.getTime()/1e3)}function At(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t=e+"==".substring(0,(3-e.length%3)%3);return _jsbase64.decode.call(void 0, t)}function St(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4!==0;)e+="=";return new Uint8Array(Buffer.from(e,"base64"))}var Rt=(r,e)=>r*10**e,Ut= exports.za =(r,e)=>r/10**e,P=r=>{let e="";for(let t=2;t<r.length;t+=2)e+=String.fromCharCode(parseInt(r.substring(t,t+2),16));return e},Mt= exports.Aa =r=>{let{account_address:e,module_name:t,struct_name:n}=r,s=P(t),o=P(n);return`${e}::${s}::${o}`},Tt= exports.Ba =r=>typeof r=="object"&&!Array.isArray(r)&&r!==null&&"account_address"in r&&"module_name"in r&&"struct_name"in r&&typeof r.account_address=="string"&&typeof r.module_name=="string"&&typeof r.struct_name=="string";function vt(r){let e=r.split("::");if(e.length!==3)throw new Error(`Invalid function ${r}`);let t=e[0],n=e[1],s=e[2];return{moduleAddress:t,moduleName:n,functionName:s}}function Bt(r){let e=r.split("::");return e.length===3&&y.isValid({input:e[0]}).valid}function Nt(r,e=6,t=5){return`${r.slice(0,e)}...${r.slice(-t)}`}var Ae="0x1::aptos_coin::AptosCoin",Et=y.A.toStringLong();function Se(r){let e=/0x[0-9a-fA-F]+/g;return r.replace(e,t=>y.from(t,{maxMissingChars:63}).toStringShort())}function Ct(r){let e=Se(r);return e===Ae?y.A:R(y.A,e)}exports.a = d; exports.b = U; exports.c = M; exports.d = f; exports.e = m; exports.f = I; exports.g = T; exports.h = v; exports.i = B; exports.j = N; exports.k = E; exports.l = C; exports.m = w; exports.n = k; exports.o = O; exports.p = G; exports.q = D; exports.r = z; exports.s = F; exports.t = u; exports.u = j; exports.v = x; exports.w = Be; exports.x = b; exports.y = g; exports.z = K; exports.A = Y; exports.B = Z; exports.C = Q; exports.D = J; exports.E = H; exports.F = V; exports.G = ee; exports.H = te; exports.I = re; exports.J = ne; exports.K = se; exports.L = oe; exports.M = ie; exports.N = ae; exports.O = Ge; exports.P = pe; exports.Q = ce; exports.R = ue; exports.S = ge; exports.T = de; exports.U = le; exports.V = De; exports.W = ze; exports.X = Fe; exports.Y = He; exports.Z = We; exports._ = Pe; exports.$ = Le; exports.aa = $e; exports.ba = Xe; exports.ca = qe; exports.da = je; exports.ea = Ke; exports.fa = Ye; exports.ga = ye; exports.ha = _e; exports.ia = he; exports.ja = xe; exports.ka = fe; exports.la = W; exports.ma = Ie; exports.na = y; exports.oa = R; exports.pa = gt; exports.qa = dt; exports.ra = lt; exports.sa = ft; exports.ta = mt; exports.ua = It; exports.va = bt; exports.wa = At; exports.xa = St; exports.ya = Rt; exports.za = Ut; exports.Aa = Mt; exports.Ba = Tt; exports.Ca = vt; exports.Da = Bt; exports.Ea = Nt; exports.Fa = Ct;
4
- //# sourceMappingURL=chunk-JQCMXTY7.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/maayansavir/work/aptos_repos/aptos-ts-sdk/dist/common/chunk-JQCMXTY7.js","../../src/core/common.ts","../../src/core/hex.ts","../../src/core/accountAddress.ts"],"names":["ParsingError","message","invalidReason","HexInvalidReason","Hex","_Hex","data","bytesToHex"],"mappings":"AAAA,ilBAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CCQhM,IAAMA,CAAAA,CAAN,MAAA,QAA8B,KAAM,CAkBzC,WAAA,CAAYC,CAAAA,CAAiBC,CAAAA,CAAkB,CAC7C,KAAA,CAAMD,CAAO,CAAA,CACb,IAAA,CAAK,aAAA,CAAgBC,CACvB,CACF,CAAA,CC3BA,4CAAuC,IAS3BC,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CACVA,CAAAA,CAAA,SAAA,CAAY,WAAA,CACZA,CAAAA,CAAA,cAAA,CAAiB,gBAAA,CACjBA,CAAAA,CAAA,iBAAA,CAAoB,mBAAA,CAHVA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAA,CAAA,CAAA,CAAA,CAgCCC,CAAAA,aAAN,MAAMC,CAAI,CAUf,WAAA,CAAYC,CAAAA,CAAkB,CAC5B,IAAA,CAAK,IAAA,CAAOA,CACd,CAaA,YAAA,CAAA,CAA2B,CACzB,OAAO,IAAA,CAAK,IACd,CASA,qBAAA,CAAA,CAAgC,CAC9B,OAAOC,+BAAAA,IAAW,CAAK,IAAI,CAC7B,CASA,QAAA,CAAA,CAAmB,CACjB,MAAO,CAAA,EAAA,EAAK,IAAA,CAAK,qBAAA,CAAsB,CAAC,CAAA,CAAA;ACkVsB;AAnWV,SAAA","file":"/Users/maayansavir/work/aptos_repos/aptos-ts-sdk/dist/common/chunk-JQCMXTY7.js","sourcesContent":[null,"// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This error is used to explain why parsing failed.\n * @group Implementation\n * @category Serialization\n */\nexport class ParsingError<T> extends Error {\n /**\n * This provides a programmatic way to access why parsing failed. Downstream devs\n * might want to use this to build their own error messages if the default error\n * messages are not suitable for their use case. This should be an enum.\n * @group Implementation\n * @category Serialization\n */\n public invalidReason: T;\n\n /**\n * Creates an instance of the error with a specified message and invalid reason.\n *\n * @param message The error message that describes the issue.\n * @param invalidReason The reason why the input is considered invalid.\n * @group Implementation\n * @category Serialization\n */\n constructor(message: string, invalidReason: T) {\n super(message);\n this.invalidReason = invalidReason;\n }\n}\n\n/**\n * Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function,\n * this type is returned from \"defensive\" functions like isValid.\n * @group Implementation\n * @category Serialization\n */\nexport type ParsingResult<T> = {\n /**\n * True if valid, false otherwise.\n * @group Implementation\n * @category Serialization\n */\n valid: boolean;\n\n /**\n * If valid is false, this will be a code explaining why parsing failed.\n * @group Implementation\n * @category Serialization\n */\n invalidReason?: T;\n\n /**\n * If valid is false, this will be a string explaining why parsing failed.\n * @group Implementation\n * @category Serialization\n */\n invalidReasonMessage?: string;\n};\n","// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bytesToHex, hexToBytes } from \"@noble/hashes/utils\";\nimport { ParsingError, ParsingResult } from \"./common\";\nimport { HexInput } from \"../types\";\n\n/**\n * Provides reasons for parsing failures related to hexadecimal values.\n * @group Implementation\n * @category Serialization\n */\nexport enum HexInvalidReason {\n TOO_SHORT = \"too_short\",\n INVALID_LENGTH = \"invalid_length\",\n INVALID_HEX_CHARS = \"invalid_hex_chars\",\n}\n\n/**\n * NOTE: Do not use this class when working with account addresses; use AccountAddress instead.\n * When accepting hex data as input to a function, prefer to accept HexInput and\n *\n * A helper class for working with hex data. Hex data, when represented as a string,\n * generally looks like this, for example: 0xaabbcc, 45cd32, etc.\n *\n * then use the static helper methods of this class to convert it into the desired\n * format. This enables the greatest flexibility for the developer.\n *\n * Example usage:\n * ```typescript\n * getTransactionByHash(txnHash: HexInput): Promise<Transaction> {\n * const txnHashString = Hex.fromHexInput(txnHash).toString();\n * return await getTransactionByHashInner(txnHashString);\n * }\n * ```\n * This call to `Hex.fromHexInput().toString()` converts the HexInput to a hex string\n * with a leading 0x prefix, regardless of what the input format was.\n *\n * Other ways to chain the functions together:\n * - `Hex.fromHexString({ hexInput: \"0x1f\" }).toUint8Array()`\n * - `new Hex([1, 3]).toStringWithoutPrefix()`\n * @group Implementation\n * @category Serialization\n */\nexport class Hex {\n private readonly data: Uint8Array;\n\n /**\n * Create a new Hex instance from a Uint8Array.\n *\n * @param data - The Uint8Array containing the data to initialize the Hex instance.\n * @group Implementation\n * @category Serialization\n */\n constructor(data: Uint8Array) {\n this.data = data;\n }\n\n // ===\n // Methods for representing an instance of Hex as other types.\n // ===\n\n /**\n * Get the inner hex data as a Uint8Array. The inner data is already a Uint8Array, so no conversion takes place.\n *\n * @returns Hex data as Uint8Array\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.data;\n }\n\n /**\n * Get the hex data as a string without the 0x prefix.\n *\n * @returns Hex string without 0x prefix\n * @group Implementation\n * @category Serialization\n */\n toStringWithoutPrefix(): string {\n return bytesToHex(this.data);\n }\n\n /**\n * Get the hex data as a string with the 0x prefix.\n *\n * @returns Hex string with 0x prefix\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n\n // ===\n // Methods for creating an instance of Hex from other types.\n // ===\n\n /**\n * Converts a hex string into a Hex instance, allowing for both prefixed and non-prefixed formats.\n *\n * @param str - A hex string, with or without the 0x prefix.\n *\n * @throws ParsingError - If the hex string is too short, has an odd number of characters, or contains invalid hex characters.\n *\n * @returns Hex - The resulting Hex instance created from the provided string.\n * @group Implementation\n * @category Serialization\n */\n static fromHexString(str: string): Hex {\n let input = str;\n\n if (input.startsWith(\"0x\")) {\n input = input.slice(2);\n }\n\n if (input.length === 0) {\n throw new ParsingError(\n \"Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.\",\n HexInvalidReason.TOO_SHORT,\n );\n }\n\n if (input.length % 2 !== 0) {\n throw new ParsingError(\"Hex string must be an even number of hex characters.\", HexInvalidReason.INVALID_LENGTH);\n }\n\n try {\n return new Hex(hexToBytes(input));\n } catch (error: any) {\n throw new ParsingError(\n `Hex string contains invalid hex characters: ${error?.message}`,\n HexInvalidReason.INVALID_HEX_CHARS,\n );\n }\n }\n\n /**\n * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Hex instance.\n * This function is useful for transforming hexadecimal representations into a structured Hex object for further manipulation.\n *\n * @param hexInput - A HexInput which can be a string or Uint8Array.\n * @returns A Hex instance created from the provided hexInput.\n * @group Implementation\n * @category Serialization\n */\n static fromHexInput(hexInput: HexInput): Hex {\n if (hexInput instanceof Uint8Array) return new Hex(hexInput);\n return Hex.fromHexString(hexInput);\n }\n\n /**\n * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Uint8Array.\n *\n * @param hexInput - A HexInput which can be a string or Uint8Array.\n * @returns A Uint8Array created from the provided hexInput.\n */\n static hexInputToUint8Array(hexInput: HexInput): Uint8Array {\n if (hexInput instanceof Uint8Array) return hexInput;\n return Hex.fromHexString(hexInput).toUint8Array();\n }\n\n /**\n * Converts a HexInput (string or Uint8Array) to a hex string with '0x' prefix.\n *\n * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array\n * @returns A hex string with '0x' prefix (e.g., \"0x1234\")\n *\n * @example\n * ```typescript\n * Hex.hexInputToString(\"1234\") // returns \"0x1234\"\n * Hex.hexInputToString(\"0x1234\") // returns \"0x1234\"\n * Hex.hexInputToString(new Uint8Array([0x12, 0x34])) // returns \"0x1234\"\n * ```\n */\n static hexInputToString(hexInput: HexInput): string {\n return Hex.fromHexInput(hexInput).toString();\n }\n\n /**\n * Converts a HexInput (string or Uint8Array) to a hex string without '0x' prefix.\n *\n * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array\n * @returns A hex string without '0x' prefix (e.g., \"1234\")\n *\n * @example\n * ```typescript\n * Hex.hexInputToStringWithoutPrefix(\"1234\") // returns \"1234\"\n * Hex.hexInputToStringWithoutPrefix(\"0x1234\") // returns \"1234\"\n * Hex.hexInputToStringWithoutPrefix(new Uint8Array([0x12, 0x34])) // returns \"1234\"\n * ```\n */\n static hexInputToStringWithoutPrefix(hexInput: HexInput): string {\n return Hex.fromHexInput(hexInput).toStringWithoutPrefix();\n }\n\n // ===\n // Methods for checking validity.\n // ===\n\n /**\n * Check if the provided string is a valid hexadecimal representation.\n *\n * @param str - A hex string representing byte data.\n *\n * @returns An object containing:\n * - valid: A boolean indicating whether the string is valid.\n * - invalidReason: The reason for invalidity if the string is not valid.\n * - invalidReasonMessage: A message explaining why the string is invalid.\n * @group Implementation\n * @category Serialization\n */\n static isValid(str: string): ParsingResult<HexInvalidReason> {\n try {\n Hex.fromHexString(str);\n return { valid: true };\n } catch (error: any) {\n return {\n valid: false,\n invalidReason: error?.invalidReason,\n invalidReasonMessage: error?.message,\n };\n }\n }\n\n /**\n * Determine if two Hex instances are equal by comparing their underlying byte data.\n *\n * @param other The Hex instance to compare to.\n * @returns true if the Hex instances are equal, false if not.\n * @group Implementation\n * @category Serialization\n */\n equals(other: Hex): boolean {\n if (this.data.length !== other.data.length) return false;\n return this.data.every((value, index) => value === other.data[index]);\n }\n}\n\nexport const hexToAsciiString = (hex: string) => new TextDecoder().decode(Hex.fromHexInput(hex).toUint8Array());\n","// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bytesToHex, hexToBytes } from \"@noble/hashes/utils\";\nimport { Serializable, Serializer } from \"../bcs/serializer\";\nimport { Deserializer } from \"../bcs/deserializer\";\nimport { ParsingError, ParsingResult } from \"./common\";\nimport { TransactionArgument } from \"../transactions/instances/transactionArgument\";\nimport { HexInput, ScriptTransactionArgumentVariants } from \"../types\";\n\n/**\n * Provides reasons for an address was invalid.\n * @group Implementation\n * @category Serialization\n */\nexport enum AddressInvalidReason {\n INCORRECT_NUMBER_OF_BYTES = \"incorrect_number_of_bytes\",\n INVALID_HEX_CHARS = \"invalid_hex_chars\",\n TOO_SHORT = \"too_short\",\n TOO_LONG = \"too_long\",\n LEADING_ZERO_X_REQUIRED = \"leading_zero_x_required\",\n LONG_FORM_REQUIRED_UNLESS_SPECIAL = \"long_form_required_unless_special\",\n INVALID_PADDING_ZEROES = \"INVALID_PADDING_ZEROES\",\n INVALID_PADDING_STRICTNESS = \"INVALID_PADDING_STRICTNESS\",\n}\n\n/**\n * The input for an account address, which can be either a hexadecimal string or a standard account address.\n * @group Implementation\n * @category Serialization\n */\nexport type AccountAddressInput = HexInput | AccountAddress;\n\n/**\n * NOTE: Only use this class for account addresses. For other hex data, e.g. transaction\n * hashes, use the Hex class.\n *\n * AccountAddress is used for working with account addresses. Account addresses, when\n * represented as a string, generally look like these examples:\n * - 0x1\n * - 0xaa86fe99004361f747f91342ca13c426ca0cccb0c1217677180c9493bad6ef0c\n *\n * Proper formatting and parsing of account addresses is defined by AIP-40.\n * To learn more about the standard, read the AIP here:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * The comments in this class make frequent reference to the LONG and SHORT formats,\n * as well as \"special\" addresses. To learn what these refer to see AIP-40.\n * @group Implementation\n * @category Serialization\n */\nexport class AccountAddress extends Serializable implements TransactionArgument {\n /**\n * This is the internal representation of an account address.\n * @group Implementation\n * @category Serialization\n */\n readonly data: Uint8Array;\n\n /**\n * The number of bytes that make up an account address.\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The length of an address string in LONG form without a leading 0x.\n * @group Implementation\n * @category Serialization\n */\n static readonly LONG_STRING_LENGTH: number = 64;\n\n static ZERO: AccountAddress = AccountAddress.from(\"0x0\");\n\n static ONE: AccountAddress = AccountAddress.from(\"0x1\");\n\n static TWO: AccountAddress = AccountAddress.from(\"0x2\");\n\n static THREE: AccountAddress = AccountAddress.from(\"0x3\");\n\n static FOUR: AccountAddress = AccountAddress.from(\"0x4\");\n\n static A: AccountAddress = AccountAddress.from(\"0xA\");\n\n /**\n * Creates an instance of AccountAddress from a Uint8Array.\n *\n * This function ensures that the input data is exactly 32 bytes long, which is required for a valid account address.\n *\n * @param input A Uint8Array representing an account address.\n * @throws ParsingError if the input length is not equal to 32 bytes.\n * @group Implementation\n * @category Serialization\n */\n constructor(input: Uint8Array) {\n super();\n if (input.length !== AccountAddress.LENGTH) {\n throw new ParsingError(\n \"AccountAddress data should be exactly 32 bytes long\",\n AddressInvalidReason.INCORRECT_NUMBER_OF_BYTES,\n );\n }\n this.data = input;\n }\n\n /**\n * Determines if the address is classified as special, which is defined as 0x0 to 0xf inclusive.\n * In other words, the last byte of the address must be < 0b10000 (16)\n * and every other byte must be zero.\n *\n * For more information on how special addresses are defined, see AIP-40:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @returns true if the address is special, false otherwise.\n * @group Implementation\n * @category Serialization\n */\n isSpecial(): boolean {\n return (\n this.data.slice(0, this.data.length - 1).every((byte) => byte === 0) && this.data[this.data.length - 1] < 0b10000\n );\n }\n // ===\n // Methods for representing an instance of AccountAddress as other types.\n // ===\n\n /**\n * Return the AccountAddress as a string as per AIP-40.\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n * This representation returns special addresses in SHORT form (0xf)\n * and other addresses in LONG form (0x + 64 characters).\n *\n * @returns AccountAddress as a string conforming to AIP-40.\n * @group Implementation\n * @category Serialization\n */\n toString(): `0x${string}` {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n\n /**\n * Return the AccountAddress as a string conforming to AIP-40 but without the leading 0x.\n *\n * NOTE: Prefer to use `toString` where possible.\n *\n * @returns AccountAddress as a string without the leading 0x.\n * @group Implementation\n * @category Serialization\n */\n toStringWithoutPrefix(): string {\n let hex = bytesToHex(this.data);\n if (this.isSpecial()) {\n hex = hex[hex.length - 1];\n }\n return hex;\n }\n\n /**\n * Convert the account address to a string in LONG format, which is always 0x followed by 64 hex characters.\n *\n * NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).\n *\n * @returns AccountAddress as a string in LONG form.\n * @group Implementation\n * @category Serialization\n */\n toStringLong(): `0x${string}` {\n return `0x${this.toStringLongWithoutPrefix()}`;\n }\n\n /**\n * Returns the account address as a string in LONG form without a leading 0x.\n * This function will include leading zeroes and will produce a string of 64 hex characters.\n *\n * NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).\n *\n * @returns {string} The account address in LONG form.\n * @group Implementation\n * @category Serialization\n */\n toStringLongWithoutPrefix(): string {\n return bytesToHex(this.data);\n }\n\n /**\n * Convert the account address to a string in SHORT format, which is 0x followed by the shortest\n * possible representation (no leading zeros).\n *\n * @returns AccountAddress as a string in SHORT form.\n * @group Implementation\n * @category Serialization\n */\n toStringShort(): `0x${string}` {\n return `0x${this.toStringShortWithoutPrefix()}`;\n }\n\n /**\n * Returns a lossless short string representation of the address by trimming leading zeros.\n * If the address consists of all zeros, returns \"0\".\n *\n * @returns A string representation of the address without leading zeros\n * @group Implementation\n * @category Serialization\n */\n toStringShortWithoutPrefix(): string {\n const hex = bytesToHex(this.data).replace(/^0+/, \"\");\n return hex === \"\" ? \"0\" : hex;\n }\n\n /**\n * Get the inner data as a Uint8Array.\n * The inner data is already a Uint8Array, so no conversion takes place.\n *\n * @returns Hex data as Uint8Array\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.data;\n }\n\n /**\n * Serialize the AccountAddress to a Serializer instance's data buffer.\n * @param serializer The serializer to serialize the AccountAddress to.\n * @returns void\n * @example\n * const serializer = new Serializer();\n * const address = AccountAddress.fromString(\"0x1\");\n * address.serialize(serializer);\n * const bytes = serializer.toUint8Array();\n * // `bytes` is now the BCS-serialized address.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.data);\n }\n\n /**\n * Serializes the current instance into a byte sequence suitable for entry functions.\n * This allows for the proper encoding of data when interacting with entry functions in the blockchain.\n *\n * @param serializer - The serializer instance used to convert the data into bytes.\n * @group Implementation\n * @category Serialization\n */\n serializeForEntryFunction(serializer: Serializer): void {\n const bcsBytes = this.bcsToBytes();\n serializer.serializeBytes(bcsBytes);\n }\n\n /**\n * Serializes the current instance for use in a script function by encoding it into a byte sequence.\n * This process involves serializing the variant index and the instance data, making it suitable for transmission.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @group Implementation\n * @category Serialization\n */\n serializeForScriptFunction(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(ScriptTransactionArgumentVariants.Address);\n serializer.serialize(this);\n }\n\n /**\n * Deserialize an AccountAddress from the byte buffer in a Deserializer instance.\n * This function allows you to convert a byte representation of an AccountAddress into an instance of AccountAddress.\n * @param deserializer The deserializer to deserialize the AccountAddress from.\n * @returns An instance of AccountAddress.\n * @example\n * const bytes = hexToBytes(\"0x0102030405060708091011121314151617181920212223242526272829303132\");\n * const deserializer = new Deserializer(bytes);\n * const address = AccountAddress.deserialize(deserializer);\n * // `address` is now an instance of AccountAddress.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): AccountAddress {\n const bytes = deserializer.deserializeFixedBytes(AccountAddress.LENGTH);\n return new AccountAddress(bytes);\n }\n\n // ===\n // Methods for creating an instance of AccountAddress from other types.\n // ===\n\n /**\n * NOTE: This function has strict parsing behavior. For relaxed behavior, please use\n * the `fromString` function.\n *\n * Creates an instance of AccountAddress from a hex string.\n *\n * This function allows only the strictest formats defined by AIP-40. In short this\n * means only the following formats are accepted:\n *\n * - LONG\n * - SHORT for special addresses\n *\n * Where:\n * - LONG is defined as 0x + 64 hex characters.\n * - SHORT for special addresses is 0x0 to 0xf inclusive without padding zeroes.\n *\n * This means the following are not accepted:\n * - SHORT for non-special addresses.\n * - Any address without a leading 0x.\n *\n * @param input - A hex string representing an account address.\n *\n * @throws {ParsingError} If the hex string does not start with 0x or is not in a valid format.\n *\n * @remarks\n *\n * This function has strict parsing behavior. For relaxed behavior, please use the `fromString` function.\n *\n * @see AIP-40 documentation for more details on address formats:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @returns An instance of AccountAddress.\n * @group Implementation\n * @category Serialization\n */\n static fromStringStrict(input: string): AccountAddress {\n // Assert the string starts with 0x.\n if (!input.startsWith(\"0x\")) {\n throw new ParsingError(\"Hex string must start with a leading 0x.\", AddressInvalidReason.LEADING_ZERO_X_REQUIRED);\n }\n\n const address = AccountAddress.fromString(input);\n\n // Check if the address is in LONG form. If it is not, this is only allowed for\n // special addresses, in which case we check it is in proper SHORT form.\n if (input.length !== AccountAddress.LONG_STRING_LENGTH + 2) {\n if (!address.isSpecial()) {\n throw new ParsingError(\n `The given hex string ${input} is not a special address, it must be represented as 0x + 64 chars.`,\n AddressInvalidReason.LONG_FORM_REQUIRED_UNLESS_SPECIAL,\n );\n } else if (input.length !== 3) {\n // 0x + one hex char is the only valid SHORT form for special addresses.\n throw new ParsingError(\n // eslint-disable-next-line max-len\n `The given hex string ${input} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,\n AddressInvalidReason.INVALID_PADDING_ZEROES,\n );\n }\n }\n\n return address;\n }\n\n /**\n * NOTE: This function has relaxed parsing behavior. For strict behavior, please use\n * the `fromStringStrict` function. Where possible use `fromStringStrict` rather than this\n * function, `fromString`.\n *\n * Creates an instance of AccountAddress from a hex string.\n *\n * This function allows all formats defined by AIP-40. In short this means the\n * following formats are accepted:\n *\n * - LONG, with or without leading 0x\n * - SHORT*, with or without leading 0x\n *\n * Where:\n * - LONG is 64 hex characters.\n * - SHORT* is 1 to 63 hex characters inclusive. The address can have missing values up to `maxMissingChars` before it is padded.\n * - Padding zeroes are allowed, e.g. 0x0123 is valid.\n *\n * Learn more about the different address formats by reading AIP-40:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @param input A hex string representing an account address.\n * @param args.maxMissingChars The number of characters that can be missing in a padded address before it is invalid.\n *\n * @returns An instance of AccountAddress.\n *\n * @throws ParsingError if the hex string is too short, too long, or contains invalid characters.\n * @group Implementation\n * @category Serialization\n */\n static fromString(input: string, { maxMissingChars = 4 }: { maxMissingChars?: number } = {}): AccountAddress {\n let parsedInput = input;\n // Remove leading 0x for parsing.\n if (input.startsWith(\"0x\")) {\n parsedInput = input.slice(2);\n }\n\n // Ensure the address string is at least 1 character long.\n if (parsedInput.length === 0) {\n throw new ParsingError(\n \"Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.\",\n AddressInvalidReason.TOO_SHORT,\n );\n }\n\n // Ensure the address string is not longer than 64 characters.\n if (parsedInput.length > 64) {\n throw new ParsingError(\n \"Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.\",\n AddressInvalidReason.TOO_LONG,\n );\n }\n\n // Ensure that the maxMissingChars is between or equal to 0 and 63.\n if (maxMissingChars > 63 || maxMissingChars < 0) {\n throw new ParsingError(\n `maxMissingChars must be between or equal to 0 and 63. Received ${maxMissingChars}`,\n AddressInvalidReason.INVALID_PADDING_STRICTNESS,\n );\n }\n\n let addressBytes: Uint8Array;\n try {\n // Pad the address with leading zeroes, so it is 64 chars long and then convert\n // the hex string to bytes. Every two characters in a hex string constitutes a\n // single byte. So a 64 length hex string becomes a 32 byte array.\n addressBytes = hexToBytes(parsedInput.padStart(64, \"0\"));\n } catch (error: any) {\n // At this point the only way this can fail is if the hex string contains\n // invalid characters.\n throw new ParsingError(`Hex characters are invalid: ${error?.message}`, AddressInvalidReason.INVALID_HEX_CHARS);\n }\n\n const address = new AccountAddress(addressBytes);\n\n // Cannot pad the address if it has more than maxMissingChars missing.\n if (parsedInput.length < 64 - maxMissingChars) {\n if (!address.isSpecial()) {\n throw new ParsingError(\n `Hex string is too short, must be ${64 - maxMissingChars} to 64 chars long, excluding the leading 0x. You may need to fix \nthe addresss by padding it with 0s before passing it to \\`fromString\\` (e.g. <addressString>.padStart(64, '0')). \nReceived ${input}`,\n AddressInvalidReason.TOO_SHORT,\n );\n }\n }\n\n return address;\n }\n\n /**\n * Convenience method for creating an AccountAddress from various input types.\n * This function accepts a string, Uint8Array, or an existing AccountAddress instance and returns the corresponding\n * AccountAddress.\n *\n * @param input - The input to convert into an AccountAddress. This can be a string representation of an address, a Uint8Array,\n * or an existing AccountAddress.\n * @param args.maxMissingChars The number of characters that can be missing in a padded address before it is invalid.\n * @group Implementation\n * @category Serialization\n */\n static from(input: AccountAddressInput, { maxMissingChars = 4 }: { maxMissingChars?: number } = {}): AccountAddress {\n if (typeof input === \"string\") {\n return AccountAddress.fromString(input, { maxMissingChars });\n }\n if (input instanceof Uint8Array) {\n return new AccountAddress(input);\n }\n return input;\n }\n\n /**\n * Create an AccountAddress from various input types, including strings, Uint8Array, and AccountAddress instances.\n *\n * @param input - The input to convert into an AccountAddress, which can be a string, a Uint8Array, or an AccountAddress.\n * @group Implementation\n * @category Serialization\n */\n static fromStrict(input: AccountAddressInput): AccountAddress {\n if (typeof input === \"string\") {\n return AccountAddress.fromStringStrict(input);\n }\n if (input instanceof Uint8Array) {\n return new AccountAddress(input);\n }\n return input;\n }\n // ===\n // Methods for checking validity.\n // ===\n\n /**\n * Check if the provided input is a valid AccountAddress.\n *\n * @param args - The arguments for validation.\n * @param args.input - A hex string representing an account address.\n * @param args.strict - If true, use strict parsing behavior; if false, use relaxed parsing behavior.\n *\n * @returns An object indicating whether the address is valid. If valid, valid = true; if not, valid = false with additional details.\n * If the address is invalid, invalidReason will explain why it is invalid, and invalidReasonMessage will provide the error message.\n * @group Implementation\n * @category Serialization\n */\n static isValid(args: { input: AccountAddressInput; strict?: boolean }): ParsingResult<AddressInvalidReason> {\n try {\n if (args.strict) {\n AccountAddress.fromStrict(args.input);\n } else {\n AccountAddress.from(args.input);\n }\n return { valid: true };\n } catch (error: any) {\n return {\n valid: false,\n invalidReason: error?.invalidReason,\n invalidReasonMessage: error?.message,\n };\n }\n }\n\n /**\n * Determine if two AccountAddresses are equal based on their underlying byte data.\n *\n * @param other - The AccountAddress to compare to.\n * @returns true if the AccountAddresses are equal, false if not.\n * @group Implementation\n * @category Serialization\n */\n equals(other: AccountAddress): boolean {\n if (this.data.length !== other.data.length) return false;\n return this.data.every((value, index) => value === other.data[index]);\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- import{a as s,c as T,e as t}from"./chunk-I42Z32Q2.mjs";import{a as n,b as l,c as o,d as c,e as z,f as u,g as d,h as y,i as B,j as b,k as p,l as I,m as v,n as m,o as U,p as S,q as h,r as F}from"./chunk-X2TPNKLV.mjs";var A=class r extends s{constructor(e){super(),T(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}deserialize(e){return new a(e.deserializeU256())}static deserialize(e){return new r(e.deserializeBool())}},N=class r extends s{constructor(e){super(),t(e,0,n),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new r(e.deserializeU8())}},_=class r extends s{constructor(e){super(),t(e,0,l),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new r(e.deserializeU16())}},g=class r extends s{constructor(e){super(),t(e,0,o),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new r(e.deserializeU32())}},M=class r extends s{constructor(e){super(),t(e,BigInt(0),c),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new r(e.deserializeU64())}},x=class r extends s{constructor(e){super(),t(e,BigInt(0),z),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new r(e.deserializeU128())}},a=class r extends s{constructor(e){super(),t(e,BigInt(0),u),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new r(e.deserializeU256())}},E=class r extends s{constructor(e){super(),t(e,d,y),this.value=e}serialize(e){e.serializeI8(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}static deserialize(e){return new r(e.deserializeI8())}},D=class r extends s{constructor(e){super(),t(e,B,b),this.value=e}serialize(e){e.serializeI16(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}static deserialize(e){return new r(e.deserializeI16())}},w=class r extends s{constructor(e){super(),t(e,p,I),this.value=e}serialize(e){e.serializeI32(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}static deserialize(e){return new r(e.deserializeI32())}},X=class r extends s{constructor(e){super(),t(e,v,m),this.value=BigInt(e)}serialize(e){e.serializeI64(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}static deserialize(e){return new r(e.deserializeI64())}},R=class r extends s{constructor(e){super(),t(e,U,S),this.value=BigInt(e)}serialize(e){e.serializeI128(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}static deserialize(e){return new r(e.deserializeI128())}},G=class r extends s{constructor(e){super(),t(e,h,F),this.value=BigInt(e)}serialize(e){e.serializeI256(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}static deserialize(e){return new r(e.deserializeI256())}};export{A as a,N as b,_ as c,g as d,M as e,x as f,a as g,E as h,D as i,w as j,X as k,R as l,G as m};
2
- //# sourceMappingURL=chunk-5ABS6RDR.mjs.map
@@ -1,2 +0,0 @@
1
- var u=(t=>(t.JSON="application/json",t.BCS="application/x-bcs",t.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",t.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",t))(u||{}),d=(e=>(e[e.Bool=0]="Bool",e[e.U8=1]="U8",e[e.U64=2]="U64",e[e.U128=3]="U128",e[e.Address=4]="Address",e[e.Signer=5]="Signer",e[e.Vector=6]="Vector",e[e.Struct=7]="Struct",e[e.U16=8]="U16",e[e.U32=9]="U32",e[e.U256=10]="U256",e[e.I8=11]="I8",e[e.I16=12]="I16",e[e.I32=13]="I32",e[e.I64=14]="I64",e[e.I128=15]="I128",e[e.I256=16]="I256",e[e.Reference=254]="Reference",e[e.Generic=255]="Generic",e))(d||{}),y=(s=>(s[s.U8=0]="U8",s[s.U64=1]="U64",s[s.U128=2]="U128",s[s.Address=3]="Address",s[s.U8Vector=4]="U8Vector",s[s.Bool=5]="Bool",s[s.U16=6]="U16",s[s.U32=7]="U32",s[s.U256=8]="U256",s[s.Serialized=9]="Serialized",s))(y||{}),c=(t=>(t[t.Script=0]="Script",t[t.EntryFunction=2]="EntryFunction",t[t.Multisig=3]="Multisig",t[t.Payload=4]="Payload",t))(c||{}),l=(o=>(o[o.V1=0]="V1",o))(l||{}),_=(i=>(i[i.Script=0]="Script",i[i.EntryFunction=1]="EntryFunction",i[i.Empty=2]="Empty",i))(_||{}),x=(o=>(o[o.V1=0]="V1",o))(x||{}),h=(p=>(p[p.MultiAgentTransaction=0]="MultiAgentTransaction",p[p.FeePayerTransaction=1]="FeePayerTransaction",p))(h||{}),m=(n=>(n[n.Ed25519=0]="Ed25519",n[n.MultiEd25519=1]="MultiEd25519",n[n.MultiAgent=2]="MultiAgent",n[n.FeePayer=3]="FeePayer",n[n.SingleSender=4]="SingleSender",n))(m||{}),v=(a=>(a[a.Ed25519=0]="Ed25519",a[a.MultiEd25519=1]="MultiEd25519",a[a.SingleKey=2]="SingleKey",a[a.MultiKey=3]="MultiKey",a[a.NoAccountAuthenticator=4]="NoAccountAuthenticator",a[a.Abstraction=5]="Abstraction",a))(v||{}),b=(i=>(i.Ed25519="ed25519",i.Secp256k1="secp256k1",i.Secp256r1="secp256r1",i))(b||{}),S=(n=>(n[n.Ed25519=0]="Ed25519",n[n.Secp256k1=1]="Secp256k1",n[n.Secp256r1=2]="Secp256r1",n[n.Keyless=3]="Keyless",n[n.FederatedKeyless=4]="FederatedKeyless",n))(S||{});function B(r){switch(r){case 0:return"ed25519";case 1:return"secp256k1";case 2:return"secp256r1";case 3:return"keyless";case 4:return"federated_keyless";default:throw new Error("Unknown public key variant")}}var R=(t=>(t[t.Ed25519=0]="Ed25519",t[t.Secp256k1=1]="Secp256k1",t[t.WebAuthn=2]="WebAuthn",t[t.Keyless=3]="Keyless",t))(R||{}),M=(o=>(o[o.Ed25519=0]="Ed25519",o))(M||{}),k=(o=>(o[o.Ed25519=0]="Ed25519",o))(k||{}),f=(o=>(o[o.ZkProof=0]="ZkProof",o))(f||{}),C=(o=>(o[o.Groth16=0]="Groth16",o))(C||{}),E=(g=>(g.Pending="pending_transaction",g.User="user_transaction",g.Genesis="genesis_transaction",g.BlockMetadata="block_metadata_transaction",g.StateCheckpoint="state_checkpoint_transaction",g.Validator="validator_transaction",g.BlockEpilogue="block_epilogue_transaction",g))(E||{});function G(r){return r.type==="pending_transaction"}function O(r){return r.type==="user_transaction"}function N(r){return r.type==="genesis_transaction"}function P(r){return r.type==="block_metadata_transaction"}function D(r){return r.type==="state_checkpoint_transaction"}function q(r){return r.type==="validator_transaction"}function w(r){return r.type==="block_epilogue_transaction"}function H(r){return"signature"in r&&r.type==="ed25519_signature"}function j(r){return"signature"in r&&r.signature==="secp256k1_ecdsa_signature"}function K(r){return r.type==="multi_agent_signature"}function L(r){return r.type==="fee_payer_signature"}function $(r){return r.type==="multi_ed25519_signature"}function z(r){return r.type==="single_sender"}var T=(i=>(i.PRIVATE="private",i.PUBLIC="public",i.FRIEND="friend",i))(T||{}),U=(t=>(t.STORE="store",t.DROP="drop",t.KEY="key",t.COPY="copy",t))(U||{}),I=(p=>(p.VALIDATOR="validator",p.FULL_NODE="full_node",p))(I||{}),W=(t=>(t[t.Ed25519=0]="Ed25519",t[t.MultiEd25519=1]="MultiEd25519",t[t.SingleKey=2]="SingleKey",t[t.MultiKey=3]="MultiKey",t))(W||{}),F=(p=>(p[p.Ed25519=0]="Ed25519",p[p.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",p))(F||{}),A=(n=>(n[n.DeriveAuid=251]="DeriveAuid",n[n.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",n[n.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",n[n.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",n[n.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",n))(A||{});export{u as a,d as b,y as c,c as d,l as e,_ as f,x as g,h,m as i,v as j,b as k,S as l,B as m,R as n,M as o,k as p,f as q,C as r,E as s,G as t,O as u,N as v,P as w,D as x,q as y,w as z,H as A,j as B,K as C,L as D,$ as E,z as F,T as G,U as H,I,W as J,F as K,A as L};
2
- //# sourceMappingURL=chunk-6XLLQB5P.mjs.map