@aptos-labs/ts-sdk 2.0.1 → 3.1.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 (343) hide show
  1. package/dist/common/account-Bb5REyaT.d.ts +7412 -0
  2. package/dist/common/chunk-6MMUUJHX.js +4 -0
  3. package/dist/common/{chunk-ZMDE3DNL.js.map → chunk-6MMUUJHX.js.map} +1 -1
  4. package/dist/common/cli/index.d.ts +1 -1
  5. package/dist/common/cli/index.js +1 -1
  6. package/dist/common/index.d.ts +5876 -9769
  7. package/dist/common/index.js +55 -32
  8. package/dist/common/index.js.map +1 -1
  9. package/dist/esm/{Ed25519Account-D9XrCLfE.d.mts → Ed25519Account-ndmdpFe9.d.mts} +1 -9
  10. package/dist/esm/account/AbstractKeylessAccount.d.mts +4 -31
  11. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  12. package/dist/esm/account/AbstractedAccount.d.mts +5 -32
  13. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  14. package/dist/esm/account/Account.d.mts +3 -30
  15. package/dist/esm/account/Account.mjs +1 -1
  16. package/dist/esm/account/AccountUtils.d.mts +4 -31
  17. package/dist/esm/account/AccountUtils.mjs +1 -1
  18. package/dist/esm/account/DerivableAbstractedAccount.d.mts +5 -32
  19. package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
  20. package/dist/esm/account/Ed25519Account.d.mts +3 -30
  21. package/dist/esm/account/Ed25519Account.mjs +1 -1
  22. package/dist/esm/account/EphemeralKeyPair.d.mts +2 -11
  23. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  24. package/dist/esm/account/FederatedKeylessAccount.d.mts +5 -31
  25. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  26. package/dist/esm/account/KeylessAccount.d.mts +5 -31
  27. package/dist/esm/account/KeylessAccount.mjs +1 -1
  28. package/dist/esm/account/MultiEd25519Account.d.mts +3 -30
  29. package/dist/esm/account/MultiEd25519Account.mjs +1 -1
  30. package/dist/esm/account/MultiKeyAccount.d.mts +5 -32
  31. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  32. package/dist/esm/account/SingleKeyAccount.d.mts +3 -30
  33. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  34. package/dist/esm/account/index.d.mts +4 -31
  35. package/dist/esm/account/index.mjs +1 -1
  36. package/dist/esm/account/utils.d.mts +2 -6
  37. package/dist/esm/account/utils.mjs +1 -1
  38. package/dist/esm/account--Q9z_xMN.d.mts +6625 -0
  39. package/dist/esm/api/account/abstraction.d.mts +2 -29
  40. package/dist/esm/api/account/abstraction.mjs +1 -1
  41. package/dist/esm/api/account.d.mts +95 -31
  42. package/dist/esm/api/account.mjs +1 -1
  43. package/dist/esm/api/ans.d.mts +3 -30
  44. package/dist/esm/api/ans.mjs +1 -1
  45. package/dist/esm/api/aptos.d.mts +8 -32
  46. package/dist/esm/api/aptos.mjs +1 -1
  47. package/dist/esm/api/aptosConfig.d.mts +4 -187
  48. package/dist/esm/api/aptosConfig.mjs +1 -1
  49. package/dist/esm/api/coin.d.mts +2 -29
  50. package/dist/esm/api/coin.mjs +1 -1
  51. package/dist/esm/api/digitalAsset.d.mts +3 -30
  52. package/dist/esm/api/digitalAsset.mjs +1 -1
  53. package/dist/esm/api/event.d.mts +2 -8
  54. package/dist/esm/api/event.mjs +1 -1
  55. package/dist/esm/api/faucet.d.mts +2 -8
  56. package/dist/esm/api/faucet.mjs +1 -1
  57. package/dist/esm/api/fungibleAsset.d.mts +2 -29
  58. package/dist/esm/api/fungibleAsset.mjs +1 -1
  59. package/dist/esm/api/general.d.mts +2 -29
  60. package/dist/esm/api/general.mjs +1 -1
  61. package/dist/esm/api/index.d.mts +6 -31
  62. package/dist/esm/api/index.mjs +1 -1
  63. package/dist/esm/api/keyless.d.mts +4 -31
  64. package/dist/esm/api/keyless.mjs +1 -1
  65. package/dist/esm/api/object.d.mts +2 -8
  66. package/dist/esm/api/object.mjs +1 -1
  67. package/dist/esm/api/staking.d.mts +2 -8
  68. package/dist/esm/api/staking.mjs +1 -1
  69. package/dist/esm/api/table.d.mts +2 -2
  70. package/dist/esm/api/table.mjs +1 -1
  71. package/dist/esm/api/transaction.d.mts +7 -33
  72. package/dist/esm/api/transaction.mjs +1 -1
  73. package/dist/esm/api/transactionSubmission/build.d.mts +2 -29
  74. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  75. package/dist/esm/api/transactionSubmission/management.d.mts +2 -29
  76. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  77. package/dist/esm/api/transactionSubmission/sign.d.mts +3 -30
  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 +2 -29
  81. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  82. package/dist/esm/api/transactionSubmission/submit.d.mts +4 -31
  83. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  84. package/dist/esm/api/utils.d.mts +2 -2
  85. package/dist/esm/api/utils.mjs +1 -1
  86. package/dist/esm/bcs/consts.d.mts +3 -1
  87. package/dist/esm/bcs/deserializer.d.mts +3 -304
  88. package/dist/esm/bcs/index.d.mts +2 -8
  89. package/dist/esm/bcs/index.mjs +1 -1
  90. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +3 -7
  91. package/dist/esm/bcs/serializable/fixedBytes.d.mts +3 -90
  92. package/dist/esm/bcs/serializable/movePrimitives.d.mts +2 -167
  93. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  94. package/dist/esm/bcs/serializable/moveStructs.d.mts +2 -430
  95. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  96. package/dist/esm/bcs/serializer.d.mts +3 -325
  97. package/dist/esm/{chunk-Q4W3WJ2U.mjs → chunk-2BOHKN33.mjs} +2 -2
  98. package/dist/esm/{chunk-AMAPBD4D.mjs → chunk-4COLMDT3.mjs} +2 -2
  99. package/dist/esm/chunk-5HXLZHDW.mjs +1 -0
  100. package/dist/esm/chunk-5HXLZHDW.mjs.map +1 -0
  101. package/dist/esm/{chunk-UOP7GBXB.mjs → chunk-5URUYE6H.mjs} +2 -2
  102. package/dist/esm/chunk-ACNHLCQQ.mjs +6 -0
  103. package/dist/esm/chunk-ACNHLCQQ.mjs.map +1 -0
  104. package/dist/esm/{chunk-V74WPKSY.mjs → chunk-FYYEPFML.mjs} +2 -2
  105. package/dist/esm/chunk-HUWKPKPQ.mjs +2 -0
  106. package/dist/esm/{chunk-VEGW6HP5.mjs.map → chunk-HUWKPKPQ.mjs.map} +1 -1
  107. package/dist/esm/chunk-IJE2LVZG.mjs +2 -0
  108. package/dist/esm/chunk-IJE2LVZG.mjs.map +1 -0
  109. package/dist/esm/chunk-JCFTAG5Z.mjs +2 -0
  110. package/dist/esm/{chunk-RJ7F4JDV.mjs.map → chunk-JCFTAG5Z.mjs.map} +1 -1
  111. package/dist/esm/{chunk-CZYH3G7E.mjs → chunk-MML57K5H.mjs} +2 -2
  112. package/dist/esm/{chunk-57J5YBMT.mjs → chunk-MNDTFHDB.mjs} +2 -2
  113. package/dist/esm/{chunk-U7HD6PQV.mjs → chunk-SLWIGOQL.mjs} +2 -2
  114. package/dist/esm/{chunk-V2QSMVJ5.mjs → chunk-TYYVB2A6.mjs} +2 -2
  115. package/dist/esm/{chunk-HETYL3WN.mjs → chunk-U3GMNXO4.mjs} +2 -2
  116. package/dist/esm/{chunk-VHNX2NUR.mjs → chunk-UL777LTI.mjs} +47 -26
  117. package/dist/esm/chunk-UL777LTI.mjs.map +1 -0
  118. package/dist/esm/{chunk-GBNAG7KK.mjs → chunk-XZ75T7Q7.mjs} +2 -2
  119. package/dist/esm/chunk-Y7ZQTLH4.mjs +2 -0
  120. package/dist/esm/chunk-Y7ZQTLH4.mjs.map +1 -0
  121. package/dist/esm/{chunk-KRBZ54CY.mjs → chunk-Z5URUE4U.mjs} +2 -2
  122. package/dist/esm/cli/index.d.mts +3 -7
  123. package/dist/esm/cli/index.mjs +1 -1
  124. package/dist/esm/cli/localNode.mjs +1 -1
  125. package/dist/esm/cli/move.d.mts +3 -7
  126. package/dist/esm/client/core.d.mts +3 -3
  127. package/dist/esm/client/core.mjs +1 -1
  128. package/dist/esm/client/get.d.mts +3 -3
  129. package/dist/esm/client/get.mjs +1 -1
  130. package/dist/esm/client/index.d.mts +2 -2
  131. package/dist/esm/client/index.mjs +1 -1
  132. package/dist/esm/client/post.d.mts +3 -3
  133. package/dist/esm/client/post.mjs +1 -1
  134. package/dist/esm/core/account/index.d.mts +3 -7
  135. package/dist/esm/core/account/index.mjs +1 -1
  136. package/dist/esm/core/account/utils/address.d.mts +3 -7
  137. package/dist/esm/core/account/utils/address.mjs +1 -1
  138. package/dist/esm/core/account/utils/index.d.mts +3 -7
  139. package/dist/esm/core/account/utils/index.mjs +1 -1
  140. package/dist/esm/core/accountAddress.d.mts +3 -329
  141. package/dist/esm/core/accountAddress.mjs +1 -1
  142. package/dist/esm/core/authenticationKey.d.mts +2 -10
  143. package/dist/esm/core/authenticationKey.mjs +1 -1
  144. package/dist/esm/core/crypto/abstraction.d.mts +2 -10
  145. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  146. package/dist/esm/core/crypto/deserializationUtils.d.mts +2 -10
  147. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  148. package/dist/esm/core/crypto/ed25519.d.mts +2 -301
  149. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  150. package/dist/esm/core/crypto/ephemeral.d.mts +2 -10
  151. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  152. package/dist/esm/core/crypto/federatedKeyless.d.mts +4 -12
  153. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  154. package/dist/esm/core/crypto/index.d.mts +4 -17
  155. package/dist/esm/core/crypto/index.mjs +1 -1
  156. package/dist/esm/core/crypto/keyless.d.mts +3 -11
  157. package/dist/esm/core/crypto/keyless.mjs +1 -1
  158. package/dist/esm/core/crypto/multiEd25519.d.mts +2 -228
  159. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  160. package/dist/esm/core/crypto/multiKey.d.mts +2 -254
  161. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  162. package/dist/esm/core/crypto/privateKey.d.mts +2 -71
  163. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  164. package/dist/esm/core/crypto/proof.d.mts +3 -4
  165. package/dist/esm/core/crypto/proof.mjs +1 -1
  166. package/dist/esm/core/crypto/publicKey.d.mts +2 -10
  167. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  168. package/dist/esm/core/crypto/secp256k1.d.mts +2 -274
  169. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  170. package/dist/esm/core/crypto/signature.d.mts +3 -31
  171. package/dist/esm/core/crypto/signature.mjs +1 -1
  172. package/dist/esm/core/crypto/singleKey.d.mts +2 -182
  173. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  174. package/dist/esm/core/crypto/types.d.mts +11 -0
  175. package/dist/esm/core/crypto/types.mjs +2 -0
  176. package/dist/esm/core/crypto/types.mjs.map +1 -0
  177. package/dist/esm/core/crypto/utils.d.mts +3 -1
  178. package/dist/esm/core/hex.d.mts +3 -156
  179. package/dist/esm/core/index.d.mts +3 -16
  180. package/dist/esm/core/index.mjs +1 -1
  181. package/dist/esm/errors/index.d.mts +2 -1
  182. package/dist/esm/errors/index.mjs +1 -1
  183. package/dist/esm/{federatedKeyless-DAYXjY2Y.d.mts → federatedKeyless-CiyplsOB.d.mts} +1 -7
  184. package/dist/esm/index.d.mts +7 -32
  185. package/dist/esm/index.mjs +1 -1
  186. package/dist/esm/internal/abstraction.d.mts +2 -29
  187. package/dist/esm/internal/abstraction.mjs +1 -1
  188. package/dist/esm/internal/account.d.mts +39 -36
  189. package/dist/esm/internal/account.mjs +1 -1
  190. package/dist/esm/internal/ans.d.mts +3 -30
  191. package/dist/esm/internal/ans.mjs +1 -1
  192. package/dist/esm/internal/coin.d.mts +3 -30
  193. package/dist/esm/internal/coin.mjs +1 -1
  194. package/dist/esm/internal/digitalAsset.d.mts +3 -30
  195. package/dist/esm/internal/digitalAsset.mjs +1 -1
  196. package/dist/esm/internal/event.d.mts +2 -8
  197. package/dist/esm/internal/event.mjs +1 -1
  198. package/dist/esm/internal/faucet.d.mts +3 -9
  199. package/dist/esm/internal/faucet.mjs +1 -1
  200. package/dist/esm/internal/fungibleAsset.d.mts +3 -30
  201. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  202. package/dist/esm/internal/general.d.mts +2 -2
  203. package/dist/esm/internal/general.mjs +1 -1
  204. package/dist/esm/internal/keyless.d.mts +14 -32
  205. package/dist/esm/internal/keyless.mjs +1 -1
  206. package/dist/esm/internal/object.d.mts +2 -8
  207. package/dist/esm/internal/object.mjs +1 -1
  208. package/dist/esm/internal/staking.d.mts +2 -8
  209. package/dist/esm/internal/staking.mjs +1 -1
  210. package/dist/esm/internal/table.d.mts +2 -2
  211. package/dist/esm/internal/table.mjs +1 -1
  212. package/dist/esm/internal/transaction.d.mts +3 -3
  213. package/dist/esm/internal/transaction.mjs +1 -1
  214. package/dist/esm/internal/transactionSubmission.d.mts +6 -33
  215. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  216. package/dist/esm/internal/utils/index.d.mts +2 -8
  217. package/dist/esm/internal/utils/index.mjs +1 -1
  218. package/dist/esm/internal/utils/utils.d.mts +2 -8
  219. package/dist/esm/internal/utils/utils.mjs +1 -1
  220. package/dist/esm/internal/view.d.mts +1 -28
  221. package/dist/esm/internal/view.mjs +1 -1
  222. package/dist/esm/transactions/authenticator/account.d.mts +2 -179
  223. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  224. package/dist/esm/transactions/authenticator/index.d.mts +2 -17
  225. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  226. package/dist/esm/transactions/authenticator/transaction.d.mts +2 -17
  227. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  228. package/dist/esm/transactions/index.d.mts +3 -30
  229. package/dist/esm/transactions/index.mjs +1 -1
  230. package/dist/esm/transactions/instances/chainId.d.mts +3 -44
  231. package/dist/esm/transactions/instances/identifier.d.mts +2 -44
  232. package/dist/esm/transactions/instances/index.d.mts +2 -27
  233. package/dist/esm/transactions/instances/index.mjs +1 -1
  234. package/dist/esm/transactions/instances/moduleId.d.mts +3 -57
  235. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  236. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +2 -60
  237. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  238. package/dist/esm/transactions/instances/rawTransaction.d.mts +2 -150
  239. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  240. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +2 -12
  241. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  242. package/dist/esm/transactions/instances/signedTransaction.d.mts +2 -23
  243. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  244. package/dist/esm/transactions/instances/simpleTransaction.d.mts +2 -59
  245. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  246. package/dist/esm/transactions/instances/transactionArgument.d.mts +2 -74
  247. package/dist/esm/transactions/instances/transactionPayload.d.mts +2 -300
  248. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  249. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -29
  250. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  251. package/dist/esm/transactions/management/index.d.mts +2 -29
  252. package/dist/esm/transactions/management/index.mjs +1 -1
  253. package/dist/esm/transactions/management/transactionWorker.d.mts +2 -29
  254. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  255. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +3 -30
  256. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  257. package/dist/esm/transactions/transactionBuilder/index.d.mts +2 -29
  258. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  259. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +2 -29
  260. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  261. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -28
  262. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  263. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +3 -29
  264. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  265. package/dist/esm/transactions/typeTag/index.d.mts +2 -462
  266. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  267. package/dist/esm/transactions/typeTag/parser.d.mts +2 -8
  268. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  269. package/dist/esm/transactions/types.d.mts +3 -399
  270. package/dist/esm/types/generated/operations.d.mts +37 -10
  271. package/dist/esm/types/generated/queries.d.mts +6 -2
  272. package/dist/esm/types/generated/queries.mjs +1 -1
  273. package/dist/esm/types/generated/types.d.mts +584 -1172
  274. package/dist/esm/types/generated/types.mjs +1 -1
  275. package/dist/esm/types/generated/types.mjs.map +1 -1
  276. package/dist/esm/types/index.d.mts +4 -2
  277. package/dist/esm/types/index.mjs +1 -1
  278. package/dist/esm/types/indexer.d.mts +8 -2
  279. package/dist/esm/types/types.d.mts +5 -1298
  280. package/dist/esm/types/types.mjs +1 -1
  281. package/dist/esm/utils/const.d.mts +1 -0
  282. package/dist/esm/utils/const.mjs +1 -1
  283. package/dist/esm/utils/helpers.d.mts +2 -6
  284. package/dist/esm/utils/helpers.mjs +1 -1
  285. package/dist/esm/utils/index.d.mts +1 -6
  286. package/dist/esm/utils/index.mjs +1 -1
  287. package/dist/esm/utils/normalizeBundle.d.mts +2 -4
  288. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  289. package/dist/esm/version.d.mts +1 -1
  290. package/dist/esm/version.mjs +1 -1
  291. package/package.json +1 -1
  292. package/src/account/FederatedKeylessAccount.ts +7 -1
  293. package/src/account/KeylessAccount.ts +17 -2
  294. package/src/api/account.ts +135 -2
  295. package/src/api/aptos.ts +6 -2
  296. package/src/api/aptosConfig.ts +73 -2
  297. package/src/api/transaction.ts +10 -6
  298. package/src/api/transactionSubmission/build.ts +5 -1
  299. package/src/api/transactionSubmission/submit.ts +16 -12
  300. package/src/core/crypto/index.ts +1 -0
  301. package/src/core/crypto/multiEd25519.ts +26 -0
  302. package/src/core/crypto/multiKey.ts +20 -1
  303. package/src/core/crypto/types.ts +9 -0
  304. package/src/internal/account.ts +526 -59
  305. package/src/internal/keyless.ts +10 -0
  306. package/src/internal/queries/getAccountAddressesForAuthKey.graphql +8 -0
  307. package/src/internal/queries/getAuthKeysForPublicKey.graphql +11 -0
  308. package/src/internal/transactionSubmission.ts +20 -10
  309. package/src/transactions/instances/transactionPayload.ts +165 -2
  310. package/src/transactions/management/transactionWorker.ts +1 -1
  311. package/src/transactions/transactionBuilder/transactionBuilder.ts +64 -5
  312. package/src/transactions/types.ts +61 -10
  313. package/src/types/codegen.yaml +1 -1
  314. package/src/types/generated/operations.ts +39 -8
  315. package/src/types/generated/queries.ts +53 -0
  316. package/src/types/generated/types.ts +620 -1239
  317. package/src/types/indexer.ts +8 -0
  318. package/src/types/types.ts +151 -3
  319. package/src/utils/const.ts +1 -0
  320. package/src/version.ts +1 -1
  321. package/dist/common/accountAddress-AL8HRxQC.d.ts +0 -3148
  322. package/dist/common/chunk-ZMDE3DNL.js +0 -4
  323. package/dist/esm/chunk-BK56GLTP.mjs +0 -4
  324. package/dist/esm/chunk-BK56GLTP.mjs.map +0 -1
  325. package/dist/esm/chunk-ODAAZLPK.mjs +0 -2
  326. package/dist/esm/chunk-ODAAZLPK.mjs.map +0 -1
  327. package/dist/esm/chunk-RJ7F4JDV.mjs +0 -2
  328. package/dist/esm/chunk-VEGW6HP5.mjs +0 -2
  329. package/dist/esm/chunk-VHNX2NUR.mjs.map +0 -1
  330. package/dist/esm/chunk-XTMUMN74.mjs +0 -2
  331. package/dist/esm/chunk-XTMUMN74.mjs.map +0 -1
  332. package/dist/esm/publicKey-CJOcUwJK.d.mts +0 -213
  333. /package/dist/esm/{chunk-Q4W3WJ2U.mjs.map → chunk-2BOHKN33.mjs.map} +0 -0
  334. /package/dist/esm/{chunk-AMAPBD4D.mjs.map → chunk-4COLMDT3.mjs.map} +0 -0
  335. /package/dist/esm/{chunk-UOP7GBXB.mjs.map → chunk-5URUYE6H.mjs.map} +0 -0
  336. /package/dist/esm/{chunk-V74WPKSY.mjs.map → chunk-FYYEPFML.mjs.map} +0 -0
  337. /package/dist/esm/{chunk-CZYH3G7E.mjs.map → chunk-MML57K5H.mjs.map} +0 -0
  338. /package/dist/esm/{chunk-57J5YBMT.mjs.map → chunk-MNDTFHDB.mjs.map} +0 -0
  339. /package/dist/esm/{chunk-U7HD6PQV.mjs.map → chunk-SLWIGOQL.mjs.map} +0 -0
  340. /package/dist/esm/{chunk-V2QSMVJ5.mjs.map → chunk-TYYVB2A6.mjs.map} +0 -0
  341. /package/dist/esm/{chunk-HETYL3WN.mjs.map → chunk-U3GMNXO4.mjs.map} +0 -0
  342. /package/dist/esm/{chunk-GBNAG7KK.mjs.map → chunk-XZ75T7Q7.mjs.map} +0 -0
  343. /package/dist/esm/{chunk-KRBZ54CY.mjs.map → chunk-Z5URUE4U.mjs.map} +0 -0
@@ -1,3148 +0,0 @@
1
- type GetAccountCoinsDataQuery = {
2
- current_fungible_asset_balances: Array<{
3
- amount?: any | null;
4
- asset_type?: string | null;
5
- is_frozen: boolean;
6
- is_primary?: boolean | null;
7
- last_transaction_timestamp?: any | null;
8
- last_transaction_version?: any | null;
9
- owner_address: string;
10
- storage_id: string;
11
- token_standard?: string | null;
12
- metadata?: {
13
- token_standard: string;
14
- symbol: string;
15
- supply_aggregator_table_key_v1?: string | null;
16
- supply_aggregator_table_handle_v1?: string | null;
17
- project_uri?: string | null;
18
- name: string;
19
- last_transaction_version: any;
20
- last_transaction_timestamp: any;
21
- icon_uri?: string | null;
22
- decimals: number;
23
- creator_address: string;
24
- asset_type: string;
25
- } | null;
26
- }>;
27
- };
28
- type GetAccountCollectionsWithOwnedTokensQuery = {
29
- current_collection_ownership_v2_view: Array<{
30
- collection_id?: string | null;
31
- collection_name?: string | null;
32
- collection_uri?: string | null;
33
- creator_address?: string | null;
34
- distinct_tokens?: any | null;
35
- last_transaction_version?: any | null;
36
- owner_address?: string | null;
37
- single_token_uri?: string | null;
38
- current_collection?: {
39
- collection_id: string;
40
- collection_name: string;
41
- creator_address: string;
42
- current_supply: any;
43
- description: string;
44
- last_transaction_timestamp: any;
45
- last_transaction_version: any;
46
- mutable_description?: boolean | null;
47
- max_supply?: any | null;
48
- mutable_uri?: boolean | null;
49
- table_handle_v1?: string | null;
50
- token_standard: string;
51
- total_minted_v2?: any | null;
52
- uri: string;
53
- } | null;
54
- }>;
55
- };
56
- type GetAccountOwnedTokensQuery = {
57
- current_token_ownerships_v2: Array<{
58
- token_standard: string;
59
- token_properties_mutated_v1?: any | null;
60
- token_data_id: string;
61
- table_type_v1?: string | null;
62
- storage_id: string;
63
- property_version_v1: any;
64
- owner_address: string;
65
- last_transaction_version: any;
66
- last_transaction_timestamp: any;
67
- is_soulbound_v2?: boolean | null;
68
- is_fungible_v2?: boolean | null;
69
- amount: any;
70
- current_token_data?: {
71
- collection_id: string;
72
- description: string;
73
- is_fungible_v2?: boolean | null;
74
- largest_property_version_v1?: any | null;
75
- last_transaction_timestamp: any;
76
- last_transaction_version: any;
77
- maximum?: any | null;
78
- supply?: any | null;
79
- token_data_id: string;
80
- token_name: string;
81
- token_properties: any;
82
- token_standard: string;
83
- token_uri: string;
84
- decimals?: any | null;
85
- current_collection?: {
86
- collection_id: string;
87
- collection_name: string;
88
- creator_address: string;
89
- current_supply: any;
90
- description: string;
91
- last_transaction_timestamp: any;
92
- last_transaction_version: any;
93
- max_supply?: any | null;
94
- mutable_description?: boolean | null;
95
- mutable_uri?: boolean | null;
96
- table_handle_v1?: string | null;
97
- token_standard: string;
98
- total_minted_v2?: any | null;
99
- uri: string;
100
- } | null;
101
- } | null;
102
- }>;
103
- };
104
- type GetAccountOwnedTokensFromCollectionQuery = {
105
- current_token_ownerships_v2: Array<{
106
- token_standard: string;
107
- token_properties_mutated_v1?: any | null;
108
- token_data_id: string;
109
- table_type_v1?: string | null;
110
- storage_id: string;
111
- property_version_v1: any;
112
- owner_address: string;
113
- last_transaction_version: any;
114
- last_transaction_timestamp: any;
115
- is_soulbound_v2?: boolean | null;
116
- is_fungible_v2?: boolean | null;
117
- amount: any;
118
- current_token_data?: {
119
- collection_id: string;
120
- description: string;
121
- is_fungible_v2?: boolean | null;
122
- largest_property_version_v1?: any | null;
123
- last_transaction_timestamp: any;
124
- last_transaction_version: any;
125
- maximum?: any | null;
126
- supply?: any | null;
127
- token_data_id: string;
128
- token_name: string;
129
- token_properties: any;
130
- token_standard: string;
131
- token_uri: string;
132
- decimals?: any | null;
133
- current_collection?: {
134
- collection_id: string;
135
- collection_name: string;
136
- creator_address: string;
137
- current_supply: any;
138
- description: string;
139
- last_transaction_timestamp: any;
140
- last_transaction_version: any;
141
- max_supply?: any | null;
142
- mutable_description?: boolean | null;
143
- mutable_uri?: boolean | null;
144
- table_handle_v1?: string | null;
145
- token_standard: string;
146
- total_minted_v2?: any | null;
147
- uri: string;
148
- } | null;
149
- } | null;
150
- }>;
151
- };
152
- type GetChainTopUserTransactionsQuery = {
153
- user_transactions: Array<{
154
- version: any;
155
- }>;
156
- };
157
- type GetCollectionDataQuery = {
158
- current_collections_v2: Array<{
159
- uri: string;
160
- total_minted_v2?: any | null;
161
- token_standard: string;
162
- table_handle_v1?: string | null;
163
- mutable_uri?: boolean | null;
164
- mutable_description?: boolean | null;
165
- max_supply?: any | null;
166
- collection_id: string;
167
- collection_name: string;
168
- creator_address: string;
169
- current_supply: any;
170
- description: string;
171
- last_transaction_timestamp: any;
172
- last_transaction_version: any;
173
- cdn_asset_uris?: {
174
- cdn_image_uri?: string | null;
175
- asset_uri: string;
176
- animation_optimizer_retry_count: number;
177
- cdn_animation_uri?: string | null;
178
- cdn_json_uri?: string | null;
179
- image_optimizer_retry_count: number;
180
- json_parser_retry_count: number;
181
- raw_animation_uri?: string | null;
182
- raw_image_uri?: string | null;
183
- } | null;
184
- }>;
185
- };
186
- type GetCurrentFungibleAssetBalancesQuery = {
187
- current_fungible_asset_balances: Array<{
188
- amount?: any | null;
189
- asset_type?: string | null;
190
- is_frozen: boolean;
191
- is_primary?: boolean | null;
192
- last_transaction_timestamp?: any | null;
193
- last_transaction_version?: any | null;
194
- owner_address: string;
195
- storage_id: string;
196
- token_standard?: string | null;
197
- }>;
198
- };
199
- type GetDelegatedStakingActivitiesQuery = {
200
- delegated_staking_activities: Array<{
201
- amount: any;
202
- delegator_address: string;
203
- event_index: any;
204
- event_type: string;
205
- pool_address: string;
206
- transaction_version: any;
207
- }>;
208
- };
209
- type GetEventsQuery = {
210
- events: Array<{
211
- account_address: string;
212
- creation_number: any;
213
- data: any;
214
- event_index: any;
215
- sequence_number: any;
216
- transaction_block_height: any;
217
- transaction_version: any;
218
- type: string;
219
- indexed_type: string;
220
- }>;
221
- };
222
- type GetFungibleAssetActivitiesQuery = {
223
- fungible_asset_activities: Array<{
224
- amount?: any | null;
225
- asset_type?: string | null;
226
- block_height: any;
227
- entry_function_id_str?: string | null;
228
- event_index: any;
229
- gas_fee_payer_address?: string | null;
230
- is_frozen?: boolean | null;
231
- is_gas_fee: boolean;
232
- is_transaction_success: boolean;
233
- owner_address?: string | null;
234
- storage_id: string;
235
- storage_refund_amount: any;
236
- token_standard: string;
237
- transaction_timestamp: any;
238
- transaction_version: any;
239
- type: string;
240
- }>;
241
- };
242
- type GetFungibleAssetMetadataQuery = {
243
- fungible_asset_metadata: Array<{
244
- icon_uri?: string | null;
245
- project_uri?: string | null;
246
- supply_aggregator_table_handle_v1?: string | null;
247
- supply_aggregator_table_key_v1?: string | null;
248
- creator_address: string;
249
- asset_type: string;
250
- decimals: number;
251
- last_transaction_timestamp: any;
252
- last_transaction_version: any;
253
- name: string;
254
- symbol: string;
255
- token_standard: string;
256
- supply_v2?: any | null;
257
- maximum_v2?: any | null;
258
- }>;
259
- };
260
- type GetNamesQuery = {
261
- current_aptos_names: Array<{
262
- domain?: string | null;
263
- expiration_timestamp?: any | null;
264
- registered_address?: string | null;
265
- subdomain?: string | null;
266
- token_standard?: string | null;
267
- is_primary?: boolean | null;
268
- owner_address?: string | null;
269
- subdomain_expiration_policy?: any | null;
270
- domain_expiration_timestamp?: any | null;
271
- }>;
272
- };
273
- type GetNumberOfDelegatorsQuery = {
274
- num_active_delegator_per_pool: Array<{
275
- num_active_delegator?: any | null;
276
- pool_address?: string | null;
277
- }>;
278
- };
279
- type GetObjectDataQuery = {
280
- current_objects: Array<{
281
- allow_ungated_transfer: boolean;
282
- state_key_hash: string;
283
- owner_address: string;
284
- object_address: string;
285
- last_transaction_version: any;
286
- last_guid_creation_num: any;
287
- is_deleted: boolean;
288
- }>;
289
- };
290
- type GetProcessorStatusQuery = {
291
- processor_status: Array<{
292
- last_success_version: any;
293
- processor: string;
294
- last_updated: any;
295
- }>;
296
- };
297
- type GetTableItemsDataQuery = {
298
- table_items: Array<{
299
- decoded_key: any;
300
- decoded_value?: any | null;
301
- key: string;
302
- table_handle: string;
303
- transaction_version: any;
304
- write_set_change_index: any;
305
- }>;
306
- };
307
- type GetTableItemsMetadataQuery = {
308
- table_metadatas: Array<{
309
- handle: string;
310
- key_type: string;
311
- value_type: string;
312
- }>;
313
- };
314
- type GetTokenActivityQuery = {
315
- token_activities_v2: Array<{
316
- after_value?: string | null;
317
- before_value?: string | null;
318
- entry_function_id_str?: string | null;
319
- event_account_address: string;
320
- event_index: any;
321
- from_address?: string | null;
322
- is_fungible_v2?: boolean | null;
323
- property_version_v1: any;
324
- to_address?: string | null;
325
- token_amount: any;
326
- token_data_id: string;
327
- token_standard: string;
328
- transaction_timestamp: any;
329
- transaction_version: any;
330
- type: string;
331
- }>;
332
- };
333
- type GetCurrentTokenOwnershipQuery = {
334
- current_token_ownerships_v2: Array<{
335
- token_standard: string;
336
- token_properties_mutated_v1?: any | null;
337
- token_data_id: string;
338
- table_type_v1?: string | null;
339
- storage_id: string;
340
- property_version_v1: any;
341
- owner_address: string;
342
- last_transaction_version: any;
343
- last_transaction_timestamp: any;
344
- is_soulbound_v2?: boolean | null;
345
- is_fungible_v2?: boolean | null;
346
- amount: any;
347
- current_token_data?: {
348
- collection_id: string;
349
- description: string;
350
- is_fungible_v2?: boolean | null;
351
- largest_property_version_v1?: any | null;
352
- last_transaction_timestamp: any;
353
- last_transaction_version: any;
354
- maximum?: any | null;
355
- supply?: any | null;
356
- token_data_id: string;
357
- token_name: string;
358
- token_properties: any;
359
- token_standard: string;
360
- token_uri: string;
361
- decimals?: any | null;
362
- current_collection?: {
363
- collection_id: string;
364
- collection_name: string;
365
- creator_address: string;
366
- current_supply: any;
367
- description: string;
368
- last_transaction_timestamp: any;
369
- last_transaction_version: any;
370
- max_supply?: any | null;
371
- mutable_description?: boolean | null;
372
- mutable_uri?: boolean | null;
373
- table_handle_v1?: string | null;
374
- token_standard: string;
375
- total_minted_v2?: any | null;
376
- uri: string;
377
- } | null;
378
- } | null;
379
- }>;
380
- };
381
- type GetTokenDataQuery = {
382
- current_token_datas_v2: Array<{
383
- collection_id: string;
384
- description: string;
385
- is_fungible_v2?: boolean | null;
386
- largest_property_version_v1?: any | null;
387
- last_transaction_timestamp: any;
388
- last_transaction_version: any;
389
- maximum?: any | null;
390
- supply?: any | null;
391
- token_data_id: string;
392
- token_name: string;
393
- token_properties: any;
394
- token_standard: string;
395
- token_uri: string;
396
- decimals?: any | null;
397
- current_collection?: {
398
- collection_id: string;
399
- collection_name: string;
400
- creator_address: string;
401
- current_supply: any;
402
- description: string;
403
- last_transaction_timestamp: any;
404
- last_transaction_version: any;
405
- max_supply?: any | null;
406
- mutable_description?: boolean | null;
407
- mutable_uri?: boolean | null;
408
- table_handle_v1?: string | null;
409
- token_standard: string;
410
- total_minted_v2?: any | null;
411
- uri: string;
412
- } | null;
413
- }>;
414
- };
415
-
416
- /**
417
- * GENERATED QUERY TYPES FROM GRAPHQL SCHEMA
418
- *
419
- * generated types we generate from graphql schema that match the structure of the
420
- * response type when querying from Hasura schema.
421
- *
422
- * These types are used as the return type when making the actual request (usually
423
- * under the /internal/ folder)
424
- * @group Implementation
425
- * @category Types
426
- */
427
-
428
- /**
429
- * CUSTOM RESPONSE TYPES FOR THE END USER
430
- *
431
- * To provide a good dev exp, we build custom types derived from the
432
- * query types to be the response type the end developer/user will
433
- * work with.
434
- *
435
- * These types are used as the return type when calling a sdk api function
436
- * that calls the function that queries the server (usually under the /api/ folder)
437
- * @group Implementation
438
- * @category Types
439
- */
440
- type GetObjectDataQueryResponse = GetObjectDataQuery["current_objects"];
441
- /**
442
- * The response structure for querying tokens owned by an account.
443
- * @group Implementation
444
- * @category Types
445
- */
446
- type GetAccountOwnedTokensQueryResponse = GetAccountOwnedTokensQuery["current_token_ownerships_v2"];
447
- /**
448
- * The response containing the current token ownerships for an account from a specific collection.
449
- * @group Implementation
450
- * @category Types
451
- */
452
- type GetAccountOwnedTokensFromCollectionResponse = GetAccountOwnedTokensFromCollectionQuery["current_token_ownerships_v2"];
453
- /**
454
- * The response structure for retrieving account collections associated with owned tokens.
455
- * @group Implementation
456
- * @category Types
457
- */
458
- type GetAccountCollectionsWithOwnedTokenResponse = GetAccountCollectionsWithOwnedTokensQuery["current_collection_ownership_v2_view"];
459
- /**
460
- * The current balances of fungible assets for an account.
461
- * @group Implementation
462
- * @category Types
463
- */
464
- type GetAccountCoinsDataResponse = GetAccountCoinsDataQuery["current_fungible_asset_balances"];
465
- /**
466
- * The response structure for retrieving user transactions from the top of the blockchain.
467
- * @group Implementation
468
- * @category Types
469
- */
470
- type GetChainTopUserTransactionsResponse = GetChainTopUserTransactionsQuery["user_transactions"];
471
- /**
472
- * The response containing the events from the GetEventsQuery.
473
- * @group Implementation
474
- * @category Types
475
- */
476
- type GetEventsResponse = GetEventsQuery["events"];
477
- /**
478
- * The number of active delegators per pool in response to a query.
479
- * @group Implementation
480
- * @category Types
481
- */
482
- type GetNumberOfDelegatorsResponse = GetNumberOfDelegatorsQuery["num_active_delegator_per_pool"];
483
- /**
484
- * The response containing the delegated staking activities from the query.
485
- * @group Implementation
486
- * @category Types
487
- */
488
- type GetDelegatedStakingActivitiesResponse = GetDelegatedStakingActivitiesQuery["delegated_staking_activities"];
489
- /**
490
- * The response structure for retrieving data from the current collections.
491
- * @group Implementation
492
- * @category Types
493
- */
494
- type GetCollectionDataResponse = GetCollectionDataQuery["current_collections_v2"][0];
495
- /**
496
- * The response structure for retrieving token data, containing the current token information.
497
- * @group Implementation
498
- * @category Types
499
- */
500
- type GetTokenDataResponse = GetTokenDataQuery["current_token_datas_v2"][0];
501
- /**
502
- * The status of the processor as returned by the GetProcessorStatusQuery.
503
- * @group Implementation
504
- * @category Types
505
- */
506
- type GetProcessorStatusResponse = GetProcessorStatusQuery["processor_status"];
507
- /**
508
- * The response containing metadata for a fungible asset.
509
- * @group Implementation
510
- * @category Types
511
- */
512
- type GetFungibleAssetMetadataResponse = GetFungibleAssetMetadataQuery["fungible_asset_metadata"];
513
- /**
514
- * The response containing the activities related to fungible assets.
515
- * @group Implementation
516
- * @category Types
517
- */
518
- type GetFungibleAssetActivitiesResponse = GetFungibleAssetActivitiesQuery["fungible_asset_activities"];
519
- /**
520
- * The current balances of fungible assets for a specific query.
521
- * @group Implementation
522
- * @category Types
523
- */
524
- type GetCurrentFungibleAssetBalancesResponse = GetCurrentFungibleAssetBalancesQuery["current_fungible_asset_balances"];
525
- /**
526
- * The response structure for retrieving token activity data.
527
- * @group Implementation
528
- * @category Types
529
- */
530
- type GetTokenActivityResponse = GetTokenActivityQuery["token_activities_v2"];
531
- /**
532
- * The response structure for retrieving the current token ownership details.
533
- * @group Implementation
534
- * @category Types
535
- */
536
- type GetCurrentTokenOwnershipResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"][0];
537
- /**
538
- * The response containing the current token ownerships for a user.
539
- * @group Implementation
540
- * @category Types
541
- */
542
- type GetOwnedTokensResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"];
543
- /**
544
- * The response structure for retrieving items from a table.
545
- * @group Implementation
546
- * @category Types
547
- */
548
- type GetTableItemsDataResponse = GetTableItemsDataQuery["table_items"];
549
- /**
550
- * The metadata for table items retrieved from a query.
551
- * @group Implementation
552
- * @category Types
553
- */
554
- type GetTableItemsMetadataResponse = GetTableItemsMetadataQuery["table_metadatas"];
555
- /**
556
- * The response containing the current Aptos names from the GetNamesQuery.
557
- * @group Implementation
558
- * @category Types
559
- */
560
- type GetANSNameResponse = GetNamesQuery["current_aptos_names"];
561
- /**
562
- * A generic type that being passed by each function and holds an
563
- * array of properties we can sort the query by
564
- * @group Implementation
565
- * @category Types
566
- */
567
- type OrderBy<T> = Array<{
568
- [K in keyof T]?: OrderByValue;
569
- }>;
570
- /**
571
- * Specifies the order direction for sorting, including options for handling null values.
572
- * @group Implementation
573
- * @category Types
574
- */
575
- type OrderByValue = "asc" | "asc_nulls_first" | "asc_nulls_last" | "desc" | "desc_nulls_first" | "desc_nulls_last";
576
- /**
577
- * The token standard to query for, which can be either version "v1" or "v2".
578
- * @group Implementation
579
- * @category Types
580
- */
581
- type TokenStandard = "v1" | "v2";
582
- /**
583
- * The GraphQL query to pass into the `queryIndexer` function.
584
- * @group Implementation
585
- * @category Types
586
- */
587
- type GraphqlQuery = {
588
- query: string;
589
- variables?: {};
590
- };
591
-
592
- /**
593
- * @group Implementation
594
- * @category Network
595
- */
596
- declare const NetworkToIndexerAPI: Record<string, string>;
597
- /**
598
- * @group Implementation
599
- * @category Network
600
- */
601
- declare const NetworkToNodeAPI: Record<string, string>;
602
- /**
603
- * @group Implementation
604
- * @category Network
605
- */
606
- declare const NetworkToFaucetAPI: Record<string, string>;
607
- /**
608
- * @group Implementation
609
- * @category Network
610
- */
611
- declare const NetworkToPepperAPI: Record<string, string>;
612
- /**
613
- * @group Implementation
614
- * @category Network
615
- */
616
- declare const NetworkToProverAPI: Record<string, string>;
617
- /**
618
- * Different network environments for connecting to services, ranging from production to development setups.
619
- * @group Implementation
620
- * @category Network
621
- */
622
- declare enum Network {
623
- MAINNET = "mainnet",
624
- TESTNET = "testnet",
625
- DEVNET = "devnet",
626
- LOCAL = "local",
627
- CUSTOM = "custom"
628
- }
629
- /**
630
- * @group Implementation
631
- * @category Network
632
- */
633
- declare const NetworkToChainId: Record<string, number>;
634
- /**
635
- * @group Implementation
636
- * @category Network
637
- */
638
- declare const NetworkToNetworkName: Record<string, Network>;
639
-
640
- /**
641
- * Different MIME types used for data interchange in transactions and responses.
642
- */
643
- declare enum MimeType {
644
- /**
645
- * JSON representation, used for transaction submission and accept type JSON output
646
- */
647
- JSON = "application/json",
648
- /**
649
- * BCS representation, used for accept type BCS output
650
- */
651
- BCS = "application/x-bcs",
652
- /**
653
- * BCS representation, used for transaction submission in BCS input
654
- */
655
- BCS_SIGNED_TRANSACTION = "application/x.aptos.signed_transaction+bcs",
656
- BCS_VIEW_FUNCTION = "application/x.aptos.view_function+bcs"
657
- }
658
- /**
659
- * Hexadecimal data input for functions, supporting both string and Uint8Array formats.
660
- */
661
- type HexInput = string | Uint8Array;
662
- /**
663
- * Variants of type tags used in the system, encompassing various data types and structures.
664
- * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}
665
- */
666
- declare enum TypeTagVariants {
667
- Bool = 0,
668
- U8 = 1,
669
- U64 = 2,
670
- U128 = 3,
671
- Address = 4,
672
- Signer = 5,
673
- Vector = 6,
674
- Struct = 7,
675
- U16 = 8,
676
- U32 = 9,
677
- U256 = 10,
678
- Reference = 254,// This is specifically a placeholder and does not represent a real type
679
- Generic = 255
680
- }
681
- /**
682
- * Variants of script transaction arguments used in Rust, encompassing various data types for transaction processing.
683
- * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}
684
- */
685
- declare enum ScriptTransactionArgumentVariants {
686
- U8 = 0,
687
- U64 = 1,
688
- U128 = 2,
689
- Address = 3,
690
- U8Vector = 4,
691
- Bool = 5,
692
- U16 = 6,
693
- U32 = 7,
694
- U256 = 8,
695
- Serialized = 9
696
- }
697
- /**
698
- * The payload for various transaction types in the system.
699
- * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}
700
- */
701
- declare enum TransactionPayloadVariants {
702
- Script = 0,
703
- EntryFunction = 2,
704
- Multisig = 3
705
- }
706
- /**
707
- * Variants of transactions used in the system.
708
- * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}
709
- */
710
- declare enum TransactionVariants {
711
- MultiAgentTransaction = 0,
712
- FeePayerTransaction = 1
713
- }
714
- /**
715
- * Variants of transaction authenticators used in the system.
716
- * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}
717
- */
718
- declare enum TransactionAuthenticatorVariant {
719
- Ed25519 = 0,
720
- MultiEd25519 = 1,
721
- MultiAgent = 2,
722
- FeePayer = 3,
723
- SingleSender = 4
724
- }
725
- /**
726
- * Variants of account authenticators used in transactions.
727
- * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}
728
- */
729
- declare enum AccountAuthenticatorVariant {
730
- Ed25519 = 0,
731
- MultiEd25519 = 1,
732
- SingleKey = 2,
733
- MultiKey = 3,
734
- NoAccountAuthenticator = 4,
735
- Abstraction = 5
736
- }
737
- /**
738
- * Variants of private keys that can comply with the AIP-80 standard.
739
- * {@link https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md}
740
- */
741
- declare enum PrivateKeyVariants {
742
- Ed25519 = "ed25519",
743
- Secp256k1 = "secp256k1"
744
- }
745
- /**
746
- * Variants of public keys used in cryptographic operations.
747
- */
748
- declare enum AnyPublicKeyVariant {
749
- Ed25519 = 0,
750
- Secp256k1 = 1,
751
- Keyless = 3,
752
- FederatedKeyless = 4
753
- }
754
- /**
755
- * Variants of signature types used for cryptographic operations.
756
- */
757
- declare enum AnySignatureVariant {
758
- Ed25519 = 0,
759
- Secp256k1 = 1,
760
- Keyless = 3
761
- }
762
- /**
763
- * Variants of ephemeral public keys used in cryptographic operations.
764
- */
765
- declare enum EphemeralPublicKeyVariant {
766
- Ed25519 = 0
767
- }
768
- /**
769
- * Variants of ephemeral signatures used for secure communication.
770
- */
771
- declare enum EphemeralSignatureVariant {
772
- Ed25519 = 0
773
- }
774
- /**
775
- * Variants of ephemeral certificates used in secure transactions.
776
- */
777
- declare enum EphemeralCertificateVariant {
778
- ZkProof = 0
779
- }
780
- /**
781
- * Variants of zero-knowledge proofs used in cryptographic operations.
782
- */
783
- declare enum ZkpVariant {
784
- Groth16 = 0
785
- }
786
- /**
787
- * BCS types
788
- */
789
- type Uint8 = number;
790
- /**
791
- * A 16-bit unsigned integer.
792
- */
793
- type Uint16 = number;
794
- /**
795
- * A 32-bit unsigned integer.
796
- */
797
- type Uint32 = number;
798
- /**
799
- * A 64-bit unsigned integer value.
800
- */
801
- type Uint64 = bigint;
802
- /**
803
- * A 128-bit unsigned integer used for precise arithmetic operations.
804
- */
805
- type Uint128 = bigint;
806
- /**
807
- * A 256-bit unsigned integer used for precise numerical calculations.
808
- */
809
- type Uint256 = bigint;
810
- /**
811
- * A number or a bigint value.
812
- */
813
- type AnyNumber = number | bigint;
814
- /**
815
- * Configuration options for initializing the SDK, allowing customization of its behavior and interaction with the Aptos network.
816
- */
817
- type AptosSettings = {
818
- readonly network?: Network;
819
- readonly fullnode?: string;
820
- readonly faucet?: string;
821
- readonly indexer?: string;
822
- readonly pepper?: string;
823
- readonly prover?: string;
824
- readonly clientConfig?: ClientConfig;
825
- readonly client?: Client;
826
- readonly fullnodeConfig?: FullNodeConfig;
827
- readonly indexerConfig?: IndexerConfig;
828
- readonly faucetConfig?: FaucetConfig;
829
- };
830
- /**
831
- * Defines the parameters for paginating query results, including the starting position and maximum number of items to return.
832
- * @param offset Specifies the starting position of the query result. Default is 0.
833
- * @param limit Specifies the maximum number of items to return. Default is 25.
834
- */
835
- interface PaginationArgs {
836
- offset?: AnyNumber;
837
- limit?: number;
838
- }
839
- /**
840
- * Defines the parameters for paginating query results, including the starting position and maximum number of items to return.
841
- * @param cursor Specifies the starting position of the query result. Default is at the beginning if undefined. This is not a number and must come from the API.
842
- * @param limit Specifies the maximum number of items to return. Default is 25.
843
- */
844
- interface CursorPaginationArgs {
845
- cursor?: string;
846
- limit?: number;
847
- }
848
- /**
849
- * Represents the arguments for specifying a token standard.
850
- *
851
- * @param tokenStandard - Optional standard of the token.
852
- */
853
- interface TokenStandardArg {
854
- tokenStandard?: TokenStandard;
855
- }
856
- interface OrderByArg<T extends {}> {
857
- orderBy?: OrderBy<T>;
858
- }
859
- interface WhereArg<T extends {}> {
860
- where?: T;
861
- }
862
- /**
863
- * QUERY TYPES
864
- */
865
- /**
866
- * A configuration object for requests to the server, including API key, extra headers, and cookie handling options.
867
- */
868
- type ClientConfig = ClientHeadersType & {
869
- WITH_CREDENTIALS?: boolean;
870
- API_KEY?: string;
871
- };
872
- /**
873
- * A configuration object for a Fullnode, allowing for the inclusion of extra headers in requests.
874
- */
875
- type FullNodeConfig = ClientHeadersType;
876
- /**
877
- * An Indexer configuration object for sending requests with additional headers.
878
- */
879
- type IndexerConfig = ClientHeadersType;
880
- /**
881
- * A configuration object for a faucet, including optional authentication and headers for requests.
882
- */
883
- type FaucetConfig = ClientHeadersType & {
884
- AUTH_TOKEN?: string;
885
- };
886
- /**
887
- * General type definition for client headers.
888
- */
889
- type ClientHeadersType = {
890
- HEADERS?: Record<string, string | number | boolean>;
891
- };
892
- /**
893
- * Represents a client for making requests to a service provider.
894
- *
895
- * @param Req - The type of the request payload.
896
- * @param Res - The type of the response payload.
897
- */
898
- interface ClientRequest<Req> {
899
- url: string;
900
- method: "GET" | "POST";
901
- originMethod?: string;
902
- body?: Req;
903
- contentType?: string;
904
- params?: any;
905
- overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;
906
- headers?: Record<string, any>;
907
- }
908
- interface ClientResponse<Res> {
909
- status: number;
910
- statusText: string;
911
- data: Res;
912
- config?: any;
913
- request?: any;
914
- response?: any;
915
- headers?: any;
916
- }
917
- interface Client {
918
- /**
919
- * Sends a request to the specified URL with the given options.
920
- *
921
- * @param requestOptions - The options for the request.
922
- * @param requestOptions.url - The URL to send the request to.
923
- * @param requestOptions.method - The HTTP method to use, either "GET" or "POST".
924
- * @param requestOptions.path - An optional path to append to the URL.
925
- * @param requestOptions.body - The body of the request, applicable for POST requests.
926
- * @param requestOptions.contentType - The content type of the request body.
927
- * @param requestOptions.acceptType - The expected content type of the response.
928
- * @param requestOptions.params - Optional parameters to include in the request.
929
- * @param requestOptions.originMethod - An optional method to specify the origin of the request.
930
- * @param requestOptions.overrides - Optional configuration overrides for the request.
931
- */
932
- provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;
933
- }
934
- /**
935
- * The API request type
936
- *
937
- * @param url - the url to make the request to, i.e. https://fullnode.devnet.aptoslabs.com/v1
938
- * @param method - the request method "GET" | "POST"
939
- * @param endpoint (optional) - the endpoint to make the request to, i.e. transactions
940
- * @param body (optional) - the body of the request
941
- * @param contentType (optional) - the content type to set the `content-type` header to,
942
- * by default is set to `application/json`
943
- * @param params (optional) - query params to add to the request
944
- * @param originMethod (optional) - the local method the request came from
945
- * @param overrides (optional) - a `ClientConfig` object type to override request data
946
- */
947
- type AptosRequest = {
948
- url: string;
949
- method: "GET" | "POST";
950
- path?: string;
951
- body?: any;
952
- contentType?: string;
953
- acceptType?: string;
954
- params?: Record<string, string | AnyNumber | boolean | undefined>;
955
- originMethod?: string;
956
- overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;
957
- };
958
- /**
959
- * The API response type
960
- *
961
- * @param status - the response status. i.e. 200
962
- * @param statusText - the response message
963
- * @param data the response data
964
- * @param url the url the request was made to
965
- * @param headers the response headers
966
- * @param config (optional) - the request object
967
- * @param request (optional) - the request object
968
- */
969
- interface AptosResponse<Req, Res> {
970
- status: number;
971
- statusText: string;
972
- data: Res;
973
- url: string;
974
- headers: any;
975
- config?: any;
976
- request?: Req;
977
- }
978
- /**
979
- * The ledger version of transactions, defaulting to the latest version if not specified.
980
- */
981
- type LedgerVersionArg = {
982
- ledgerVersion?: AnyNumber;
983
- };
984
- /**
985
- * RESPONSE TYPES
986
- */
987
- /**
988
- * The output of the estimate gas API, including the deprioritized estimate for the gas unit price.
989
- */
990
- type GasEstimation = {
991
- /**
992
- * The deprioritized estimate for the gas unit price
993
- */
994
- deprioritized_gas_estimate?: number;
995
- /**
996
- * The current estimate for the gas unit price
997
- */
998
- gas_estimate: number;
999
- /**
1000
- * The prioritized estimate for the gas unit price
1001
- */
1002
- prioritized_gas_estimate?: number;
1003
- };
1004
- type MoveResource<T = {}> = {
1005
- type: MoveStructId;
1006
- data: T;
1007
- };
1008
- /**
1009
- * The data associated with an account, including its sequence number.
1010
- */
1011
- type AccountData = {
1012
- sequence_number: string;
1013
- authentication_key: string;
1014
- };
1015
- /**
1016
- * A Move module containing an address.
1017
- */
1018
- type MoveModuleBytecode = {
1019
- bytecode: string;
1020
- abi?: MoveModule;
1021
- };
1022
- /**
1023
- * TRANSACTION TYPES
1024
- */
1025
- /**
1026
- * Different types of transaction responses that can occur in the system.
1027
- */
1028
- declare enum TransactionResponseType {
1029
- Pending = "pending_transaction",
1030
- User = "user_transaction",
1031
- Genesis = "genesis_transaction",
1032
- BlockMetadata = "block_metadata_transaction",
1033
- StateCheckpoint = "state_checkpoint_transaction",
1034
- Validator = "validator_transaction",
1035
- BlockEpilogue = "block_epilogue_transaction"
1036
- }
1037
- /**
1038
- * The response for a transaction, which can be either pending or committed.
1039
- */
1040
- type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;
1041
- /**
1042
- * The response for a committed transaction, which can be one of several transaction types.
1043
- */
1044
- type CommittedTransactionResponse = UserTransactionResponse | GenesisTransactionResponse | BlockMetadataTransactionResponse | StateCheckpointTransactionResponse | ValidatorTransactionResponse | BlockEpilogueTransactionResponse;
1045
- /**
1046
- * Determine if the given transaction response is currently pending.
1047
- *
1048
- * @param response - The transaction response to evaluate.
1049
- * @returns A boolean indicating whether the transaction is pending.
1050
- */
1051
- declare function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse;
1052
- /**
1053
- * Determines if the given transaction response is a user transaction.
1054
- *
1055
- * @param response - The transaction response to evaluate.
1056
- * @returns A boolean indicating whether the transaction is of type User.
1057
- */
1058
- declare function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse;
1059
- /**
1060
- * Determines if the given transaction response is a Genesis transaction.
1061
- *
1062
- * @param response - The transaction response to evaluate.
1063
- * @returns A boolean indicating whether the transaction is a Genesis transaction.
1064
- */
1065
- declare function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse;
1066
- /**
1067
- * Determine if the given transaction response is of type BlockMetadata.
1068
- *
1069
- * @param response - The transaction response to evaluate.
1070
- * @returns A boolean indicating whether the response is a BlockMetadata transaction.
1071
- */
1072
- declare function isBlockMetadataTransactionResponse(response: TransactionResponse): response is BlockMetadataTransactionResponse;
1073
- /**
1074
- * Determines if the provided transaction response is a state checkpoint transaction.
1075
- *
1076
- * @param response - The transaction response to evaluate.
1077
- * @returns A boolean indicating whether the transaction response is of type StateCheckpoint.
1078
- */
1079
- declare function isStateCheckpointTransactionResponse(response: TransactionResponse): response is StateCheckpointTransactionResponse;
1080
- /**
1081
- * Determine if the given transaction response is of type Validator.
1082
- *
1083
- * @param response - The transaction response to evaluate.
1084
- * @returns A boolean indicating whether the transaction response is a Validator type.
1085
- */
1086
- declare function isValidatorTransactionResponse(response: TransactionResponse): response is ValidatorTransactionResponse;
1087
- /**
1088
- * Determines if the given transaction response is of the type Block Epilogue.
1089
- *
1090
- * @param response - The transaction response to evaluate.
1091
- * @returns A boolean indicating whether the response is a Block Epilogue transaction.
1092
- */
1093
- declare function isBlockEpilogueTransactionResponse(response: TransactionResponse): response is BlockEpilogueTransactionResponse;
1094
- /**
1095
- * The response for a pending transaction, indicating that the transaction is still being processed.
1096
- */
1097
- type PendingTransactionResponse = {
1098
- type: TransactionResponseType.Pending;
1099
- hash: string;
1100
- sender: string;
1101
- sequence_number: string;
1102
- max_gas_amount: string;
1103
- gas_unit_price: string;
1104
- expiration_timestamp_secs: string;
1105
- payload: TransactionPayloadResponse;
1106
- signature?: TransactionSignature;
1107
- };
1108
- /**
1109
- * The response structure for a user transaction.
1110
- */
1111
- type UserTransactionResponse = {
1112
- type: TransactionResponseType.User;
1113
- version: string;
1114
- hash: string;
1115
- state_change_hash: string;
1116
- event_root_hash: string;
1117
- state_checkpoint_hash: string | null;
1118
- gas_used: string;
1119
- /**
1120
- * Whether the transaction was successful
1121
- */
1122
- success: boolean;
1123
- /**
1124
- * The VM status of the transaction, can tell useful information in a failure
1125
- */
1126
- vm_status: string;
1127
- accumulator_root_hash: string;
1128
- /**
1129
- * Final state of resources changed by the transaction
1130
- */
1131
- changes: Array<WriteSetChange>;
1132
- sender: string;
1133
- sequence_number: string;
1134
- max_gas_amount: string;
1135
- gas_unit_price: string;
1136
- expiration_timestamp_secs: string;
1137
- payload: TransactionPayloadResponse;
1138
- signature?: TransactionSignature;
1139
- /**
1140
- * Events generated by the transaction
1141
- */
1142
- events: Array<Event>;
1143
- timestamp: string;
1144
- };
1145
- /**
1146
- * The response for a genesis transaction, indicating the type of transaction.
1147
- */
1148
- type GenesisTransactionResponse = {
1149
- type: TransactionResponseType.Genesis;
1150
- version: string;
1151
- hash: string;
1152
- state_change_hash: string;
1153
- event_root_hash: string;
1154
- state_checkpoint_hash?: string;
1155
- gas_used: string;
1156
- /**
1157
- * Whether the transaction was successful
1158
- */
1159
- success: boolean;
1160
- /**
1161
- * The VM status of the transaction, can tell useful information in a failure
1162
- */
1163
- vm_status: string;
1164
- accumulator_root_hash: string;
1165
- /**
1166
- * Final state of resources changed by the transaction
1167
- */
1168
- changes: Array<WriteSetChange>;
1169
- payload: GenesisPayload;
1170
- /**
1171
- * Events emitted during genesis
1172
- */
1173
- events: Array<Event>;
1174
- };
1175
- /**
1176
- * The structure representing a blockchain block with its height.
1177
- */
1178
- type BlockMetadataTransactionResponse = {
1179
- type: TransactionResponseType.BlockMetadata;
1180
- version: string;
1181
- hash: string;
1182
- state_change_hash: string;
1183
- event_root_hash: string;
1184
- state_checkpoint_hash: string | null;
1185
- gas_used: string;
1186
- /**
1187
- * Whether the transaction was successful
1188
- */
1189
- success: boolean;
1190
- /**
1191
- * The VM status of the transaction, can tell useful information in a failure
1192
- */
1193
- vm_status: string;
1194
- accumulator_root_hash: string;
1195
- /**
1196
- * Final state of resources changed by the transaction
1197
- */
1198
- changes: Array<WriteSetChange>;
1199
- id: string;
1200
- epoch: string;
1201
- round: string;
1202
- /**
1203
- * The events emitted at the block creation
1204
- */
1205
- events: Array<Event>;
1206
- /**
1207
- * Previous block votes
1208
- */
1209
- previous_block_votes_bitvec: Array<number>;
1210
- proposer: string;
1211
- /**
1212
- * The indices of the proposers who failed to propose
1213
- */
1214
- failed_proposer_indices: Array<number>;
1215
- timestamp: string;
1216
- };
1217
- /**
1218
- * The response for a state checkpoint transaction, indicating the type of transaction.
1219
- */
1220
- type StateCheckpointTransactionResponse = {
1221
- type: TransactionResponseType.StateCheckpoint;
1222
- version: string;
1223
- hash: string;
1224
- state_change_hash: string;
1225
- event_root_hash: string;
1226
- state_checkpoint_hash: string | null;
1227
- gas_used: string;
1228
- /**
1229
- * Whether the transaction was successful
1230
- */
1231
- success: boolean;
1232
- /**
1233
- * The VM status of the transaction, can tell useful information in a failure
1234
- */
1235
- vm_status: string;
1236
- accumulator_root_hash: string;
1237
- /**
1238
- * Final state of resources changed by the transaction
1239
- */
1240
- changes: Array<WriteSetChange>;
1241
- timestamp: string;
1242
- };
1243
- /**
1244
- * The response for a validator transaction, indicating the type of transaction.
1245
- */
1246
- type ValidatorTransactionResponse = {
1247
- type: TransactionResponseType.Validator;
1248
- version: string;
1249
- hash: string;
1250
- state_change_hash: string;
1251
- event_root_hash: string;
1252
- state_checkpoint_hash: string | null;
1253
- gas_used: string;
1254
- /**
1255
- * Whether the transaction was successful
1256
- */
1257
- success: boolean;
1258
- /**
1259
- * The VM status of the transaction, can tell useful information in a failure
1260
- */
1261
- vm_status: string;
1262
- accumulator_root_hash: string;
1263
- /**
1264
- * Final state of resources changed by the transaction
1265
- */
1266
- changes: Array<WriteSetChange>;
1267
- /**
1268
- * The events emitted by the validator transaction
1269
- */
1270
- events: Array<Event>;
1271
- timestamp: string;
1272
- };
1273
- /**
1274
- * Describes the gas state of the block, indicating whether the block gas limit has been reached.
1275
- */
1276
- type BlockEndInfo = {
1277
- block_gas_limit_reached: boolean;
1278
- block_output_limit_reached: boolean;
1279
- block_effective_block_gas_units: number;
1280
- block_approx_output_size: number;
1281
- };
1282
- /**
1283
- * A transaction executed at the end of a block that tracks data from the entire block.
1284
- */
1285
- type BlockEpilogueTransactionResponse = {
1286
- type: TransactionResponseType.BlockEpilogue;
1287
- version: string;
1288
- hash: string;
1289
- state_change_hash: string;
1290
- event_root_hash: string;
1291
- state_checkpoint_hash: string | null;
1292
- gas_used: string;
1293
- /**
1294
- * Whether the transaction was successful
1295
- */
1296
- success: boolean;
1297
- /**
1298
- * The VM status of the transaction, can tell useful information in a failure
1299
- */
1300
- vm_status: string;
1301
- accumulator_root_hash: string;
1302
- /**
1303
- * Final state of resources changed by the transaction
1304
- */
1305
- changes: Array<WriteSetChange>;
1306
- timestamp: string;
1307
- block_end_info: BlockEndInfo | null;
1308
- };
1309
- /**
1310
- * WRITESET CHANGE TYPES
1311
- */
1312
- /**
1313
- * A union type that encompasses both script and direct write sets for data operations.
1314
- */
1315
- type WriteSetChange = WriteSetChangeDeleteModule | WriteSetChangeDeleteResource | WriteSetChangeDeleteTableItem | WriteSetChangeWriteModule | WriteSetChangeWriteResource | WriteSetChangeWriteTableItem;
1316
- /**
1317
- * The structure for a module deletion change in a write set.
1318
- */
1319
- type WriteSetChangeDeleteModule = {
1320
- type: string;
1321
- address: string;
1322
- /**
1323
- * State key hash
1324
- */
1325
- state_key_hash: string;
1326
- module: MoveModuleId;
1327
- };
1328
- /**
1329
- * The payload for a resource deletion in a write set change.
1330
- */
1331
- type WriteSetChangeDeleteResource = {
1332
- type: string;
1333
- address: string;
1334
- state_key_hash: string;
1335
- resource: string;
1336
- };
1337
- /**
1338
- * The payload for a write set change that deletes a table item.
1339
- */
1340
- type WriteSetChangeDeleteTableItem = {
1341
- type: string;
1342
- state_key_hash: string;
1343
- handle: string;
1344
- key: string;
1345
- data?: DeletedTableData;
1346
- };
1347
- /**
1348
- * The structure for a write module change in a write set.
1349
- */
1350
- type WriteSetChangeWriteModule = {
1351
- type: string;
1352
- address: string;
1353
- state_key_hash: string;
1354
- data: MoveModuleBytecode;
1355
- };
1356
- /**
1357
- * The resource associated with a write set change, identified by its type.
1358
- */
1359
- type WriteSetChangeWriteResource = {
1360
- type: string;
1361
- address: string;
1362
- state_key_hash: string;
1363
- data: MoveResource;
1364
- };
1365
- /**
1366
- * The structure for a write operation on a table in a write set change.
1367
- */
1368
- type WriteSetChangeWriteTableItem = {
1369
- type: string;
1370
- state_key_hash: string;
1371
- handle: string;
1372
- key: string;
1373
- value: string;
1374
- data?: DecodedTableData;
1375
- };
1376
- /**
1377
- * The decoded data for a table, including its key in JSON format.
1378
- */
1379
- type DecodedTableData = {
1380
- /**
1381
- * Key of table in JSON
1382
- */
1383
- key: any;
1384
- /**
1385
- * Type of key
1386
- */
1387
- key_type: string;
1388
- /**
1389
- * Value of table in JSON
1390
- */
1391
- value: any;
1392
- /**
1393
- * Type of value
1394
- */
1395
- value_type: string;
1396
- };
1397
- /**
1398
- * Data for a deleted table entry.
1399
- */
1400
- type DeletedTableData = {
1401
- /**
1402
- * Deleted key
1403
- */
1404
- key: any;
1405
- /**
1406
- * Deleted key type
1407
- */
1408
- key_type: string;
1409
- };
1410
- /**
1411
- * The payload for a transaction response, which can be an entry function, script, or multisig payload.
1412
- */
1413
- type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;
1414
- /**
1415
- * The response payload for an entry function, containing the type of the entry.
1416
- */
1417
- type EntryFunctionPayloadResponse = {
1418
- type: string;
1419
- function: MoveFunctionId;
1420
- /**
1421
- * Type arguments of the function
1422
- */
1423
- type_arguments: Array<string>;
1424
- /**
1425
- * Arguments of the function
1426
- */
1427
- arguments: Array<any>;
1428
- };
1429
- /**
1430
- * The payload for a script response, containing the type of the script.
1431
- */
1432
- type ScriptPayloadResponse = {
1433
- type: string;
1434
- code: MoveScriptBytecode;
1435
- /**
1436
- * Type arguments of the function
1437
- */
1438
- type_arguments: Array<string>;
1439
- /**
1440
- * Arguments of the function
1441
- */
1442
- arguments: Array<any>;
1443
- };
1444
- /**
1445
- * The response payload for a multisig transaction, containing the type of the transaction.
1446
- */
1447
- type MultisigPayloadResponse = {
1448
- type: string;
1449
- multisig_address: string;
1450
- transaction_payload?: EntryFunctionPayloadResponse;
1451
- };
1452
- /**
1453
- * The payload for the genesis block containing the type of the payload.
1454
- */
1455
- type GenesisPayload = {
1456
- type: string;
1457
- write_set: WriteSet;
1458
- };
1459
- /**
1460
- * The bytecode for a Move script.
1461
- */
1462
- type MoveScriptBytecode = {
1463
- bytecode: string;
1464
- abi?: MoveFunction;
1465
- };
1466
- /**
1467
- * JSON representations of transaction signatures returned from the node API.
1468
- */
1469
- type TransactionSignature = TransactionEd25519Signature | TransactionSecp256k1Signature | TransactionMultiEd25519Signature | TransactionMultiAgentSignature | TransactionFeePayerSignature;
1470
- /**
1471
- * Determine if the provided signature is an Ed25519 signature.
1472
- * This function checks for the presence of the "signature" property
1473
- * and verifies that its value is "ed25519_signature".
1474
- *
1475
- * @param signature - The transaction signature to be checked.
1476
- * @returns A boolean indicating whether the signature is an Ed25519 signature.
1477
- */
1478
- declare function isEd25519Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
1479
- /**
1480
- * Determine if the provided signature is a valid secp256k1 ECDSA signature.
1481
- *
1482
- * @param signature - The transaction signature to validate.
1483
- * @returns A boolean indicating whether the signature is a secp256k1 ECDSA signature.
1484
- */
1485
- declare function isSecp256k1Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
1486
- /**
1487
- * Determine if the provided transaction signature is a multi-agent signature.
1488
- *
1489
- * @param signature - The transaction signature to evaluate.
1490
- * @returns A boolean indicating whether the signature is a multi-agent signature.
1491
- */
1492
- declare function isMultiAgentSignature(signature: TransactionSignature): signature is TransactionMultiAgentSignature;
1493
- /**
1494
- * Determine if the provided signature is a fee payer signature.
1495
- *
1496
- * @param signature - The transaction signature to evaluate.
1497
- * @returns A boolean indicating whether the signature is a fee payer signature.
1498
- */
1499
- declare function isFeePayerSignature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
1500
- /**
1501
- * Determine if the provided signature is of type "multi_ed25519_signature".
1502
- *
1503
- * @param signature - The transaction signature to check.
1504
- * @returns A boolean indicating whether the signature is a multi-ed25519 signature.
1505
- */
1506
- declare function isMultiEd25519Signature(signature: TransactionSignature): signature is TransactionMultiEd25519Signature;
1507
- /**
1508
- * The signature for a transaction using the Ed25519 algorithm.
1509
- */
1510
- type TransactionEd25519Signature = {
1511
- type: string;
1512
- public_key: string;
1513
- signature: "ed25519_signature";
1514
- };
1515
- /**
1516
- * The structure for a Secp256k1 signature in a transaction.
1517
- */
1518
- type TransactionSecp256k1Signature = {
1519
- type: string;
1520
- public_key: string;
1521
- signature: "secp256k1_ecdsa_signature";
1522
- };
1523
- /**
1524
- * The structure for a multi-signature transaction using Ed25519.
1525
- */
1526
- type TransactionMultiEd25519Signature = {
1527
- type: "multi_ed25519_signature";
1528
- /**
1529
- * The public keys for the Ed25519 signature
1530
- */
1531
- public_keys: Array<string>;
1532
- /**
1533
- * Signature associated with the public keys in the same order
1534
- */
1535
- signatures: Array<string>;
1536
- /**
1537
- * The number of signatures required for a successful transaction
1538
- */
1539
- threshold: number;
1540
- bitmap: string;
1541
- };
1542
- /**
1543
- * The structure for a multi-agent signature in a transaction.
1544
- */
1545
- type TransactionMultiAgentSignature = {
1546
- type: "multi_agent_signature";
1547
- sender: AccountSignature;
1548
- /**
1549
- * The other involved parties' addresses
1550
- */
1551
- secondary_signer_addresses: Array<string>;
1552
- /**
1553
- * The associated signatures, in the same order as the secondary addresses
1554
- */
1555
- secondary_signers: Array<AccountSignature>;
1556
- };
1557
- /**
1558
- * The signature of the fee payer in a transaction.
1559
- */
1560
- type TransactionFeePayerSignature = {
1561
- type: "fee_payer_signature";
1562
- sender: AccountSignature;
1563
- /**
1564
- * The other involved parties' addresses
1565
- */
1566
- secondary_signer_addresses: Array<string>;
1567
- /**
1568
- * The associated signatures, in the same order as the secondary addresses
1569
- */
1570
- secondary_signers: Array<AccountSignature>;
1571
- fee_payer_address: string;
1572
- fee_payer_signer: AccountSignature;
1573
- };
1574
- /**
1575
- * The union of all single account signatures, including Ed25519, Secp256k1, and MultiEd25519 signatures.
1576
- */
1577
- type AccountSignature = TransactionEd25519Signature | TransactionSecp256k1Signature | TransactionMultiEd25519Signature;
1578
- type WriteSet = ScriptWriteSet | DirectWriteSet;
1579
- /**
1580
- * The set of properties for writing scripts, including the type of script.
1581
- */
1582
- type ScriptWriteSet = {
1583
- type: string;
1584
- execute_as: string;
1585
- script: ScriptPayloadResponse;
1586
- };
1587
- /**
1588
- * The set of direct write operations, identified by a type string.
1589
- */
1590
- type DirectWriteSet = {
1591
- type: string;
1592
- changes: Array<WriteSetChange>;
1593
- events: Array<Event>;
1594
- };
1595
- /**
1596
- * The structure for an event's unique identifier, including its creation number.
1597
- */
1598
- /**
1599
- * The structure for an event, identified by a unique GUID.
1600
- */
1601
- type EventGuid = {
1602
- creation_number: string;
1603
- account_address: string;
1604
- };
1605
- type Event = {
1606
- guid: EventGuid;
1607
- sequence_number: string;
1608
- type: string;
1609
- /**
1610
- * The JSON representation of the event
1611
- */
1612
- data: any;
1613
- };
1614
- /**
1615
- * A number representing a Move uint8 type.
1616
- */
1617
- type MoveUint8Type = number;
1618
- /**
1619
- * A 16-bit unsigned integer used in the Move programming language.
1620
- */
1621
- type MoveUint16Type = number;
1622
- /**
1623
- * A 32-bit unsigned integer type used in Move programming.
1624
- */
1625
- type MoveUint32Type = number;
1626
- /**
1627
- * A string representation of a 64-bit unsigned integer used in Move programming.
1628
- */
1629
- type MoveUint64Type = string;
1630
- /**
1631
- * A string representing a 128-bit unsigned integer in the Move programming language.
1632
- */
1633
- type MoveUint128Type = string;
1634
- /**
1635
- * A string representation of a 256-bit unsigned integer used in Move programming.
1636
- */
1637
- type MoveUint256Type = string;
1638
- /**
1639
- * A string representing a Move address.
1640
- */
1641
- type MoveAddressType = string;
1642
- /**
1643
- * The type for identifying objects to be moved within the system.
1644
- */
1645
- type MoveObjectType = string;
1646
- /**
1647
- * The type for move options, which can be a MoveType, null, or undefined.
1648
- */
1649
- type MoveOptionType = MoveType | null | undefined;
1650
- /**
1651
- * A structure representing a move with a name.
1652
- */
1653
- type MoveStructId = `${string}::${string}::${string}`;
1654
- /**
1655
- * The move function containing its name. Same as MoveStructId since it reads weird to take a StructId for a Function.
1656
- */
1657
- type MoveFunctionId = MoveStructId;
1658
- type MoveStructType = {};
1659
- /**
1660
- * A union type that encompasses various data types used in Move, including primitive types, address types, object types, and
1661
- * arrays of MoveType.
1662
- */
1663
- type MoveType = boolean | string | MoveUint8Type | MoveUint16Type | MoveUint32Type | MoveUint64Type | MoveUint128Type | MoveUint256Type | MoveAddressType | MoveObjectType | MoveStructType | Array<MoveType>;
1664
- /**
1665
- * Possible Move values acceptable by move functions (entry, view)
1666
- *
1667
- * Map of a Move value to the corresponding TypeScript value
1668
- *
1669
- * `Bool -> boolean`
1670
- *
1671
- * `u8, u16, u32 -> number`
1672
- *
1673
- * `u64, u128, u256 -> string`
1674
- *
1675
- * `String -> string`
1676
- *
1677
- * `Address -> 0x${string}`
1678
- *
1679
- * `Struct - 0x${string}::${string}::${string}`
1680
- *
1681
- * `Object -> 0x${string}`
1682
- *
1683
- * `Vector -> Array<MoveValue>`
1684
- *
1685
- * `Option -> MoveValue | null | undefined`
1686
- */
1687
- type MoveValue = boolean | string | MoveUint8Type | MoveUint16Type | MoveUint32Type | MoveUint64Type | MoveUint128Type | MoveUint256Type | MoveAddressType | MoveObjectType | MoveStructId | MoveOptionType | Array<MoveValue>;
1688
- /**
1689
- * A string representation of a Move module, formatted as `module_name::function_name`.
1690
- * Module names are case-sensitive.
1691
- */
1692
- type MoveModuleId = `${string}::${string}`;
1693
- /**
1694
- * Specifies the visibility levels for move functions, controlling access permissions.
1695
- */
1696
- declare enum MoveFunctionVisibility {
1697
- PRIVATE = "private",
1698
- PUBLIC = "public",
1699
- FRIEND = "friend"
1700
- }
1701
- /**
1702
- * Abilities related to moving items within the system.
1703
- */
1704
- declare enum MoveAbility {
1705
- STORE = "store",
1706
- DROP = "drop",
1707
- KEY = "key",
1708
- COPY = "copy"
1709
- }
1710
- /**
1711
- * Move abilities associated with the generic type parameter of a function.
1712
- */
1713
- type MoveFunctionGenericTypeParam = {
1714
- constraints: Array<MoveAbility>;
1715
- };
1716
- /**
1717
- * A field in a Move struct, identified by its name.
1718
- */
1719
- type MoveStructField = {
1720
- name: string;
1721
- type: string;
1722
- };
1723
- /**
1724
- * A Move module
1725
- */
1726
- type MoveModule = {
1727
- address: string;
1728
- name: string;
1729
- /**
1730
- * Friends of the module
1731
- */
1732
- friends: Array<MoveModuleId>;
1733
- /**
1734
- * Public functions of the module
1735
- */
1736
- exposed_functions: Array<MoveFunction>;
1737
- /**
1738
- * Structs of the module
1739
- */
1740
- structs: Array<MoveStruct>;
1741
- };
1742
- /**
1743
- * A move struct
1744
- */
1745
- type MoveStruct = {
1746
- name: string;
1747
- /**
1748
- * Whether the struct is a native struct of Move
1749
- */
1750
- is_native: boolean;
1751
- /**
1752
- * Whether the struct is a module event (aka v2 event). This will be false for v1
1753
- * events because the value is derived from the #[event] attribute on the struct in
1754
- * the Move source code. This attribute is only relevant for v2 events.
1755
- */
1756
- is_event: boolean;
1757
- /**
1758
- * Abilities associated with the struct
1759
- */
1760
- abilities: Array<MoveAbility>;
1761
- /**
1762
- * Generic types associated with the struct
1763
- */
1764
- generic_type_params: Array<MoveFunctionGenericTypeParam>;
1765
- /**
1766
- * Fields associated with the struct
1767
- */
1768
- fields: Array<MoveStructField>;
1769
- };
1770
- /**
1771
- * Move function
1772
- */
1773
- type MoveFunction = {
1774
- name: string;
1775
- visibility: MoveFunctionVisibility;
1776
- /**
1777
- * Whether the function can be called as an entry function directly in a transaction
1778
- */
1779
- is_entry: boolean;
1780
- /**
1781
- * Whether the function is a view function or not
1782
- */
1783
- is_view: boolean;
1784
- /**
1785
- * Generic type params associated with the Move function
1786
- */
1787
- generic_type_params: Array<MoveFunctionGenericTypeParam>;
1788
- /**
1789
- * Parameters associated with the move function
1790
- */
1791
- params: Array<string>;
1792
- /**
1793
- * Return type of the function
1794
- */
1795
- return: Array<string>;
1796
- };
1797
- /**
1798
- * Roles that can be assigned within the system, indicating different levels of access and functionality.
1799
- */
1800
- declare enum RoleType {
1801
- VALIDATOR = "validator",
1802
- FULL_NODE = "full_node"
1803
- }
1804
- /**
1805
- * Information about the current blockchain ledger, including its chain ID.
1806
- */
1807
- type LedgerInfo = {
1808
- /**
1809
- * Chain ID of the current chain
1810
- */
1811
- chain_id: number;
1812
- epoch: string;
1813
- ledger_version: string;
1814
- oldest_ledger_version: string;
1815
- ledger_timestamp: string;
1816
- node_role: RoleType;
1817
- oldest_block_height: string;
1818
- block_height: string;
1819
- /**
1820
- * Git hash of the build of the API endpoint. Can be used to determine the exact
1821
- * software version used by the API endpoint.
1822
- */
1823
- git_hash?: string;
1824
- };
1825
- /**
1826
- * A Block type
1827
- */
1828
- type Block = {
1829
- block_height: string;
1830
- block_hash: string;
1831
- block_timestamp: string;
1832
- first_version: string;
1833
- last_version: string;
1834
- /**
1835
- * The transactions in the block in sequential order
1836
- */
1837
- transactions?: Array<TransactionResponse>;
1838
- };
1839
- /**
1840
- * The request payload for the GetTableItem API.
1841
- */
1842
- type TableItemRequest = {
1843
- key_type: MoveValue;
1844
- value_type: MoveValue;
1845
- /**
1846
- * The value of the table item's key
1847
- */
1848
- key: any;
1849
- };
1850
- /**
1851
- * A list of supported Authentication Key schemes in Aptos, consisting of combinations of signing schemes and derive schemes.
1852
- */
1853
- type AuthenticationKeyScheme = SigningScheme | DeriveScheme;
1854
- /**
1855
- * Different schemes for signing keys used in cryptographic operations.
1856
- */
1857
- declare enum SigningScheme {
1858
- /**
1859
- * For Ed25519PublicKey
1860
- */
1861
- Ed25519 = 0,
1862
- /**
1863
- * For MultiEd25519PublicKey
1864
- */
1865
- MultiEd25519 = 1,
1866
- /**
1867
- * For SingleKey ecdsa
1868
- */
1869
- SingleKey = 2,
1870
- MultiKey = 3
1871
- }
1872
- /**
1873
- * Specifies the signing schemes available for cryptographic operations.
1874
- */
1875
- declare enum SigningSchemeInput {
1876
- /**
1877
- * For Ed25519PublicKey
1878
- */
1879
- Ed25519 = 0,
1880
- /**
1881
- * For Secp256k1Ecdsa
1882
- */
1883
- Secp256k1Ecdsa = 2
1884
- }
1885
- /**
1886
- * Specifies the schemes for deriving account addresses from various data sources.
1887
- */
1888
- declare enum DeriveScheme {
1889
- /**
1890
- * Derives an address using an AUID, used for objects
1891
- */
1892
- DeriveAuid = 251,
1893
- /**
1894
- * Derives an address from another object address
1895
- */
1896
- DeriveObjectAddressFromObject = 252,
1897
- /**
1898
- * Derives an address from a GUID, used for objects
1899
- */
1900
- DeriveObjectAddressFromGuid = 253,
1901
- /**
1902
- * Derives an address from seed bytes, used for named objects
1903
- */
1904
- DeriveObjectAddressFromSeed = 254,
1905
- /**
1906
- * Derives an address from seed bytes, used for resource accounts
1907
- */
1908
- DeriveResourceAccountAddress = 255
1909
- }
1910
- /**
1911
- * Options for configuring the behavior of the waitForTransaction() function.
1912
- */
1913
- type WaitForTransactionOptions = {
1914
- timeoutSecs?: number;
1915
- checkSuccess?: boolean;
1916
- waitForIndexer?: boolean;
1917
- };
1918
- /**
1919
- * Input type to generate an account using the Ed25519 signing scheme.
1920
- */
1921
- type GenerateAccountWithEd25519 = {
1922
- scheme: SigningSchemeInput.Ed25519;
1923
- legacy: boolean;
1924
- };
1925
- /**
1926
- * Input type to generate an account with a Single Signer using Secp256k1.
1927
- */
1928
- type GenerateAccountWithSingleSignerSecp256k1Key = {
1929
- scheme: SigningSchemeInput.Secp256k1Ecdsa;
1930
- legacy?: false;
1931
- };
1932
- type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;
1933
-
1934
- /**
1935
- * This interface exists to define Deserializable<T> inputs for functions that
1936
- * deserialize a byte buffer into a type T.
1937
- * It is not intended to be implemented or extended, because Typescript has no support
1938
- * for static methods in interfaces.
1939
- *
1940
- * @template T - The type that this will deserialize into.
1941
- * @group Implementation
1942
- * @category BCS
1943
- */
1944
- interface Deserializable<T> {
1945
- /**
1946
- * Deserializes the buffered bytes into an instance of the specified class type.
1947
- * This function provides an alternative syntax for deserialization, allowing users to call
1948
- * `deserializer.deserialize(MyClass)` instead of `MyClass.deserialize(deserializer)`.
1949
- *
1950
- * @param deserializer - The deserializer instance with the buffered bytes.
1951
- * @returns The deserialized value of class type T.
1952
- * @example
1953
- * ```typescript
1954
- * const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
1955
- * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function
1956
- * // value is now an instance of MyClass
1957
- * // equivalent to `const value = MyClass.deserialize(deserializer)`
1958
- * ```
1959
- * @group Implementation
1960
- * @category BCS
1961
- */
1962
- deserialize(deserializer: Deserializer): T;
1963
- }
1964
- /**
1965
- * A class that provides methods for deserializing various data types from a byte buffer.
1966
- * It supports deserialization of primitive types, strings, and complex objects using a BCS (Binary Common Serialization) layout.
1967
- * @group Implementation
1968
- * @category BCS
1969
- */
1970
- declare class Deserializer {
1971
- private buffer;
1972
- private offset;
1973
- /**
1974
- * Creates a new instance of the class with a copy of the provided data buffer.
1975
- * This prevents outside mutation of the buffer.
1976
- *
1977
- * @param data - The data to be copied into the internal buffer as a Uint8Array.
1978
- * @group Implementation
1979
- * @category BCS
1980
- */
1981
- constructor(data: Uint8Array);
1982
- static fromHex(hex: HexInput): Deserializer;
1983
- /**
1984
- * Reads a specified number of bytes from the buffer and advances the offset.
1985
- *
1986
- * @param length - The number of bytes to read from the buffer.
1987
- * @throws Throws an error if the read operation exceeds the buffer's length.
1988
- * @group Implementation
1989
- * @category BCS
1990
- */
1991
- private read;
1992
- /**
1993
- * Returns the number of bytes remaining in the buffer.
1994
- *
1995
- * This information is useful to determine if there's more data to be read.
1996
- *
1997
- * @returns The number of bytes remaining in the buffer.
1998
- * @group Implementation
1999
- * @category BCS
2000
- */
2001
- remaining(): number;
2002
- /**
2003
- * Asserts that the buffer has no remaining bytes.
2004
- *
2005
- * @throws {Error} Throws an error if there are remaining bytes in the buffer.
2006
- * @group Implementation
2007
- * @category BCS
2008
- */
2009
- assertFinished(): void;
2010
- /**
2011
- * Deserializes a UTF-8 encoded string from a byte array. It first reads the length of the string in bytes,
2012
- * followed by the actual byte content, and decodes it into a string.
2013
- *
2014
- * BCS layout for "string": string_length | string_content
2015
- * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
2016
- *
2017
- * @example
2018
- * ```typescript
2019
- * const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
2020
- * assert(deserializer.deserializeStr() === "1234abcd");
2021
- * ```
2022
- * @group Implementation
2023
- * @category BCS
2024
- */
2025
- deserializeStr(): string;
2026
- /**
2027
- * @deprecated use `deserializeOption("string")` instead.
2028
- *
2029
- * The BCS layout for Optional<String> is 0 if none, else 1 followed by the string length and string content.
2030
- * @returns The deserialized string if it exists, otherwise undefined.
2031
- * @example
2032
- * ```typescript
2033
- * const deserializer = new Deserializer(new Uint8Array([0x00]));
2034
- * assert(deserializer.deserializeOptionStr() === undefined);
2035
- * const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
2036
- * assert(deserializer.deserializeOptionStr() === "1234abcd");
2037
- * ```
2038
- */
2039
- deserializeOptionStr(): string | undefined;
2040
- /**
2041
- * Deserializes an optional value from the buffer.
2042
- *
2043
- * The BCS layout for Optional<T> starts with a boolean byte (0 if none, 1 if some),
2044
- * followed by the value if present.
2045
- *
2046
- * @template T - The type of the value to deserialize
2047
- * @param type - Either a Deserializable class or one of the string literals: "string", "bytes", or "fixedBytes"
2048
- * @param len - Required length when type is "fixedBytes", ignored otherwise
2049
- * @returns The deserialized value if present, undefined otherwise
2050
- *
2051
- * @throws {Error} When "fixedBytes" is specified without a length
2052
- *
2053
- * @example
2054
- * ```typescript
2055
- * // Deserialize an optional string
2056
- * const deserializer = new Deserializer(new Uint8Array([1, 3, 97, 98, 99]));
2057
- * const optStr = deserializer.deserializeOption("string");
2058
- * // optStr === "abc"
2059
- *
2060
- * // Deserialize an optional custom type
2061
- * const deserializer = new Deserializer(new Uint8Array([0]));
2062
- * const optValue = deserializer.deserializeOption(MyClass);
2063
- * // optValue === undefined
2064
- *
2065
- * // Deserialize optional bytes
2066
- * const deserializer = new Deserializer(new Uint8Array([1, 3, 1, 2, 3]));
2067
- * const optBytes = deserializer.deserializeOption("bytes");
2068
- * // optBytes === Uint8Array[1, 2, 3]
2069
- *
2070
- * // Deserialize optional fixed bytes
2071
- * const deserializer = new Deserializer(new Uint8Array([1, 1, 2, 3, 4]));
2072
- * const optBytes = deserializer.deserializeOption("fixedBytes", 4);
2073
- * // optBytes === Uint8Array[1, 2, 3, 4]
2074
- * ```
2075
- * @group Implementation
2076
- * @category BCS
2077
- */
2078
- deserializeOption(type: "string"): string | undefined;
2079
- deserializeOption(type: "bytes"): Uint8Array | undefined;
2080
- deserializeOption(type: "fixedBytes", len: number): Uint8Array | undefined;
2081
- deserializeOption<T>(type: Deserializable<T>): T | undefined;
2082
- /**
2083
- * Deserializes an array of bytes.
2084
- *
2085
- * The BCS layout for "bytes" consists of a bytes_length followed by the bytes themselves, where bytes_length is a u32 integer
2086
- * encoded as a uleb128 integer, indicating the length of the bytes array.
2087
- *
2088
- * @returns {Uint8Array} The deserialized array of bytes.
2089
- * @group Implementation
2090
- * @category BCS
2091
- */
2092
- deserializeBytes(): Uint8Array;
2093
- /**
2094
- * Deserializes an array of bytes of a specified length.
2095
- *
2096
- * @param len - The number of bytes to read from the source.
2097
- * @group Implementation
2098
- * @category BCS
2099
- */
2100
- deserializeFixedBytes(len: number): Uint8Array;
2101
- /**
2102
- * Deserializes a boolean value from a byte stream.
2103
- *
2104
- * The BCS layout for a boolean uses one byte, where "0x01" represents true and "0x00" represents false.
2105
- * An error is thrown if the byte value is not valid.
2106
- *
2107
- * @returns The deserialized boolean value.
2108
- * @throws Throws an error if the boolean value is invalid.
2109
- * @group Implementation
2110
- * @category BCS
2111
- */
2112
- deserializeBool(): boolean;
2113
- /**
2114
- * Deserializes a uint8 number from the binary data.
2115
- *
2116
- * BCS layout for "uint8": One byte. Binary format in little-endian representation.
2117
- *
2118
- * @returns {number} The deserialized uint8 number.
2119
- * @group Implementation
2120
- * @category BCS
2121
- */
2122
- deserializeU8(): Uint8;
2123
- /**
2124
- * Deserializes a uint16 number from a binary format in little-endian representation.
2125
- *
2126
- * BCS layout for "uint16": Two bytes.
2127
- * @example
2128
- * ```typescript
2129
- * const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));
2130
- * assert(deserializer.deserializeU16() === 4660);
2131
- * ```
2132
- * @group Implementation
2133
- * @category BCS
2134
- */
2135
- deserializeU16(): Uint16;
2136
- /**
2137
- * Deserializes a uint32 number from a binary format in little-endian representation.
2138
- *
2139
- * BCS layout for "uint32": Four bytes.
2140
- * @example
2141
- * ```typescript
2142
- * const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));
2143
- * assert(deserializer.deserializeU32() === 305419896);
2144
- * ```
2145
- * @group Implementation
2146
- * @category BCS
2147
- */
2148
- deserializeU32(): Uint32;
2149
- /**
2150
- * Deserializes a uint64 number.
2151
- *
2152
- * This function combines two 32-bit values to return a 64-bit unsigned integer in little-endian representation.
2153
- * @example
2154
- * ```typescript
2155
- * const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
2156
- * assert(deserializer.deserializeU64() === 1311768467750121216);
2157
- * ```
2158
- * @group Implementation
2159
- * @category BCS
2160
- */
2161
- deserializeU64(): Uint64;
2162
- /**
2163
- * Deserializes a uint128 number from its binary representation.
2164
- * This function combines two 64-bit values to return a single uint128 value in little-endian format.
2165
- *
2166
- * @returns {BigInt} The deserialized uint128 number.
2167
- * @group Implementation
2168
- * @category BCS
2169
- */
2170
- deserializeU128(): Uint128;
2171
- /**
2172
- * Deserializes a uint256 number from its binary representation.
2173
- *
2174
- * The BCS layout for "uint256" consists of thirty-two bytes in little-endian format.
2175
- *
2176
- * @returns {BigInt} The deserialized uint256 number.
2177
- * @group Implementation
2178
- * @category BCS
2179
- */
2180
- deserializeU256(): Uint256;
2181
- /**
2182
- * Deserializes a uleb128 encoded uint32 number.
2183
- *
2184
- * This function is used for interpreting lengths of variable-length sequences and tags of enum values in BCS encoding.
2185
- *
2186
- * @throws {Error} Throws an error if the parsed value exceeds the maximum uint32 number.
2187
- * @returns {number} The deserialized uint32 value.
2188
- * @group Implementation
2189
- * @category BCS
2190
- */
2191
- deserializeUleb128AsU32(): Uint32;
2192
- /**
2193
- * Helper function that primarily exists to support alternative syntax for deserialization.
2194
- * That is, if we have a `const deserializer: new Deserializer(...)`, instead of having to use
2195
- * `MyClass.deserialize(deserializer)`, we can call `deserializer.deserialize(MyClass)`.
2196
- *
2197
- * @example const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
2198
- * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function
2199
- * // value is now an instance of MyClass
2200
- * // equivalent to `const value = MyClass.deserialize(deserializer)`
2201
- * @param cls The BCS-deserializable class to deserialize the buffered bytes into.
2202
- *
2203
- * @returns the deserialized value of class type T
2204
- * @group Implementation
2205
- * @category BCS
2206
- */
2207
- deserialize<T>(cls: Deserializable<T>): T;
2208
- /**
2209
- * Deserializes an array of BCS Deserializable values given an existing Deserializer instance with a loaded byte buffer.
2210
- *
2211
- * @param cls The BCS-deserializable class to deserialize the buffered bytes into.
2212
- * @returns An array of deserialized values of type T.
2213
- * @example
2214
- * // serialize a vector of addresses
2215
- * const addresses = new Array<AccountAddress>(
2216
- * AccountAddress.from("0x1"),
2217
- * AccountAddress.from("0x2"),
2218
- * AccountAddress.from("0xa"),
2219
- * AccountAddress.from("0xb"),
2220
- * );
2221
- * const serializer = new Serializer();
2222
- * serializer.serializeVector(addresses);
2223
- * const serializedBytes = serializer.toUint8Array();
2224
- *
2225
- * // deserialize the bytes into an array of addresses
2226
- * const deserializer = new Deserializer(serializedBytes);
2227
- * const deserializedAddresses = deserializer.deserializeVector(AccountAddress);
2228
- * // deserializedAddresses is now an array of AccountAddress instances
2229
- * @group Implementation
2230
- * @category BCS
2231
- */
2232
- deserializeVector<T>(cls: Deserializable<T>): Array<T>;
2233
- }
2234
-
2235
- /**
2236
- * This error is used to explain why parsing failed.
2237
- * @group Implementation
2238
- * @category Serialization
2239
- */
2240
- declare class ParsingError<T> extends Error {
2241
- /**
2242
- * This provides a programmatic way to access why parsing failed. Downstream devs
2243
- * might want to use this to build their own error messages if the default error
2244
- * messages are not suitable for their use case. This should be an enum.
2245
- * @group Implementation
2246
- * @category Serialization
2247
- */
2248
- invalidReason: T;
2249
- /**
2250
- * Creates an instance of the error with a specified message and invalid reason.
2251
- *
2252
- * @param message The error message that describes the issue.
2253
- * @param invalidReason The reason why the input is considered invalid.
2254
- * @group Implementation
2255
- * @category Serialization
2256
- */
2257
- constructor(message: string, invalidReason: T);
2258
- }
2259
- /**
2260
- * Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function,
2261
- * this type is returned from "defensive" functions like isValid.
2262
- * @group Implementation
2263
- * @category Serialization
2264
- */
2265
- type ParsingResult<T> = {
2266
- /**
2267
- * True if valid, false otherwise.
2268
- * @group Implementation
2269
- * @category Serialization
2270
- */
2271
- valid: boolean;
2272
- /**
2273
- * If valid is false, this will be a code explaining why parsing failed.
2274
- * @group Implementation
2275
- * @category Serialization
2276
- */
2277
- invalidReason?: T;
2278
- /**
2279
- * If valid is false, this will be a string explaining why parsing failed.
2280
- * @group Implementation
2281
- * @category Serialization
2282
- */
2283
- invalidReasonMessage?: string;
2284
- };
2285
-
2286
- /**
2287
- * Provides reasons for parsing failures related to hexadecimal values.
2288
- * @group Implementation
2289
- * @category Serialization
2290
- */
2291
- declare enum HexInvalidReason {
2292
- TOO_SHORT = "too_short",
2293
- INVALID_LENGTH = "invalid_length",
2294
- INVALID_HEX_CHARS = "invalid_hex_chars"
2295
- }
2296
- /**
2297
- * NOTE: Do not use this class when working with account addresses; use AccountAddress instead.
2298
- * When accepting hex data as input to a function, prefer to accept HexInput and
2299
- *
2300
- * A helper class for working with hex data. Hex data, when represented as a string,
2301
- * generally looks like this, for example: 0xaabbcc, 45cd32, etc.
2302
- *
2303
- * then use the static helper methods of this class to convert it into the desired
2304
- * format. This enables the greatest flexibility for the developer.
2305
- *
2306
- * Example usage:
2307
- * ```typescript
2308
- * getTransactionByHash(txnHash: HexInput): Promise<Transaction> {
2309
- * const txnHashString = Hex.fromHexInput(txnHash).toString();
2310
- * return await getTransactionByHashInner(txnHashString);
2311
- * }
2312
- * ```
2313
- * This call to `Hex.fromHexInput().toString()` converts the HexInput to a hex string
2314
- * with a leading 0x prefix, regardless of what the input format was.
2315
- *
2316
- * Other ways to chain the functions together:
2317
- * - `Hex.fromHexString({ hexInput: "0x1f" }).toUint8Array()`
2318
- * - `new Hex([1, 3]).toStringWithoutPrefix()`
2319
- * @group Implementation
2320
- * @category Serialization
2321
- */
2322
- declare class Hex {
2323
- private readonly data;
2324
- /**
2325
- * Create a new Hex instance from a Uint8Array.
2326
- *
2327
- * @param data - The Uint8Array containing the data to initialize the Hex instance.
2328
- * @group Implementation
2329
- * @category Serialization
2330
- */
2331
- constructor(data: Uint8Array);
2332
- /**
2333
- * Get the inner hex data as a Uint8Array. The inner data is already a Uint8Array, so no conversion takes place.
2334
- *
2335
- * @returns Hex data as Uint8Array
2336
- * @group Implementation
2337
- * @category Serialization
2338
- */
2339
- toUint8Array(): Uint8Array;
2340
- /**
2341
- * Get the hex data as a string without the 0x prefix.
2342
- *
2343
- * @returns Hex string without 0x prefix
2344
- * @group Implementation
2345
- * @category Serialization
2346
- */
2347
- toStringWithoutPrefix(): string;
2348
- /**
2349
- * Get the hex data as a string with the 0x prefix.
2350
- *
2351
- * @returns Hex string with 0x prefix
2352
- * @group Implementation
2353
- * @category Serialization
2354
- */
2355
- toString(): string;
2356
- /**
2357
- * Converts a hex string into a Hex instance, allowing for both prefixed and non-prefixed formats.
2358
- *
2359
- * @param str - A hex string, with or without the 0x prefix.
2360
- *
2361
- * @throws ParsingError - If the hex string is too short, has an odd number of characters, or contains invalid hex characters.
2362
- *
2363
- * @returns Hex - The resulting Hex instance created from the provided string.
2364
- * @group Implementation
2365
- * @category Serialization
2366
- */
2367
- static fromHexString(str: string): Hex;
2368
- /**
2369
- * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Hex instance.
2370
- * This function is useful for transforming hexadecimal representations into a structured Hex object for further manipulation.
2371
- *
2372
- * @param hexInput - A HexInput which can be a string or Uint8Array.
2373
- * @returns A Hex instance created from the provided hexInput.
2374
- * @group Implementation
2375
- * @category Serialization
2376
- */
2377
- static fromHexInput(hexInput: HexInput): Hex;
2378
- /**
2379
- * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Uint8Array.
2380
- *
2381
- * @param hexInput - A HexInput which can be a string or Uint8Array.
2382
- * @returns A Uint8Array created from the provided hexInput.
2383
- */
2384
- static hexInputToUint8Array(hexInput: HexInput): Uint8Array;
2385
- /**
2386
- * Converts a HexInput (string or Uint8Array) to a hex string with '0x' prefix.
2387
- *
2388
- * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array
2389
- * @returns A hex string with '0x' prefix (e.g., "0x1234")
2390
- *
2391
- * @example
2392
- * ```typescript
2393
- * Hex.hexInputToString("1234") // returns "0x1234"
2394
- * Hex.hexInputToString("0x1234") // returns "0x1234"
2395
- * Hex.hexInputToString(new Uint8Array([0x12, 0x34])) // returns "0x1234"
2396
- * ```
2397
- */
2398
- static hexInputToString(hexInput: HexInput): string;
2399
- /**
2400
- * Converts a HexInput (string or Uint8Array) to a hex string without '0x' prefix.
2401
- *
2402
- * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array
2403
- * @returns A hex string without '0x' prefix (e.g., "1234")
2404
- *
2405
- * @example
2406
- * ```typescript
2407
- * Hex.hexInputToStringWithoutPrefix("1234") // returns "1234"
2408
- * Hex.hexInputToStringWithoutPrefix("0x1234") // returns "1234"
2409
- * Hex.hexInputToStringWithoutPrefix(new Uint8Array([0x12, 0x34])) // returns "1234"
2410
- * ```
2411
- */
2412
- static hexInputToStringWithoutPrefix(hexInput: HexInput): string;
2413
- /**
2414
- * Check if the provided string is a valid hexadecimal representation.
2415
- *
2416
- * @param str - A hex string representing byte data.
2417
- *
2418
- * @returns An object containing:
2419
- * - valid: A boolean indicating whether the string is valid.
2420
- * - invalidReason: The reason for invalidity if the string is not valid.
2421
- * - invalidReasonMessage: A message explaining why the string is invalid.
2422
- * @group Implementation
2423
- * @category Serialization
2424
- */
2425
- static isValid(str: string): ParsingResult<HexInvalidReason>;
2426
- /**
2427
- * Determine if two Hex instances are equal by comparing their underlying byte data.
2428
- *
2429
- * @param other The Hex instance to compare to.
2430
- * @returns true if the Hex instances are equal, false if not.
2431
- * @group Implementation
2432
- * @category Serialization
2433
- */
2434
- equals(other: Hex): boolean;
2435
- }
2436
- declare const hexToAsciiString: (hex: string) => string;
2437
-
2438
- /**
2439
- * This class serves as a base class for all serializable types. It facilitates
2440
- * composable serialization of complex types and enables the serialization of
2441
- * instances to their BCS (Binary Canonical Serialization) representation.
2442
- * @group Implementation
2443
- * @category BCS
2444
- */
2445
- declare abstract class Serializable {
2446
- abstract serialize(serializer: Serializer): void;
2447
- /**
2448
- * Serializes a `Serializable` value to its BCS representation.
2449
- * This function is the TypeScript SDK equivalent of `bcs::to_bytes` in Move.
2450
- * @returns the BCS representation of the Serializable instance as a byte buffer.
2451
- * @group Implementation
2452
- * @category BCS
2453
- */
2454
- bcsToBytes(): Uint8Array;
2455
- /**
2456
- * Converts the BCS-serialized bytes of a value into a Hex instance.
2457
- * This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
2458
- * @returns A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
2459
- * @group Implementation
2460
- * @category BCS
2461
- */
2462
- bcsToHex(): Hex;
2463
- /**
2464
- * Returns the hex string representation of the `Serializable` value without the 0x prefix.
2465
- * @returns the hex format as a string without `0x` prefix.
2466
- */
2467
- toStringWithoutPrefix(): string;
2468
- /**
2469
- * Returns the hex string representation of the `Serializable` value with the 0x prefix.
2470
- * @returns the hex formatas a string prefixed by `0x`.
2471
- */
2472
- toString(): string;
2473
- }
2474
- /**
2475
- * A class for serializing various data types into a binary format.
2476
- * It provides methods to serialize strings, bytes, numbers, and other serializable objects
2477
- * using the Binary Coded Serialization (BCS) layout. The serialized data can be retrieved as a
2478
- * Uint8Array.
2479
- * @group Implementation
2480
- * @category BCS
2481
- */
2482
- declare class Serializer {
2483
- private buffer;
2484
- private offset;
2485
- /**
2486
- * Constructs a serializer with a buffer of size `length` bytes, 64 bytes by default.
2487
- * The `length` must be greater than 0.
2488
- *
2489
- * @param length - The size of the buffer in bytes.
2490
- * @group Implementation
2491
- * @category BCS
2492
- */
2493
- constructor(length?: number);
2494
- /**
2495
- * Ensures that the internal buffer can accommodate the specified number of bytes.
2496
- * This function dynamically resizes the buffer if the current size is insufficient.
2497
- *
2498
- * @param bytes - The number of bytes to ensure the buffer can handle.
2499
- * @group Implementation
2500
- * @category BCS
2501
- */
2502
- private ensureBufferWillHandleSize;
2503
- /**
2504
- * Appends the specified values to the buffer, ensuring that the buffer can accommodate the new data.
2505
- *
2506
- * @param {Uint8Array} values - The values to be appended to the buffer.
2507
- * @group Implementation
2508
- * @category BCS
2509
- */
2510
- protected appendToBuffer(values: Uint8Array): void;
2511
- /**
2512
- * Serializes a value into the buffer using the provided function, ensuring the buffer can accommodate the size.
2513
- *
2514
- * @param fn - The function to serialize the value, which takes a byte offset, the value to serialize, and an optional little-endian flag.
2515
- * @param fn.byteOffset - The byte offset at which to write the value.
2516
- * @param fn.value - The numeric value to serialize into the buffer.
2517
- * @param fn.littleEndian - Optional flag indicating whether to use little-endian byte order (defaults to true).
2518
- * @group Implementation
2519
- * @category BCS
2520
- */
2521
- private serializeWithFunction;
2522
- /**
2523
- * Serializes a string. UTF8 string is supported.
2524
- * The number of bytes in the string content is serialized first, as a uleb128-encoded u32 integer.
2525
- * Then the string content is serialized as UTF8 encoded bytes.
2526
- *
2527
- * BCS layout for "string": string_length | string_content
2528
- * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
2529
- *
2530
- * @param value - The string to serialize.
2531
- *
2532
- * @example
2533
- * ```typescript
2534
- * const serializer = new Serializer();
2535
- * serializer.serializeStr("1234abcd");
2536
- * assert(serializer.toUint8Array() === new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
2537
- * ```
2538
- * @group Implementation
2539
- * @category BCS
2540
- */
2541
- serializeStr(value: string): void;
2542
- /**
2543
- * Serializes an array of bytes.
2544
- *
2545
- * This function encodes the length of the byte array as a u32 integer in uleb128 format, followed by the byte array itself.
2546
- * BCS layout for "bytes": bytes_length | bytes
2547
- * where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.
2548
- * @param value - The byte array to serialize.
2549
- * @group Implementation
2550
- * @category BCS
2551
- */
2552
- serializeBytes(value: Uint8Array): void;
2553
- /**
2554
- * Serializes an array of bytes with a known length, allowing for efficient deserialization without needing to serialize the
2555
- * length itself.
2556
- * When deserializing, the number of bytes to deserialize needs to be passed in.
2557
-
2558
- * @param value - The Uint8Array to be serialized.
2559
- * @group Implementation
2560
- * @category BCS
2561
- */
2562
- serializeFixedBytes(value: Uint8Array): void;
2563
- /**
2564
- * Serializes a boolean value into a byte representation.
2565
- *
2566
- * The BCS layout for a boolean uses one byte, where "0x01" represents true and "0x00" represents false.
2567
- *
2568
- * @param value - The boolean value to serialize.
2569
- * @group Implementation
2570
- * @category BCS
2571
- */
2572
- serializeBool(value: boolean): void;
2573
- /**
2574
- * Serializes a Uint8 value and appends it to the buffer.
2575
- * BCS layout for "uint8": One byte. Binary format in little-endian representation.
2576
- *
2577
- * @param value - The Uint8 value to serialize.
2578
- * @group Implementation
2579
- * @category BCS
2580
- */
2581
- serializeU8(value: Uint8): void;
2582
- /**
2583
- * Serializes a uint16 number.
2584
- *
2585
- * @group Implementation
2586
- * @category BCS
2587
-
2588
- */
2589
- /**
2590
- * Serializes a 16-bit unsigned integer value into a binary format.
2591
- * BCS layout for "uint16": Two bytes. Binary format in little-endian representation.
2592
- *
2593
- * @param value - The 16-bit unsigned integer value to serialize.
2594
- * @example
2595
- * ```typescript
2596
- * const serializer = new Serializer();
2597
- * serializer.serializeU16(4660);
2598
- * assert(serializer.toUint8Array() === new Uint8Array([0x34, 0x12]));
2599
- * ```
2600
- * @group Implementation
2601
- * @category BCS
2602
- */
2603
- serializeU16(value: Uint16): void;
2604
- /**
2605
- * Serializes a 32-bit unsigned integer value into a binary format.
2606
- * This function is useful for encoding data that needs to be stored or transmitted in a compact form.
2607
- * @example
2608
- * ```typescript
2609
- * const serializer = new Serializer();
2610
- * serializer.serializeU32(305419896);
2611
- * assert(serializer.toUint8Array() === new Uint8Array([0x78, 0x56, 0x34, 0x12]));
2612
- * ```
2613
- * @param value - The 32-bit unsigned integer value to serialize.
2614
- * @group Implementation
2615
- * @category BCS
2616
- */
2617
- serializeU32(value: Uint32): void;
2618
- /**
2619
- * Serializes a 64-bit unsigned integer into a format suitable for storage or transmission.
2620
- * This function breaks down the value into two 32-bit components and writes them in little-endian order.
2621
- *
2622
- * @param value - The 64-bit unsigned integer to serialize, represented as a number.
2623
- * @example
2624
- * ```ts
2625
- * const serializer = new Serializer();
2626
- * serializer.serializeU64(1311768467750121216);
2627
- * assert(serializer.toUint8Array() === new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
2628
- * ```
2629
- * @group Implementation
2630
- * @category BCS
2631
- */
2632
- serializeU64(value: AnyNumber): void;
2633
- /**
2634
- * Serializes a U128 value into a format suitable for storage or transmission.
2635
- *
2636
- * @param value - The U128 value to serialize, represented as a number.
2637
- * @group Implementation
2638
- * @category BCS
2639
- */
2640
- serializeU128(value: AnyNumber): void;
2641
- /**
2642
- * Serializes a U256 value into a byte representation.
2643
- * This function is essential for encoding large numbers in a compact format suitable for transmission or storage.
2644
- *
2645
- * @param value - The U256 value to serialize, represented as an AnyNumber.
2646
- * @group Implementation
2647
- * @category BCS
2648
- */
2649
- serializeU256(value: AnyNumber): void;
2650
- /**
2651
- * Serializes a 32-bit unsigned integer as a variable-length ULEB128 encoded byte array.
2652
- * BCS uses uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values
2653
- *
2654
- * @param val - The 32-bit unsigned integer value to be serialized.
2655
- * @group Implementation
2656
- * @category BCS
2657
- */
2658
- serializeU32AsUleb128(val: Uint32): void;
2659
- /**
2660
- * Returns the buffered bytes as a Uint8Array.
2661
- *
2662
- * This function allows you to retrieve the byte representation of the buffer up to the current offset.
2663
- *
2664
- * @returns Uint8Array - The byte array representation of the buffer.
2665
- * @group Implementation
2666
- * @category BCS
2667
- */
2668
- toUint8Array(): Uint8Array;
2669
- /**
2670
- * Serializes a `Serializable` value, facilitating composable serialization.
2671
- *
2672
- * @param value The Serializable value to serialize.
2673
- *
2674
- * @returns the serializer instance
2675
- * @group Implementation
2676
- * @category BCS
2677
- */
2678
- serialize<T extends Serializable>(value: T): void;
2679
- /**
2680
- * Serializes an array of BCS Serializable values to a serializer instance.
2681
- * The bytes are added to the serializer instance's byte buffer.
2682
- *
2683
- * @param values The array of BCS Serializable values
2684
- * @example
2685
- * const addresses = new Array<AccountAddress>(
2686
- * AccountAddress.from("0x1"),
2687
- * AccountAddress.from("0x2"),
2688
- * AccountAddress.from("0xa"),
2689
- * AccountAddress.from("0xb"),
2690
- * );
2691
- * const serializer = new Serializer();
2692
- * serializer.serializeVector(addresses);
2693
- * const serializedBytes = serializer.toUint8Array();
2694
- * // serializedBytes is now the BCS-serialized bytes
2695
- * // The equivalent value in Move would be:
2696
- * // `bcs::to_bytes(&vector<address> [@0x1, @0x2, @0xa, @0xb])`;
2697
- * @group Implementation
2698
- * @category BCS
2699
- */
2700
- serializeVector<T extends Serializable>(values: Array<T>): void;
2701
- /**
2702
- * Serializes an optional value which can be a Serializable, string, or Uint8Array.
2703
- * For strings and Uint8Arrays, it uses the appropriate serialization method.
2704
- *
2705
- * @param value The value to serialize (Serializable, string, Uint8Array, or undefined)
2706
- * @param len Optional fixed length for Uint8Array serialization. If provided, uses serializeFixedBytes instead of serializeBytes
2707
- *
2708
- * @example
2709
- * ```typescript
2710
- * const serializer = new Serializer();
2711
- * serializer.serializeOption("hello"); // Serializes optional string
2712
- * serializer.serializeOption(new Uint8Array([1, 2, 3])); // Serializes optional bytes
2713
- * serializer.serializeOption(new Uint8Array([1, 2, 3]), 3); // Serializes optional fixed-length bytes
2714
- * serializer.serializeOption(new AccountAddress(...)); // Serializes optional Serializable
2715
- * serializer.serializeOption(undefined); // Serializes none case
2716
- * ```
2717
- * @group Implementation
2718
- * @category BCS
2719
- */
2720
- serializeOption<T extends Serializable | string | Uint8Array>(value?: T, len?: number): void;
2721
- /**
2722
- * @deprecated use `serializeOption` instead.
2723
- * Serializes an optional string, supporting UTF8 encoding.
2724
- * The function encodes the existence of the string first, followed by the length and content if it exists.
2725
- *
2726
- * BCS layout for optional "string": 1 | string_length | string_content
2727
- * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
2728
- * BCS layout for undefined: 0
2729
- *
2730
- * @param value - The optional string to serialize. If undefined, it will serialize as 0.
2731
- * @group Implementation
2732
- * @category BCS
2733
- */
2734
- serializeOptionStr(value?: string): void;
2735
- }
2736
- /**
2737
- * @group Implementation
2738
- * @category BCS
2739
- */
2740
- declare function ensureBoolean(value: unknown): asserts value is boolean;
2741
- /**
2742
- * @group Implementation
2743
- * @category BCS
2744
- */
2745
- declare const outOfRangeErrorMessage: (value: AnyNumber, min: AnyNumber, max: AnyNumber) => string;
2746
- /**
2747
- * Validates that a given number is within a specified range.
2748
- * This function throws an error if the value is outside the defined minimum and maximum bounds.
2749
- *
2750
- * @param value - The number to validate.
2751
- * @param minValue - The minimum allowable value (inclusive).
2752
- * @param maxValue - The maximum allowable value (inclusive).
2753
- * @group Implementation
2754
- * @category BCS
2755
- */
2756
- declare function validateNumberInRange<T extends AnyNumber>(value: T, minValue: T, maxValue: T): void;
2757
-
2758
- interface TransactionArgument extends EntryFunctionArgument, ScriptFunctionArgument {
2759
- }
2760
- /**
2761
- * Represents an argument for entry functions, providing methods to serialize the argument
2762
- * to BCS-serialized bytes and convert it to different formats.
2763
- * @group Implementation
2764
- * @category Transactions
2765
- */
2766
- interface EntryFunctionArgument {
2767
- /**
2768
- * Serialize an argument to BCS-serialized bytes.
2769
- *
2770
- * @param serializer - The serializer instance used for serialization.
2771
- * @group Implementation
2772
- * @category Transactions
2773
- */
2774
- serialize(serializer: Serializer): void;
2775
- /**
2776
- * Serialize an argument to BCS-serialized bytes.
2777
- * Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains
2778
- * the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
2779
- *
2780
- * @param serializer - The serializer used to convert the argument.
2781
- * @group Implementation
2782
- * @category Transactions
2783
- */
2784
- serializeForEntryFunction(serializer: Serializer): void;
2785
- /**
2786
- * Convert the argument to BCS-serialized bytes.
2787
- *
2788
- * @returns Uint8Array representing the BCS-serialized bytes of the argument.
2789
- * @group Implementation
2790
- * @category Transactions
2791
- */
2792
- bcsToBytes(): Uint8Array;
2793
- /**
2794
- * Converts the BCS-serialized bytes of an argument into a hexadecimal representation.
2795
- * This function is useful for obtaining a Hex instance that encapsulates the BCS-serialized bytes,
2796
- * allowing for easier manipulation and representation of the data.
2797
- * @returns A Hex instance containing the BCS-serialized bytes.
2798
- * @group Implementation
2799
- * @category Transactions
2800
- */
2801
- bcsToHex(): Hex;
2802
- }
2803
- /**
2804
- * Represents an argument for script functions, providing methods to serialize and convert to bytes.
2805
- * @group Implementation
2806
- * @category Transactions
2807
- */
2808
- interface ScriptFunctionArgument {
2809
- /**
2810
- * Serialize an argument to BCS-serialized bytes.
2811
- * @group Implementation
2812
- * @category Transactions
2813
- */
2814
- serialize(serializer: Serializer): void;
2815
- /**
2816
- * Serialize an argument to BCS-serialized bytes as a type aware byte sequence.
2817
- * The byte sequence contains an enum variant index followed by the BCS-serialized
2818
- * bytes for a typed argument.
2819
- * @group Implementation
2820
- * @category Transactions
2821
- */
2822
- serializeForScriptFunction(serializer: Serializer): void;
2823
- bcsToBytes(): Uint8Array;
2824
- bcsToHex(): Hex;
2825
- }
2826
-
2827
- /**
2828
- * Provides reasons for an address was invalid.
2829
- * @group Implementation
2830
- * @category Serialization
2831
- */
2832
- declare enum AddressInvalidReason {
2833
- INCORRECT_NUMBER_OF_BYTES = "incorrect_number_of_bytes",
2834
- INVALID_HEX_CHARS = "invalid_hex_chars",
2835
- TOO_SHORT = "too_short",
2836
- TOO_LONG = "too_long",
2837
- LEADING_ZERO_X_REQUIRED = "leading_zero_x_required",
2838
- LONG_FORM_REQUIRED_UNLESS_SPECIAL = "long_form_required_unless_special",
2839
- INVALID_PADDING_ZEROES = "INVALID_PADDING_ZEROES",
2840
- INVALID_PADDING_STRICTNESS = "INVALID_PADDING_STRICTNESS"
2841
- }
2842
- /**
2843
- * The input for an account address, which can be either a hexadecimal string or a standard account address.
2844
- * @group Implementation
2845
- * @category Serialization
2846
- */
2847
- type AccountAddressInput = HexInput | AccountAddress;
2848
- /**
2849
- * NOTE: Only use this class for account addresses. For other hex data, e.g. transaction
2850
- * hashes, use the Hex class.
2851
- *
2852
- * AccountAddress is used for working with account addresses. Account addresses, when
2853
- * represented as a string, generally look like these examples:
2854
- * - 0x1
2855
- * - 0xaa86fe99004361f747f91342ca13c426ca0cccb0c1217677180c9493bad6ef0c
2856
- *
2857
- * Proper formatting and parsing of account addresses is defined by AIP-40.
2858
- * To learn more about the standard, read the AIP here:
2859
- * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
2860
- *
2861
- * The comments in this class make frequent reference to the LONG and SHORT formats,
2862
- * as well as "special" addresses. To learn what these refer to see AIP-40.
2863
- * @group Implementation
2864
- * @category Serialization
2865
- */
2866
- declare class AccountAddress extends Serializable implements TransactionArgument {
2867
- /**
2868
- * This is the internal representation of an account address.
2869
- * @group Implementation
2870
- * @category Serialization
2871
- */
2872
- readonly data: Uint8Array;
2873
- /**
2874
- * The number of bytes that make up an account address.
2875
- * @group Implementation
2876
- * @category Serialization
2877
- */
2878
- static readonly LENGTH: number;
2879
- /**
2880
- * The length of an address string in LONG form without a leading 0x.
2881
- * @group Implementation
2882
- * @category Serialization
2883
- */
2884
- static readonly LONG_STRING_LENGTH: number;
2885
- static ZERO: AccountAddress;
2886
- static ONE: AccountAddress;
2887
- static TWO: AccountAddress;
2888
- static THREE: AccountAddress;
2889
- static FOUR: AccountAddress;
2890
- static A: AccountAddress;
2891
- /**
2892
- * Creates an instance of AccountAddress from a Uint8Array.
2893
- *
2894
- * This function ensures that the input data is exactly 32 bytes long, which is required for a valid account address.
2895
- *
2896
- * @param input A Uint8Array representing an account address.
2897
- * @throws ParsingError if the input length is not equal to 32 bytes.
2898
- * @group Implementation
2899
- * @category Serialization
2900
- */
2901
- constructor(input: Uint8Array);
2902
- /**
2903
- * Determines if the address is classified as special, which is defined as 0x0 to 0xf inclusive.
2904
- * In other words, the last byte of the address must be < 0b10000 (16)
2905
- * and every other byte must be zero.
2906
- *
2907
- * For more information on how special addresses are defined, see AIP-40:
2908
- * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
2909
- *
2910
- * @returns true if the address is special, false otherwise.
2911
- * @group Implementation
2912
- * @category Serialization
2913
- */
2914
- isSpecial(): boolean;
2915
- /**
2916
- * Return the AccountAddress as a string as per AIP-40.
2917
- * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
2918
- * This representation returns special addresses in SHORT form (0xf)
2919
- * and other addresses in LONG form (0x + 64 characters).
2920
- *
2921
- * @returns AccountAddress as a string conforming to AIP-40.
2922
- * @group Implementation
2923
- * @category Serialization
2924
- */
2925
- toString(): `0x${string}`;
2926
- /**
2927
- * Return the AccountAddress as a string conforming to AIP-40 but without the leading 0x.
2928
- *
2929
- * NOTE: Prefer to use `toString` where possible.
2930
- *
2931
- * @returns AccountAddress as a string without the leading 0x.
2932
- * @group Implementation
2933
- * @category Serialization
2934
- */
2935
- toStringWithoutPrefix(): string;
2936
- /**
2937
- * Convert the account address to a string in LONG format, which is always 0x followed by 64 hex characters.
2938
- *
2939
- * NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).
2940
- *
2941
- * @returns AccountAddress as a string in LONG form.
2942
- * @group Implementation
2943
- * @category Serialization
2944
- */
2945
- toStringLong(): `0x${string}`;
2946
- /**
2947
- * Returns the account address as a string in LONG form without a leading 0x.
2948
- * This function will include leading zeroes and will produce a string of 64 hex characters.
2949
- *
2950
- * NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).
2951
- *
2952
- * @returns {string} The account address in LONG form.
2953
- * @group Implementation
2954
- * @category Serialization
2955
- */
2956
- toStringLongWithoutPrefix(): string;
2957
- /**
2958
- * Convert the account address to a string in SHORT format, which is 0x followed by the shortest
2959
- * possible representation (no leading zeros).
2960
- *
2961
- * @returns AccountAddress as a string in SHORT form.
2962
- * @group Implementation
2963
- * @category Serialization
2964
- */
2965
- toStringShort(): `0x${string}`;
2966
- /**
2967
- * Returns a lossless short string representation of the address by trimming leading zeros.
2968
- * If the address consists of all zeros, returns "0".
2969
- *
2970
- * @returns A string representation of the address without leading zeros
2971
- * @group Implementation
2972
- * @category Serialization
2973
- */
2974
- toStringShortWithoutPrefix(): string;
2975
- /**
2976
- * Get the inner data as a Uint8Array.
2977
- * The inner data is already a Uint8Array, so no conversion takes place.
2978
- *
2979
- * @returns Hex data as Uint8Array
2980
- * @group Implementation
2981
- * @category Serialization
2982
- */
2983
- toUint8Array(): Uint8Array;
2984
- /**
2985
- * Serialize the AccountAddress to a Serializer instance's data buffer.
2986
- * @param serializer The serializer to serialize the AccountAddress to.
2987
- * @returns void
2988
- * @example
2989
- * const serializer = new Serializer();
2990
- * const address = AccountAddress.fromString("0x1");
2991
- * address.serialize(serializer);
2992
- * const bytes = serializer.toUint8Array();
2993
- * // `bytes` is now the BCS-serialized address.
2994
- * @group Implementation
2995
- * @category Serialization
2996
- */
2997
- serialize(serializer: Serializer): void;
2998
- /**
2999
- * Serializes the current instance into a byte sequence suitable for entry functions.
3000
- * This allows for the proper encoding of data when interacting with entry functions in the blockchain.
3001
- *
3002
- * @param serializer - The serializer instance used to convert the data into bytes.
3003
- * @group Implementation
3004
- * @category Serialization
3005
- */
3006
- serializeForEntryFunction(serializer: Serializer): void;
3007
- /**
3008
- * Serializes the current instance for use in a script function by encoding it into a byte sequence.
3009
- * This process involves serializing the variant index and the instance data, making it suitable for transmission.
3010
- *
3011
- * @param serializer - The serializer instance used to perform the serialization.
3012
- * @group Implementation
3013
- * @category Serialization
3014
- */
3015
- serializeForScriptFunction(serializer: Serializer): void;
3016
- /**
3017
- * Deserialize an AccountAddress from the byte buffer in a Deserializer instance.
3018
- * This function allows you to convert a byte representation of an AccountAddress into an instance of AccountAddress.
3019
- * @param deserializer The deserializer to deserialize the AccountAddress from.
3020
- * @returns An instance of AccountAddress.
3021
- * @example
3022
- * const bytes = hexToBytes("0x0102030405060708091011121314151617181920212223242526272829303132");
3023
- * const deserializer = new Deserializer(bytes);
3024
- * const address = AccountAddress.deserialize(deserializer);
3025
- * // `address` is now an instance of AccountAddress.
3026
- * @group Implementation
3027
- * @category Serialization
3028
- */
3029
- static deserialize(deserializer: Deserializer): AccountAddress;
3030
- /**
3031
- * NOTE: This function has strict parsing behavior. For relaxed behavior, please use
3032
- * the `fromString` function.
3033
- *
3034
- * Creates an instance of AccountAddress from a hex string.
3035
- *
3036
- * This function allows only the strictest formats defined by AIP-40. In short this
3037
- * means only the following formats are accepted:
3038
- *
3039
- * - LONG
3040
- * - SHORT for special addresses
3041
- *
3042
- * Where:
3043
- * - LONG is defined as 0x + 64 hex characters.
3044
- * - SHORT for special addresses is 0x0 to 0xf inclusive without padding zeroes.
3045
- *
3046
- * This means the following are not accepted:
3047
- * - SHORT for non-special addresses.
3048
- * - Any address without a leading 0x.
3049
- *
3050
- * @param input - A hex string representing an account address.
3051
- *
3052
- * @throws {ParsingError} If the hex string does not start with 0x or is not in a valid format.
3053
- *
3054
- * @remarks
3055
- *
3056
- * This function has strict parsing behavior. For relaxed behavior, please use the `fromString` function.
3057
- *
3058
- * @see AIP-40 documentation for more details on address formats:
3059
- * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
3060
- *
3061
- * @returns An instance of AccountAddress.
3062
- * @group Implementation
3063
- * @category Serialization
3064
- */
3065
- static fromStringStrict(input: string): AccountAddress;
3066
- /**
3067
- * NOTE: This function has relaxed parsing behavior. For strict behavior, please use
3068
- * the `fromStringStrict` function. Where possible use `fromStringStrict` rather than this
3069
- * function, `fromString`.
3070
- *
3071
- * Creates an instance of AccountAddress from a hex string.
3072
- *
3073
- * This function allows all formats defined by AIP-40. In short this means the
3074
- * following formats are accepted:
3075
- *
3076
- * - LONG, with or without leading 0x
3077
- * - SHORT*, with or without leading 0x
3078
- *
3079
- * Where:
3080
- * - LONG is 64 hex characters.
3081
- * - SHORT* is 1 to 63 hex characters inclusive. The address can have missing values up to `maxMissingChars` before it is padded.
3082
- * - Padding zeroes are allowed, e.g. 0x0123 is valid.
3083
- *
3084
- * Learn more about the different address formats by reading AIP-40:
3085
- * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
3086
- *
3087
- * @param input A hex string representing an account address.
3088
- * @param args.maxMissingChars The number of characters that can be missing in a padded address before it is invalid.
3089
- *
3090
- * @returns An instance of AccountAddress.
3091
- *
3092
- * @throws ParsingError if the hex string is too short, too long, or contains invalid characters.
3093
- * @group Implementation
3094
- * @category Serialization
3095
- */
3096
- static fromString(input: string, { maxMissingChars }?: {
3097
- maxMissingChars?: number;
3098
- }): AccountAddress;
3099
- /**
3100
- * Convenience method for creating an AccountAddress from various input types.
3101
- * This function accepts a string, Uint8Array, or an existing AccountAddress instance and returns the corresponding
3102
- * AccountAddress.
3103
- *
3104
- * @param input - The input to convert into an AccountAddress. This can be a string representation of an address, a Uint8Array,
3105
- * or an existing AccountAddress.
3106
- * @param args.maxMissingChars The number of characters that can be missing in a padded address before it is invalid.
3107
- * @group Implementation
3108
- * @category Serialization
3109
- */
3110
- static from(input: AccountAddressInput, { maxMissingChars }?: {
3111
- maxMissingChars?: number;
3112
- }): AccountAddress;
3113
- /**
3114
- * Create an AccountAddress from various input types, including strings, Uint8Array, and AccountAddress instances.
3115
- *
3116
- * @param input - The input to convert into an AccountAddress, which can be a string, a Uint8Array, or an AccountAddress.
3117
- * @group Implementation
3118
- * @category Serialization
3119
- */
3120
- static fromStrict(input: AccountAddressInput): AccountAddress;
3121
- /**
3122
- * Check if the provided input is a valid AccountAddress.
3123
- *
3124
- * @param args - The arguments for validation.
3125
- * @param args.input - A hex string representing an account address.
3126
- * @param args.strict - If true, use strict parsing behavior; if false, use relaxed parsing behavior.
3127
- *
3128
- * @returns An object indicating whether the address is valid. If valid, valid = true; if not, valid = false with additional details.
3129
- * If the address is invalid, invalidReason will explain why it is invalid, and invalidReasonMessage will provide the error message.
3130
- * @group Implementation
3131
- * @category Serialization
3132
- */
3133
- static isValid(args: {
3134
- input: AccountAddressInput;
3135
- strict?: boolean;
3136
- }): ParsingResult<AddressInvalidReason>;
3137
- /**
3138
- * Determine if two AccountAddresses are equal based on their underlying byte data.
3139
- *
3140
- * @param other - The AccountAddress to compare to.
3141
- * @returns true if the AccountAddresses are equal, false if not.
3142
- * @group Implementation
3143
- * @category Serialization
3144
- */
3145
- equals(other: AccountAddress): boolean;
3146
- }
3147
-
3148
- export { type WaitForTransactionOptions as $, type AnyNumber as A, type GetAccountOwnedTokensFromCollectionResponse as B, type Client as C, Deserializer as D, type EntryFunctionArgument as E, type FullNodeConfig as F, type GetAccountOwnedTokensQueryResponse as G, type HexInput as H, type IndexerConfig as I, type GetAccountCollectionsWithOwnedTokenResponse as J, type GetAccountCoinsDataResponse as K, type LedgerVersionArg as L, type MoveModuleId as M, Network as N, type OrderByArg as O, PrivateKeyVariants as P, type GetObjectDataQueryResponse as Q, type GetCollectionDataResponse as R, Serializable as S, type TransactionArgument as T, type Uint8 as U, type GetTokenDataResponse as V, type WhereArg as W, type GetCurrentTokenOwnershipResponse as X, type GetOwnedTokensResponse as Y, type GetTokenActivityResponse as Z, type GetEventsResponse as _, Serializer as a, type BlockEndInfo as a$, type UserTransactionResponse as a0, type GetFungibleAssetMetadataResponse as a1, type GetFungibleAssetActivitiesResponse as a2, type GetCurrentFungibleAssetBalancesResponse as a3, type LedgerInfo as a4, type Block as a5, type GetChainTopUserTransactionsResponse as a6, type GraphqlQuery as a7, type GetProcessorStatusResponse as a8, type GetANSNameResponse as a9, type OrderBy as aA, type OrderByValue as aB, type TokenStandard as aC, TypeTagVariants as aD, ScriptTransactionArgumentVariants as aE, TransactionPayloadVariants as aF, TransactionVariants as aG, TransactionAuthenticatorVariant as aH, AccountAuthenticatorVariant as aI, AnySignatureVariant as aJ, EphemeralSignatureVariant as aK, type Uint64 as aL, type Uint128 as aM, type Uint256 as aN, type ClientHeadersType as aO, TransactionResponseType as aP, isPendingTransactionResponse as aQ, isUserTransactionResponse as aR, isGenesisTransactionResponse as aS, isBlockMetadataTransactionResponse as aT, isStateCheckpointTransactionResponse as aU, isValidatorTransactionResponse as aV, isBlockEpilogueTransactionResponse as aW, type GenesisTransactionResponse as aX, type BlockMetadataTransactionResponse as aY, type StateCheckpointTransactionResponse as aZ, type ValidatorTransactionResponse as a_, type GetNumberOfDelegatorsResponse as aa, type GetDelegatedStakingActivitiesResponse as ab, type PendingTransactionResponse as ac, type CommittedTransactionResponse as ad, type GasEstimation as ae, type TableItemRequest as af, type GetTableItemsDataResponse as ag, type GetTableItemsMetadataResponse as ah, EphemeralPublicKeyVariant as ai, EphemeralCertificateVariant as aj, ZkpVariant as ak, SigningScheme as al, SigningSchemeInput as am, type ClientRequest as an, type ClientResponse as ao, type AptosRequest as ap, type AptosResponse as aq, MimeType as ar, ensureBoolean as as, outOfRangeErrorMessage as at, validateNumberInRange as au, AddressInvalidReason as av, ParsingError as aw, type ParsingResult as ax, HexInvalidReason as ay, hexToAsciiString as az, type Uint16 as b, type BlockEpilogueTransactionResponse as b0, type WriteSetChange as b1, type WriteSetChangeDeleteModule as b2, type WriteSetChangeDeleteResource as b3, type WriteSetChangeDeleteTableItem as b4, type WriteSetChangeWriteModule as b5, type WriteSetChangeWriteResource as b6, type WriteSetChangeWriteTableItem as b7, type DecodedTableData as b8, type DeletedTableData as b9, type MoveUint64Type as bA, type MoveUint128Type as bB, type MoveUint256Type as bC, type MoveAddressType as bD, type MoveObjectType as bE, type MoveOptionType as bF, type MoveStructType as bG, type MoveType as bH, MoveFunctionVisibility as bI, MoveAbility as bJ, type MoveStructField as bK, type MoveStruct as bL, RoleType as bM, DeriveScheme as bN, type GenerateAccountWithEd25519 as bO, type GenerateAccountWithSingleSignerSecp256k1Key as bP, type GenerateAccount as bQ, NetworkToIndexerAPI as bR, NetworkToNodeAPI as bS, NetworkToFaucetAPI as bT, NetworkToPepperAPI as bU, NetworkToProverAPI as bV, NetworkToChainId as bW, NetworkToNetworkName as bX, type TransactionPayloadResponse as ba, type EntryFunctionPayloadResponse as bb, type ScriptPayloadResponse as bc, type MultisigPayloadResponse as bd, type GenesisPayload as be, type MoveScriptBytecode as bf, type TransactionSignature as bg, isEd25519Signature as bh, isSecp256k1Signature as bi, isMultiAgentSignature as bj, isFeePayerSignature as bk, isMultiEd25519Signature as bl, type TransactionEd25519Signature as bm, type TransactionSecp256k1Signature as bn, type TransactionMultiEd25519Signature as bo, type TransactionMultiAgentSignature as bp, type TransactionFeePayerSignature as bq, type AccountSignature as br, type WriteSet as bs, type ScriptWriteSet as bt, type DirectWriteSet as bu, type EventGuid as bv, type Event as bw, type MoveUint8Type as bx, type MoveUint16Type as by, type MoveUint32Type as bz, type Uint32 as c, type Deserializable as d, Hex as e, type AuthenticationKeyScheme as f, AccountAddress as g, type ClientConfig as h, type FaucetConfig as i, type AptosSettings as j, AnyPublicKeyVariant as k, type ScriptFunctionArgument as l, type MoveFunctionId as m, type MoveFunctionGenericTypeParam as n, type MoveStructId as o, type MoveValue as p, type AccountAddressInput as q, type MoveFunction as r, type MoveModule as s, type AccountData as t, type MoveModuleBytecode as u, type CursorPaginationArgs as v, type PaginationArgs as w, type TransactionResponse as x, type MoveResource as y, type TokenStandardArg as z };