@aptos-labs/ts-sdk 1.14.0 → 1.15.0-win.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (451) hide show
  1. package/dist/common/{accountAddress-csDQ8Gnp.d.ts → accountAddress-ccLvlUQe.d.ts} +20 -1
  2. package/dist/common/cli/index.d.ts +1 -1
  3. package/dist/common/cli/index.js +1 -1
  4. package/dist/common/cli/index.js.map +1 -1
  5. package/dist/common/index.d.ts +1624 -1390
  6. package/dist/common/index.js +42 -13
  7. package/dist/common/index.js.map +1 -1
  8. package/dist/esm/{Ed25519Account--qjfup2u.d.mts → Ed25519Account-B1VMJOY2.d.mts} +77 -10
  9. package/dist/esm/account/Account.d.mts +34 -0
  10. package/dist/esm/account/Account.mjs +2 -0
  11. package/dist/esm/account/Ed25519Account.d.mts +34 -0
  12. package/dist/esm/account/Ed25519Account.mjs +2 -0
  13. package/dist/esm/account/MultiKeyAccount.d.mts +133 -0
  14. package/dist/esm/account/MultiKeyAccount.mjs +2 -0
  15. package/dist/esm/account/SingleKeyAccount.d.mts +34 -0
  16. package/dist/esm/account/SingleKeyAccount.mjs +2 -0
  17. package/dist/esm/account/index.d.mts +35 -0
  18. package/dist/esm/account/index.mjs +2 -0
  19. package/dist/esm/api/account.d.mts +14 -2
  20. package/dist/esm/api/account.mjs +1 -1
  21. package/dist/esm/api/ans.d.mts +3 -3
  22. package/dist/esm/api/ans.mjs +1 -1
  23. package/dist/esm/api/aptos.d.mts +11 -9
  24. package/dist/esm/api/aptos.mjs +1 -1
  25. package/dist/esm/api/coin.d.mts +7 -7
  26. package/dist/esm/api/coin.mjs +1 -1
  27. package/dist/esm/api/digitalAsset.d.mts +2 -2
  28. package/dist/esm/api/digitalAsset.mjs +1 -1
  29. package/dist/esm/api/event.mjs +1 -1
  30. package/dist/esm/api/faucet.mjs +1 -1
  31. package/dist/esm/api/fungibleAsset.d.mts +6 -6
  32. package/dist/esm/api/fungibleAsset.mjs +1 -1
  33. package/dist/esm/api/general.d.mts +8 -33
  34. package/dist/esm/api/general.mjs +1 -1
  35. package/dist/esm/api/index.d.mts +10 -9
  36. package/dist/esm/api/index.mjs +1 -1
  37. package/dist/esm/api/staking.mjs +1 -1
  38. package/dist/esm/api/table.d.mts +84 -0
  39. package/dist/esm/api/table.mjs +2 -0
  40. package/dist/esm/api/transaction.d.mts +2 -2
  41. package/dist/esm/api/transaction.mjs +1 -1
  42. package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
  43. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  44. package/dist/esm/api/transactionSubmission/management.d.mts +9 -9
  45. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  46. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  47. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  48. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  49. package/dist/esm/api/transactionSubmission/simulate.d.mts +7 -7
  50. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  51. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  52. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  53. package/dist/esm/api/utils.mjs +1 -1
  54. package/dist/esm/bcs/index.mjs +1 -1
  55. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  56. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  57. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  58. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  59. package/dist/esm/bcs/serializer.mjs +1 -1
  60. package/dist/esm/{chunk-PYXJYEAC.mjs → chunk-2ENDAFGG.mjs} +2 -2
  61. package/dist/esm/chunk-2ENDAFGG.mjs.map +1 -0
  62. package/dist/esm/{chunk-XO3HHRJV.mjs → chunk-2O5VFH5O.mjs} +2 -2
  63. package/dist/esm/{chunk-PXFIA4BL.mjs → chunk-2XK53QFA.mjs} +2 -2
  64. package/dist/esm/chunk-2ZGHK5BB.mjs +2 -0
  65. package/dist/esm/chunk-2ZGHK5BB.mjs.map +1 -0
  66. package/dist/esm/chunk-324M4MB2.mjs +2 -0
  67. package/dist/esm/chunk-324M4MB2.mjs.map +1 -0
  68. package/dist/esm/{chunk-RHBCVCOS.mjs → chunk-35EWRSDK.mjs} +2 -2
  69. package/dist/esm/{chunk-52C73T26.mjs → chunk-36QXVFR5.mjs} +2 -2
  70. package/dist/esm/{chunk-WCVUDO5S.mjs → chunk-3B6IKORV.mjs} +2 -2
  71. package/dist/esm/{chunk-CDB34C4N.mjs → chunk-3UGVM4HI.mjs} +2 -2
  72. package/dist/esm/chunk-3UGVM4HI.mjs.map +1 -0
  73. package/dist/esm/chunk-3W3BU5BL.mjs +2 -0
  74. package/dist/esm/chunk-3W3BU5BL.mjs.map +1 -0
  75. package/dist/esm/chunk-4NHWV5AI.mjs +2 -0
  76. package/dist/esm/{chunk-HWECUBBA.mjs → chunk-4RZT6HZR.mjs} +2 -2
  77. package/dist/esm/chunk-4RZT6HZR.mjs.map +1 -0
  78. package/dist/esm/chunk-4YN7NTBQ.mjs +2 -0
  79. package/dist/esm/chunk-4YN7NTBQ.mjs.map +1 -0
  80. package/dist/esm/{chunk-5HY3DEPF.mjs → chunk-5CEZFZHP.mjs} +2 -2
  81. package/dist/esm/{chunk-NPFNYP75.mjs → chunk-5EN52MUT.mjs} +2 -2
  82. package/dist/esm/chunk-5LZ66XGE.mjs +2 -0
  83. package/dist/esm/chunk-5LZ66XGE.mjs.map +1 -0
  84. package/dist/esm/chunk-5PQHXE4N.mjs +2 -0
  85. package/dist/esm/chunk-5PQHXE4N.mjs.map +1 -0
  86. package/dist/esm/chunk-5Y2AZJBC.mjs +2 -0
  87. package/dist/esm/chunk-5Y2AZJBC.mjs.map +1 -0
  88. package/dist/esm/chunk-6BIXMATF.mjs +2 -0
  89. package/dist/esm/chunk-6BIXMATF.mjs.map +1 -0
  90. package/dist/esm/{chunk-BE4FOV6X.mjs → chunk-6E23TANW.mjs} +2 -2
  91. package/dist/esm/{chunk-6OV2PQS5.mjs → chunk-6IKL4CPY.mjs} +2 -2
  92. package/dist/esm/chunk-7PPN3XDQ.mjs +2 -0
  93. package/dist/esm/{chunk-HG4Q4EFG.mjs → chunk-7T77PZGU.mjs} +2 -2
  94. package/dist/esm/chunk-7T77PZGU.mjs.map +1 -0
  95. package/dist/esm/chunk-7VRZLDIJ.mjs +2 -0
  96. package/dist/esm/chunk-A7EISBPY.mjs +2 -0
  97. package/dist/esm/chunk-A7EISBPY.mjs.map +1 -0
  98. package/dist/esm/chunk-B7X6PSE7.mjs +2 -0
  99. package/dist/esm/{chunk-AOCNYMMX.mjs → chunk-BCUSI3N6.mjs} +2 -2
  100. package/dist/esm/{chunk-BAV4XY7C.mjs → chunk-BHLICYAI.mjs} +2 -2
  101. package/dist/esm/chunk-BO2TLWNT.mjs +2 -0
  102. package/dist/esm/{chunk-N77VJHW5.mjs → chunk-C22QZ32Q.mjs} +2 -2
  103. package/dist/esm/chunk-CEHCDA3G.mjs +2 -0
  104. package/dist/esm/chunk-CJDEPZ4J.mjs +2 -0
  105. package/dist/esm/{chunk-CPBGL37X.mjs.map → chunk-CJDEPZ4J.mjs.map} +1 -1
  106. package/dist/esm/chunk-EKOTTHRQ.mjs +2 -0
  107. package/dist/esm/chunk-EKOTTHRQ.mjs.map +1 -0
  108. package/dist/esm/chunk-F7EMGK4M.mjs +2 -0
  109. package/dist/esm/{chunk-PMUT3HZE.mjs → chunk-G2RMTVZG.mjs} +2 -2
  110. package/dist/esm/chunk-G2RMTVZG.mjs.map +1 -0
  111. package/dist/esm/{chunk-FS3NSGBF.mjs → chunk-G56GPLTB.mjs} +2 -2
  112. package/dist/esm/{chunk-6FBKUTGF.mjs → chunk-GHYE26Q5.mjs} +2 -2
  113. package/dist/esm/{chunk-QTRYMRYK.mjs → chunk-GM56MMNJ.mjs} +2 -2
  114. package/dist/esm/{chunk-2G4ZSGL4.mjs → chunk-GZIOZUKM.mjs} +2 -2
  115. package/dist/esm/{chunk-SPU745XV.mjs → chunk-HXGEF7O7.mjs} +2 -2
  116. package/dist/esm/{chunk-O4JRPZZM.mjs → chunk-I6ST47U7.mjs} +2 -2
  117. package/dist/esm/{chunk-4P5EKAJB.mjs → chunk-IZZ6BA56.mjs} +2 -2
  118. package/dist/esm/chunk-JFIAWBCK.mjs +2 -0
  119. package/dist/esm/chunk-JFIAWBCK.mjs.map +1 -0
  120. package/dist/esm/chunk-JPNTJOQW.mjs +2 -0
  121. package/dist/esm/chunk-JXCZTOYC.mjs +1 -0
  122. package/dist/esm/chunk-JXCZTOYC.mjs.map +1 -0
  123. package/dist/esm/{chunk-UML2VQZT.mjs → chunk-KAGLWBIJ.mjs} +2 -2
  124. package/dist/esm/chunk-KLTQSLDY.mjs +2 -0
  125. package/dist/esm/chunk-KLTQSLDY.mjs.map +1 -0
  126. package/dist/esm/{chunk-AT2A6UGB.mjs → chunk-KNSIJJS3.mjs} +2 -2
  127. package/dist/esm/{chunk-AT2A6UGB.mjs.map → chunk-KNSIJJS3.mjs.map} +1 -1
  128. package/dist/esm/{chunk-L5IL2IAB.mjs → chunk-L5KHEQW5.mjs} +2 -2
  129. package/dist/esm/chunk-LG7RJQ57.mjs +2 -0
  130. package/dist/esm/{chunk-QD2Y3VK4.mjs → chunk-MI73LIB3.mjs} +2 -2
  131. package/dist/esm/chunk-MI73LIB3.mjs.map +1 -0
  132. package/dist/esm/{chunk-U43IJHQN.mjs → chunk-MJPUASSD.mjs} +2 -2
  133. package/dist/esm/chunk-MVHGVOOC.mjs +2 -0
  134. package/dist/esm/chunk-MVHGVOOC.mjs.map +1 -0
  135. package/dist/esm/chunk-N3U47Y6Y.mjs +2 -0
  136. package/dist/esm/{chunk-P3UFJZY5.mjs → chunk-NOYKXLFN.mjs} +2 -2
  137. package/dist/esm/chunk-NOYKXLFN.mjs.map +1 -0
  138. package/dist/esm/chunk-NSZALM2Q.mjs +2 -0
  139. package/dist/esm/chunk-NSZALM2Q.mjs.map +1 -0
  140. package/dist/esm/{chunk-UPIN5AIO.mjs → chunk-P6GWG2CY.mjs} +2 -2
  141. package/dist/esm/chunk-PF57EOJY.mjs +2 -0
  142. package/dist/esm/{chunk-RW2A63WK.mjs → chunk-PGCCXIAS.mjs} +2 -2
  143. package/dist/esm/chunk-PGCCXIAS.mjs.map +1 -0
  144. package/dist/esm/chunk-PHRX2SAA.mjs +2 -0
  145. package/dist/esm/chunk-PHRX2SAA.mjs.map +1 -0
  146. package/dist/esm/{chunk-3YZGJLW7.mjs → chunk-PI2NFZEH.mjs} +2 -2
  147. package/dist/esm/{chunk-IOSQVDZI.mjs → chunk-QRS4DGP3.mjs} +2 -2
  148. package/dist/esm/{chunk-IOSQVDZI.mjs.map → chunk-QRS4DGP3.mjs.map} +1 -1
  149. package/dist/esm/{chunk-LDQ6JFEF.mjs → chunk-QSHLNSUP.mjs} +2 -2
  150. package/dist/esm/{chunk-LDQ6JFEF.mjs.map → chunk-QSHLNSUP.mjs.map} +1 -1
  151. package/dist/esm/chunk-R2LYYO6V.mjs +2 -0
  152. package/dist/esm/chunk-R2LYYO6V.mjs.map +1 -0
  153. package/dist/esm/chunk-RFSO3JRG.mjs +1 -0
  154. package/dist/esm/chunk-RFSO3JRG.mjs.map +1 -0
  155. package/dist/esm/{chunk-APDALGDD.mjs → chunk-S2VSJJRJ.mjs} +2 -2
  156. package/dist/esm/{chunk-S4SEFF4K.mjs → chunk-S3EDNXZE.mjs} +46 -17
  157. package/dist/esm/chunk-S3EDNXZE.mjs.map +1 -0
  158. package/dist/esm/chunk-S7TAYRDR.mjs +2 -0
  159. package/dist/esm/chunk-S7TAYRDR.mjs.map +1 -0
  160. package/dist/esm/chunk-SFM5C2IG.mjs +2 -0
  161. package/dist/esm/{chunk-CNMQNPNV.mjs → chunk-SGTNW5YI.mjs} +2 -2
  162. package/dist/esm/chunk-SRDIYE3M.mjs +2 -0
  163. package/dist/esm/{chunk-QIAHBEEW.mjs.map → chunk-SRDIYE3M.mjs.map} +1 -1
  164. package/dist/esm/{chunk-DMKUAQB7.mjs → chunk-U3YYSIIT.mjs} +2 -2
  165. package/dist/esm/chunk-UGPALAPN.mjs +2 -0
  166. package/dist/esm/{chunk-BIAEC6FO.mjs → chunk-UM35A7RD.mjs} +2 -2
  167. package/dist/esm/chunk-UO3NZ5AH.mjs +1 -0
  168. package/dist/esm/chunk-UO3NZ5AH.mjs.map +1 -0
  169. package/dist/esm/{chunk-FXNFWLQC.mjs → chunk-UPSCPEEE.mjs} +2 -2
  170. package/dist/esm/{chunk-S2LTZKM4.mjs → chunk-VGGYFJUY.mjs} +2 -2
  171. package/dist/esm/{chunk-JCD72AW7.mjs → chunk-YK732P36.mjs} +2 -2
  172. package/dist/esm/{chunk-UDRSFVAK.mjs → chunk-YMB2XW2O.mjs} +2 -2
  173. package/dist/esm/{chunk-NWYIE7ZX.mjs → chunk-YZHIXVPR.mjs} +2 -2
  174. package/dist/esm/chunk-ZGF45HCL.mjs +2 -0
  175. package/dist/esm/chunk-ZGF45HCL.mjs.map +1 -0
  176. package/dist/esm/cli/index.d.mts +1 -1
  177. package/dist/esm/cli/index.mjs +1 -1
  178. package/dist/esm/cli/move.d.mts +1 -1
  179. package/dist/esm/cli/move.mjs +1 -1
  180. package/dist/esm/client/core.mjs +1 -1
  181. package/dist/esm/client/get.mjs +1 -1
  182. package/dist/esm/client/index.mjs +1 -1
  183. package/dist/esm/client/post.mjs +1 -1
  184. package/dist/esm/client/types.mjs +1 -1
  185. package/dist/esm/core/account/index.d.mts +5 -14
  186. package/dist/esm/core/account/index.mjs +1 -1
  187. package/dist/esm/core/account/utils/address.mjs +1 -1
  188. package/dist/esm/core/account/utils/index.mjs +1 -1
  189. package/dist/esm/core/accountAddress.mjs +1 -1
  190. package/dist/esm/core/authenticationKey.d.mts +1 -1
  191. package/dist/esm/core/authenticationKey.mjs +1 -1
  192. package/dist/esm/core/common.mjs +1 -1
  193. package/dist/esm/core/crypto/ed25519.d.mts +1 -1
  194. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  195. package/dist/esm/core/crypto/index.d.mts +4 -4
  196. package/dist/esm/core/crypto/index.mjs +1 -1
  197. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  198. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  199. package/dist/esm/core/crypto/multiKey.d.mts +8 -1
  200. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  201. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  202. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  203. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  204. package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
  205. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  206. package/dist/esm/core/crypto/signature.mjs +1 -1
  207. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  208. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  209. package/dist/esm/core/crypto/utils.mjs +1 -1
  210. package/dist/esm/core/hex.mjs +1 -1
  211. package/dist/esm/core/index.d.mts +3 -6
  212. package/dist/esm/core/index.mjs +1 -1
  213. package/dist/esm/index.d.mts +7 -5
  214. package/dist/esm/index.mjs +1 -1
  215. package/dist/esm/internal/account.d.mts +14 -2
  216. package/dist/esm/internal/account.mjs +1 -1
  217. package/dist/esm/internal/ans.d.mts +3 -3
  218. package/dist/esm/internal/ans.mjs +1 -1
  219. package/dist/esm/internal/coin.d.mts +8 -8
  220. package/dist/esm/internal/coin.mjs +1 -1
  221. package/dist/esm/internal/digitalAsset.d.mts +3 -3
  222. package/dist/esm/internal/digitalAsset.mjs +1 -1
  223. package/dist/esm/internal/event.d.mts +1 -1
  224. package/dist/esm/internal/event.mjs +1 -1
  225. package/dist/esm/internal/faucet.d.mts +1 -1
  226. package/dist/esm/internal/faucet.mjs +1 -1
  227. package/dist/esm/internal/fungibleAsset.d.mts +6 -6
  228. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  229. package/dist/esm/internal/general.d.mts +2 -8
  230. package/dist/esm/internal/general.mjs +1 -1
  231. package/dist/esm/internal/staking.d.mts +1 -1
  232. package/dist/esm/internal/staking.mjs +1 -1
  233. package/dist/esm/internal/table.d.mts +31 -0
  234. package/dist/esm/internal/table.mjs +2 -0
  235. package/dist/esm/internal/table.mjs.map +1 -0
  236. package/dist/esm/internal/transaction.mjs +1 -1
  237. package/dist/esm/internal/transactionSubmission.d.mts +2 -2
  238. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  239. package/dist/esm/internal/view.d.mts +7 -7
  240. package/dist/esm/internal/view.mjs +1 -1
  241. package/dist/esm/transactions/authenticator/account.d.mts +4 -5
  242. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  243. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  244. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  245. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  246. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  247. package/dist/esm/transactions/index.d.mts +3 -3
  248. package/dist/esm/transactions/index.mjs +1 -1
  249. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  250. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  251. package/dist/esm/transactions/instances/index.d.mts +1 -1
  252. package/dist/esm/transactions/instances/index.mjs +1 -1
  253. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  254. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  255. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  256. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  257. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  258. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  259. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  260. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  261. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  262. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  263. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  264. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +14 -2
  265. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  266. package/dist/esm/transactions/management/index.d.mts +3 -3
  267. package/dist/esm/transactions/management/index.mjs +1 -1
  268. package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
  269. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  270. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
  271. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  272. package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
  273. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  274. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
  275. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  276. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +72 -0
  277. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +2 -0
  278. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -0
  279. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +7 -29
  280. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  281. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  282. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  283. package/dist/esm/transactions/types.d.mts +7 -7
  284. package/dist/esm/types/generated/operations.d.mts +31 -2
  285. package/dist/esm/types/generated/queries.d.mts +6 -2
  286. package/dist/esm/types/generated/queries.mjs +1 -1
  287. package/dist/esm/types/generated/types.d.mts +212 -7
  288. package/dist/esm/types/generated/types.mjs +1 -1
  289. package/dist/esm/types/generated/types.mjs.map +1 -1
  290. package/dist/esm/types/index.d.mts +1 -1
  291. package/dist/esm/types/indexer.d.mts +4 -2
  292. package/dist/esm/utils/index.mjs +1 -1
  293. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  294. package/dist/esm/version.d.mts +1 -1
  295. package/dist/esm/version.mjs +1 -1
  296. package/package.json +2 -2
  297. package/src/{core/account → account}/Account.ts +25 -15
  298. package/src/{core/account → account}/Ed25519Account.ts +45 -9
  299. package/src/account/MultiKeyAccount.ts +176 -0
  300. package/src/{core/account → account}/SingleKeyAccount.ts +45 -10
  301. package/src/account/index.ts +4 -0
  302. package/src/api/account.ts +2 -1
  303. package/src/api/ans.ts +2 -1
  304. package/src/api/aptos.ts +6 -0
  305. package/src/api/digitalAsset.ts +2 -1
  306. package/src/api/fungibleAsset.ts +2 -1
  307. package/src/api/general.ts +0 -26
  308. package/src/api/table.ts +108 -0
  309. package/src/api/transaction.ts +2 -1
  310. package/src/api/transactionSubmission/management.ts +1 -1
  311. package/src/api/transactionSubmission/sign.ts +1 -1
  312. package/src/cli/move.ts +1 -1
  313. package/src/core/account/index.ts +0 -3
  314. package/src/core/crypto/multiKey.ts +17 -6
  315. package/src/core/index.ts +0 -1
  316. package/src/index.ts +1 -0
  317. package/src/internal/account.ts +3 -2
  318. package/src/internal/ans.ts +2 -1
  319. package/src/internal/digitalAsset.ts +2 -1
  320. package/src/internal/fungibleAsset.ts +2 -1
  321. package/src/internal/general.ts +1 -20
  322. package/src/internal/queries/currentTokenOwnershipFieldsFragment.graphql +1 -0
  323. package/src/internal/queries/getTableItemsData.graphql +15 -0
  324. package/src/internal/queries/getTableItemsMetadata.graphql +12 -0
  325. package/src/internal/table.ts +82 -0
  326. package/src/internal/transactionSubmission.ts +5 -7
  327. package/src/transactions/authenticator/account.ts +6 -11
  328. package/src/transactions/management/accountSequenceNumber.ts +1 -1
  329. package/src/transactions/management/transactionWorker.ts +1 -1
  330. package/src/transactions/transactionBuilder/index.ts +1 -0
  331. package/src/transactions/transactionBuilder/signingMessage.ts +93 -0
  332. package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -73
  333. package/src/types/generated/operations.ts +29 -0
  334. package/src/types/generated/queries.ts +59 -0
  335. package/src/types/generated/types.ts +223 -4
  336. package/src/types/indexer.ts +4 -0
  337. package/src/version.ts +1 -1
  338. package/dist/esm/chunk-4374JPA6.mjs +0 -2
  339. package/dist/esm/chunk-4374JPA6.mjs.map +0 -1
  340. package/dist/esm/chunk-62P5CJAJ.mjs +0 -2
  341. package/dist/esm/chunk-62P5CJAJ.mjs.map +0 -1
  342. package/dist/esm/chunk-B3BRR4WP.mjs +0 -2
  343. package/dist/esm/chunk-B3BRR4WP.mjs.map +0 -1
  344. package/dist/esm/chunk-BWFJHFBQ.mjs +0 -2
  345. package/dist/esm/chunk-CDB34C4N.mjs.map +0 -1
  346. package/dist/esm/chunk-CF5R4HVB.mjs +0 -2
  347. package/dist/esm/chunk-CPBGL37X.mjs +0 -2
  348. package/dist/esm/chunk-DSTKXJMA.mjs +0 -2
  349. package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
  350. package/dist/esm/chunk-FBPNHF54.mjs +0 -2
  351. package/dist/esm/chunk-HG4Q4EFG.mjs.map +0 -1
  352. package/dist/esm/chunk-HWECUBBA.mjs.map +0 -1
  353. package/dist/esm/chunk-IR46T46A.mjs +0 -2
  354. package/dist/esm/chunk-IR46T46A.mjs.map +0 -1
  355. package/dist/esm/chunk-LBGYH45K.mjs +0 -2
  356. package/dist/esm/chunk-LBGYH45K.mjs.map +0 -1
  357. package/dist/esm/chunk-MFL3UCKA.mjs +0 -2
  358. package/dist/esm/chunk-MFL3UCKA.mjs.map +0 -1
  359. package/dist/esm/chunk-MLWIHWNH.mjs +0 -1
  360. package/dist/esm/chunk-NBCHJ75L.mjs +0 -2
  361. package/dist/esm/chunk-NBCHJ75L.mjs.map +0 -1
  362. package/dist/esm/chunk-NZGRLKRG.mjs +0 -2
  363. package/dist/esm/chunk-OGHE4AQA.mjs +0 -2
  364. package/dist/esm/chunk-P3UFJZY5.mjs.map +0 -1
  365. package/dist/esm/chunk-PJPXC22D.mjs +0 -2
  366. package/dist/esm/chunk-PJPXC22D.mjs.map +0 -1
  367. package/dist/esm/chunk-PMUT3HZE.mjs.map +0 -1
  368. package/dist/esm/chunk-PYXJYEAC.mjs.map +0 -1
  369. package/dist/esm/chunk-QD2Y3VK4.mjs.map +0 -1
  370. package/dist/esm/chunk-QIAHBEEW.mjs +0 -2
  371. package/dist/esm/chunk-QIAU5K5Y.mjs +0 -2
  372. package/dist/esm/chunk-QIAU5K5Y.mjs.map +0 -1
  373. package/dist/esm/chunk-R5QUBEH6.mjs +0 -2
  374. package/dist/esm/chunk-R7G3CLRI.mjs +0 -1
  375. package/dist/esm/chunk-RR7I2HLA.mjs +0 -2
  376. package/dist/esm/chunk-RR7I2HLA.mjs.map +0 -1
  377. package/dist/esm/chunk-RW2A63WK.mjs.map +0 -1
  378. package/dist/esm/chunk-S4SEFF4K.mjs.map +0 -1
  379. package/dist/esm/chunk-TBMAJ6AW.mjs +0 -2
  380. package/dist/esm/chunk-TGXZVNR5.mjs +0 -2
  381. package/dist/esm/chunk-TJDC5PWD.mjs +0 -2
  382. package/dist/esm/chunk-UF534PKA.mjs +0 -2
  383. package/dist/esm/chunk-UF534PKA.mjs.map +0 -1
  384. package/dist/esm/chunk-UMDTVVQC.mjs +0 -2
  385. package/dist/esm/chunk-UMDTVVQC.mjs.map +0 -1
  386. package/dist/esm/chunk-UNU3RVRJ.mjs +0 -2
  387. package/dist/esm/chunk-WFZDFFBM.mjs +0 -2
  388. package/dist/esm/chunk-XIJHRBDL.mjs +0 -2
  389. package/dist/esm/chunk-XIJHRBDL.mjs.map +0 -1
  390. package/dist/esm/chunk-ZEHKHKBP.mjs +0 -2
  391. package/dist/esm/chunk-ZEHKHKBP.mjs.map +0 -1
  392. package/dist/esm/chunk-ZYYK3UXP.mjs +0 -2
  393. package/dist/esm/core/account/Account.d.mts +0 -20
  394. package/dist/esm/core/account/Account.mjs +0 -2
  395. package/dist/esm/core/account/Ed25519Account.d.mts +0 -20
  396. package/dist/esm/core/account/Ed25519Account.mjs +0 -2
  397. package/dist/esm/core/account/SingleKeyAccount.d.mts +0 -20
  398. package/dist/esm/core/account/SingleKeyAccount.mjs +0 -2
  399. /package/dist/esm/{core/account → account}/Account.mjs.map +0 -0
  400. /package/dist/esm/{core/account → account}/Ed25519Account.mjs.map +0 -0
  401. /package/dist/esm/{chunk-E7FWVXGX.mjs.map → account/MultiKeyAccount.mjs.map} +0 -0
  402. /package/dist/esm/{core/account → account}/SingleKeyAccount.mjs.map +0 -0
  403. /package/dist/esm/{chunk-MLWIHWNH.mjs.map → account/index.mjs.map} +0 -0
  404. /package/dist/esm/{chunk-R7G3CLRI.mjs.map → api/table.mjs.map} +0 -0
  405. /package/dist/esm/{chunk-XO3HHRJV.mjs.map → chunk-2O5VFH5O.mjs.map} +0 -0
  406. /package/dist/esm/{chunk-PXFIA4BL.mjs.map → chunk-2XK53QFA.mjs.map} +0 -0
  407. /package/dist/esm/{chunk-RHBCVCOS.mjs.map → chunk-35EWRSDK.mjs.map} +0 -0
  408. /package/dist/esm/{chunk-52C73T26.mjs.map → chunk-36QXVFR5.mjs.map} +0 -0
  409. /package/dist/esm/{chunk-WCVUDO5S.mjs.map → chunk-3B6IKORV.mjs.map} +0 -0
  410. /package/dist/esm/{chunk-WFZDFFBM.mjs.map → chunk-4NHWV5AI.mjs.map} +0 -0
  411. /package/dist/esm/{chunk-5HY3DEPF.mjs.map → chunk-5CEZFZHP.mjs.map} +0 -0
  412. /package/dist/esm/{chunk-NPFNYP75.mjs.map → chunk-5EN52MUT.mjs.map} +0 -0
  413. /package/dist/esm/{chunk-BE4FOV6X.mjs.map → chunk-6E23TANW.mjs.map} +0 -0
  414. /package/dist/esm/{chunk-6OV2PQS5.mjs.map → chunk-6IKL4CPY.mjs.map} +0 -0
  415. /package/dist/esm/{chunk-NZGRLKRG.mjs.map → chunk-7PPN3XDQ.mjs.map} +0 -0
  416. /package/dist/esm/{chunk-TGXZVNR5.mjs.map → chunk-7VRZLDIJ.mjs.map} +0 -0
  417. /package/dist/esm/{chunk-DSTKXJMA.mjs.map → chunk-B7X6PSE7.mjs.map} +0 -0
  418. /package/dist/esm/{chunk-AOCNYMMX.mjs.map → chunk-BCUSI3N6.mjs.map} +0 -0
  419. /package/dist/esm/{chunk-BAV4XY7C.mjs.map → chunk-BHLICYAI.mjs.map} +0 -0
  420. /package/dist/esm/{chunk-OGHE4AQA.mjs.map → chunk-BO2TLWNT.mjs.map} +0 -0
  421. /package/dist/esm/{chunk-N77VJHW5.mjs.map → chunk-C22QZ32Q.mjs.map} +0 -0
  422. /package/dist/esm/{chunk-TBMAJ6AW.mjs.map → chunk-CEHCDA3G.mjs.map} +0 -0
  423. /package/dist/esm/{chunk-TJDC5PWD.mjs.map → chunk-F7EMGK4M.mjs.map} +0 -0
  424. /package/dist/esm/{chunk-FS3NSGBF.mjs.map → chunk-G56GPLTB.mjs.map} +0 -0
  425. /package/dist/esm/{chunk-6FBKUTGF.mjs.map → chunk-GHYE26Q5.mjs.map} +0 -0
  426. /package/dist/esm/{chunk-QTRYMRYK.mjs.map → chunk-GM56MMNJ.mjs.map} +0 -0
  427. /package/dist/esm/{chunk-2G4ZSGL4.mjs.map → chunk-GZIOZUKM.mjs.map} +0 -0
  428. /package/dist/esm/{chunk-SPU745XV.mjs.map → chunk-HXGEF7O7.mjs.map} +0 -0
  429. /package/dist/esm/{chunk-O4JRPZZM.mjs.map → chunk-I6ST47U7.mjs.map} +0 -0
  430. /package/dist/esm/{chunk-4P5EKAJB.mjs.map → chunk-IZZ6BA56.mjs.map} +0 -0
  431. /package/dist/esm/{chunk-UNU3RVRJ.mjs.map → chunk-JPNTJOQW.mjs.map} +0 -0
  432. /package/dist/esm/{chunk-UML2VQZT.mjs.map → chunk-KAGLWBIJ.mjs.map} +0 -0
  433. /package/dist/esm/{chunk-L5IL2IAB.mjs.map → chunk-L5KHEQW5.mjs.map} +0 -0
  434. /package/dist/esm/{chunk-FBPNHF54.mjs.map → chunk-LG7RJQ57.mjs.map} +0 -0
  435. /package/dist/esm/{chunk-U43IJHQN.mjs.map → chunk-MJPUASSD.mjs.map} +0 -0
  436. /package/dist/esm/{chunk-ZYYK3UXP.mjs.map → chunk-N3U47Y6Y.mjs.map} +0 -0
  437. /package/dist/esm/{chunk-UPIN5AIO.mjs.map → chunk-P6GWG2CY.mjs.map} +0 -0
  438. /package/dist/esm/{chunk-BWFJHFBQ.mjs.map → chunk-PF57EOJY.mjs.map} +0 -0
  439. /package/dist/esm/{chunk-3YZGJLW7.mjs.map → chunk-PI2NFZEH.mjs.map} +0 -0
  440. /package/dist/esm/{chunk-APDALGDD.mjs.map → chunk-S2VSJJRJ.mjs.map} +0 -0
  441. /package/dist/esm/{chunk-CF5R4HVB.mjs.map → chunk-SFM5C2IG.mjs.map} +0 -0
  442. /package/dist/esm/{chunk-CNMQNPNV.mjs.map → chunk-SGTNW5YI.mjs.map} +0 -0
  443. /package/dist/esm/{chunk-DMKUAQB7.mjs.map → chunk-U3YYSIIT.mjs.map} +0 -0
  444. /package/dist/esm/{chunk-R5QUBEH6.mjs.map → chunk-UGPALAPN.mjs.map} +0 -0
  445. /package/dist/esm/{chunk-BIAEC6FO.mjs.map → chunk-UM35A7RD.mjs.map} +0 -0
  446. /package/dist/esm/{chunk-FXNFWLQC.mjs.map → chunk-UPSCPEEE.mjs.map} +0 -0
  447. /package/dist/esm/{chunk-S2LTZKM4.mjs.map → chunk-VGGYFJUY.mjs.map} +0 -0
  448. /package/dist/esm/{chunk-JCD72AW7.mjs.map → chunk-YK732P36.mjs.map} +0 -0
  449. /package/dist/esm/{chunk-UDRSFVAK.mjs.map → chunk-YMB2XW2O.mjs.map} +0 -0
  450. /package/dist/esm/{chunk-NWYIE7ZX.mjs.map → chunk-YZHIXVPR.mjs.map} +0 -0
  451. /package/dist/esm/{publicKey-lq5djCIY.d.mts → publicKey-B3XRNhHO.d.mts} +0 -0
@@ -0,0 +1,108 @@
1
+ import { getTableItem, getTableItemsData, getTableItemsMetadata } from "../internal/table";
2
+ import {
3
+ TableItemRequest,
4
+ LedgerVersionArg,
5
+ AnyNumber,
6
+ PaginationArgs,
7
+ WhereArg,
8
+ OrderByArg,
9
+ GetTableItemsDataResponse,
10
+ GetTableItemsMetadataResponse,
11
+ } from "../types";
12
+ import { TableItemsBoolExp, TableMetadatasBoolExp } from "../types/generated/types";
13
+ import { ProcessorType } from "../utils";
14
+ import { AptosConfig } from "./aptosConfig";
15
+ import { waitForIndexerOnVersion } from "./utils";
16
+
17
+ /**
18
+ * A class to query all `Table` Aptos related queries
19
+ */
20
+ export class Table {
21
+ readonly config: AptosConfig;
22
+
23
+ constructor(config: AptosConfig) {
24
+ this.config = config;
25
+ }
26
+
27
+ /**
28
+ * Queries for a table item for a table identified by the handle and the key for the item.
29
+ * Key and value types need to be passed in to help with key serialization and value deserialization.
30
+ *
31
+ * Note, this query calls the fullnode server
32
+ *
33
+ * @example https://api.devnet.aptoslabs.com/v1/accounts/0x1/resource/0x1::coin::CoinInfo%3C0x1::aptos_coin::AptosCoin%3E
34
+ * const tableItem = await aptos.getTableItem({
35
+ * handle: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
36
+ * data: {
37
+ * key_type: "address", // Move type of table key
38
+ * value_type: "u128", // Move type of table value
39
+ * key: "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935" // Value of table key
40
+ * },
41
+ * })
42
+ *
43
+ * @param args.handle A pointer to where that table is stored
44
+ * @param args.data Object that describes table item
45
+ * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version
46
+ *
47
+ * @returns Table item value rendered in JSON
48
+ */
49
+ async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: LedgerVersionArg }): Promise<T> {
50
+ return getTableItem<T>({ aptosConfig: this.config, ...args });
51
+ }
52
+
53
+ /**
54
+ * Queries for a table items data.
55
+ *
56
+ * Optional `options.where` param can be passed to filter the response.
57
+ *
58
+ * Note, this query calls the indexer server
59
+ *
60
+ * @example
61
+ * const data = await aptos.getTableItemsData({
62
+ * options: { where: {
63
+ * table_handle: { _eq: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca" },
64
+ * transaction_version: { _eq: "0" }
65
+ * }
66
+ * },
67
+ * });
68
+ *
69
+ * @returns GetTableItemsDataResponse
70
+ */
71
+ async getTableItemsData(args: {
72
+ minimumLedgerVersion?: AnyNumber;
73
+ options?: PaginationArgs & WhereArg<TableItemsBoolExp> & OrderByArg<GetTableItemsDataResponse[0]>;
74
+ }): Promise<GetTableItemsDataResponse> {
75
+ await waitForIndexerOnVersion({
76
+ config: this.config,
77
+ minimumLedgerVersion: args.minimumLedgerVersion,
78
+ processorType: ProcessorType.DEFAULT,
79
+ });
80
+ return getTableItemsData({ aptosConfig: this.config, ...args });
81
+ }
82
+
83
+ /**
84
+ * Queries for a table items metadata.
85
+ *
86
+ * Optional `options.where` param can be passed to filter the response.
87
+ *
88
+ * Note, this query calls the indexer server
89
+ *
90
+ * @example
91
+ * const data = await aptos.getTableItemsMetadata({
92
+ * options: { where: { handle: { _eq: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca" } } },
93
+ * });
94
+ *
95
+ * @returns GetTableItemsMetadataResponse
96
+ */
97
+ async getTableItemsMetadata(args: {
98
+ minimumLedgerVersion?: AnyNumber;
99
+ options?: PaginationArgs & WhereArg<TableMetadatasBoolExp> & OrderByArg<GetTableItemsMetadataResponse[0]>;
100
+ }): Promise<GetTableItemsMetadataResponse> {
101
+ await waitForIndexerOnVersion({
102
+ config: this.config,
103
+ minimumLedgerVersion: args.minimumLedgerVersion,
104
+ processorType: ProcessorType.DEFAULT,
105
+ });
106
+ return getTableItemsMetadata({ aptosConfig: this.config, ...args });
107
+ }
108
+ }
@@ -33,7 +33,8 @@ import {
33
33
  InputGenerateTransactionOptions,
34
34
  InputGenerateTransactionPayloadData,
35
35
  } from "../transactions";
36
- import { AccountAddressInput, Account, PrivateKey } from "../core";
36
+ import { AccountAddressInput, PrivateKey } from "../core";
37
+ import { Account } from "../account";
37
38
  import { Build } from "./transactionSubmission/build";
38
39
  import { Simulate } from "./transactionSubmission/simulate";
39
40
  import { Submit } from "./transactionSubmission/submit";
@@ -2,7 +2,7 @@ import EventEmitter from "eventemitter3";
2
2
  import { TransactionWorkerEvents, TransactionWorker, TransactionWorkerEventsEnum } from "../../transactions/management";
3
3
  import { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from "../../transactions";
4
4
  import { AptosConfig } from "../aptosConfig";
5
- import { Account } from "../../core";
5
+ import { Account } from "../../account";
6
6
 
7
7
  export class TransactionManagement extends EventEmitter<TransactionWorkerEvents> {
8
8
  account!: Account;
@@ -1,7 +1,7 @@
1
1
  // Copyright © Aptos Foundation
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { Account } from "../../core";
4
+ import { Account } from "../../account";
5
5
  import { signTransaction } from "../../internal/transactionSubmission";
6
6
  import { AccountAuthenticator, AnyRawTransaction } from "../../transactions";
7
7
  import { AptosConfig } from "../aptosConfig";
package/src/cli/move.ts CHANGED
@@ -114,7 +114,7 @@ export class Move {
114
114
  // eslint-disable-next-line class-methods-use-this
115
115
  private async runCommand(args: Array<string>): Promise<boolean> {
116
116
  return new Promise((resolve, reject) => {
117
- const childProcess = spawn("npx", args);
117
+ const childProcess = spawn("npx", args, { shell: true });
118
118
 
119
119
  childProcess.stdout.pipe(process.stdout);
120
120
  childProcess.stderr.pipe(process.stderr);
@@ -1,4 +1 @@
1
- export * from "./Ed25519Account";
2
- export * from "./Account";
3
- export * from "./SingleKeyAccount";
4
1
  export * from "./utils";
@@ -139,6 +139,22 @@ export class MultiKey extends AccountPublicKey {
139
139
 
140
140
  return bitmap;
141
141
  }
142
+
143
+ /**
144
+ * Get the index of the provided public key.
145
+ *
146
+ * @param publicKey array of the index mapping to the matching public keys
147
+ * @returns the corresponding index of the publicKey, if it exists
148
+ */
149
+ getIndex(publicKey: PublicKey): number {
150
+ const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);
151
+ const index = this.publicKeys.findIndex((pk) => pk.toString() === anyPublicKey.toString());
152
+
153
+ if (index !== -1) {
154
+ return index;
155
+ }
156
+ throw new Error("Public key not found in MultiKey");
157
+ }
142
158
  }
143
159
 
144
160
  export class MultiKeySignature extends Signature {
@@ -266,13 +282,8 @@ export class MultiKeySignature extends Signature {
266
282
  }
267
283
 
268
284
  static deserialize(deserializer: Deserializer): MultiKeySignature {
285
+ const signatures = deserializer.deserializeVector(AnySignature);
269
286
  const bitmap = deserializer.deserializeBytes();
270
- const nSignatures = bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);
271
- const signatures: AnySignature[] = [];
272
- for (let i = 0; i < nSignatures; i += 1) {
273
- const signature = AnySignature.deserialize(deserializer);
274
- signatures.push(signature);
275
- }
276
287
  return new MultiKeySignature({ signatures, bitmap });
277
288
  }
278
289
 
package/src/core/index.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  // Copyright © Aptos Foundation
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- export * from "./account";
5
4
  export * from "./accountAddress";
6
5
  export * from "./authenticationKey";
7
6
  export * from "./common";
package/src/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  // Copyright © Aptos Foundation
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
+ export * from "./account";
4
5
  export * from "./api";
5
6
  export * from "./bcs";
6
7
  export * from "./client";
@@ -11,9 +11,9 @@
11
11
  import { AptosConfig } from "../api/aptosConfig";
12
12
  import { AptosApiError, getAptosFullNode, paginateWithCursor } from "../client";
13
13
  import { AccountAddress, AccountAddressInput } from "../core/accountAddress";
14
- import { Account } from "../core/account";
14
+ import { Account } from "../account";
15
15
  import { AnyPublicKey, Ed25519PublicKey, PrivateKey } from "../core/crypto";
16
- import { getTableItem, queryIndexer } from "./general";
16
+ import { queryIndexer } from "./general";
17
17
  import {
18
18
  AccountData,
19
19
  GetAccountCoinsDataResponse,
@@ -54,6 +54,7 @@ import {
54
54
  import { memoizeAsync } from "../utils/memoize";
55
55
  import { Secp256k1PrivateKey, AuthenticationKey, Ed25519PrivateKey } from "../core";
56
56
  import { CurrentFungibleAssetBalancesBoolExp } from "../types/generated/types";
57
+ import { getTableItem } from "./table";
57
58
 
58
59
  export async function getInfo(args: {
59
60
  aptosConfig: AptosConfig;
@@ -9,7 +9,8 @@
9
9
  */
10
10
 
11
11
  import { AptosConfig } from "../api/aptosConfig";
12
- import { Account, AccountAddress, AccountAddressInput } from "../core";
12
+ import { Account } from "../account";
13
+ import { AccountAddress, AccountAddressInput } from "../core";
13
14
  import { InputGenerateTransactionOptions } from "../transactions/types";
14
15
  import { GetANSNameResponse, MoveAddressType, OrderByArg, PaginationArgs, WhereArg } from "../types";
15
16
  import { GetNamesQuery } from "../types/generated/operations";
@@ -10,7 +10,8 @@
10
10
 
11
11
  import { AptosConfig } from "../api/aptosConfig";
12
12
  import { Bool, MoveString, MoveVector, U64 } from "../bcs";
13
- import { Account, AccountAddress, AccountAddressInput } from "../core";
13
+ import { AccountAddress, AccountAddressInput } from "../core";
14
+ import { Account } from "../account";
14
15
  import { EntryFunctionABI, InputGenerateTransactionOptions } from "../transactions/types";
15
16
  import {
16
17
  AnyNumber,
@@ -33,7 +33,8 @@ import {
33
33
  FungibleAssetActivitiesBoolExp,
34
34
  FungibleAssetMetadataBoolExp,
35
35
  } from "../types/generated/types";
36
- import { Account, AccountAddressInput } from "../core";
36
+ import { AccountAddressInput } from "../core";
37
+ import { Account } from "../account";
37
38
  import {
38
39
  EntryFunctionABI,
39
40
  InputGenerateTransactionOptions,
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import { AptosConfig } from "../api/aptosConfig";
12
- import { getAptosFullNode, postAptosFullNode, postAptosIndexer } from "../client";
12
+ import { getAptosFullNode, postAptosIndexer } from "../client";
13
13
  import {
14
14
  AnyNumber,
15
15
  Block,
@@ -17,8 +17,6 @@ import {
17
17
  GetProcessorStatusResponse,
18
18
  GraphqlQuery,
19
19
  LedgerInfo,
20
- LedgerVersionArg,
21
- TableItemRequest,
22
20
  } from "../types";
23
21
  import { GetChainTopUserTransactionsQuery, GetProcessorStatusQuery } from "../types/generated/operations";
24
22
  import { GetChainTopUserTransactions, GetProcessorStatus } from "../types/generated/queries";
@@ -64,23 +62,6 @@ export async function getBlockByHeight(args: {
64
62
  return data;
65
63
  }
66
64
 
67
- export async function getTableItem<T>(args: {
68
- aptosConfig: AptosConfig;
69
- handle: string;
70
- data: TableItemRequest;
71
- options?: LedgerVersionArg;
72
- }): Promise<T> {
73
- const { aptosConfig, handle, data, options } = args;
74
- const response = await postAptosFullNode<TableItemRequest, any>({
75
- aptosConfig,
76
- originMethod: "getTableItem",
77
- path: `tables/${handle}/item`,
78
- params: { ledger_version: options?.ledgerVersion },
79
- body: data,
80
- });
81
- return response.data as T;
82
- }
83
-
84
65
  export async function getChainTopUserTransactions(args: {
85
66
  aptosConfig: AptosConfig;
86
67
  limit: number;
@@ -25,6 +25,7 @@ fragment CurrentTokenOwnershipFields on current_token_ownerships_v2 {
25
25
  token_properties
26
26
  token_standard
27
27
  token_uri
28
+ decimals
28
29
  current_collection {
29
30
  collection_id
30
31
  collection_name
@@ -0,0 +1,15 @@
1
+ query getTableItemsData(
2
+ $where_condition: table_items_bool_exp!
3
+ $offset: Int
4
+ $limit: Int
5
+ $order_by: [table_items_order_by!]
6
+ ) {
7
+ table_items(where: $where_condition, offset: $offset, limit: $limit, order_by: $order_by){
8
+ decoded_key
9
+ decoded_value
10
+ key
11
+ table_handle
12
+ transaction_version
13
+ write_set_change_index
14
+ }
15
+ }
@@ -0,0 +1,12 @@
1
+ query getTableItemsMetadata(
2
+ $where_condition: table_metadatas_bool_exp!
3
+ $offset: Int
4
+ $limit: Int
5
+ $order_by: [table_metadatas_order_by!]
6
+ ) {
7
+ table_metadatas(where: $where_condition, offset: $offset, limit: $limit, order_by: $order_by){
8
+ handle
9
+ key_type
10
+ value_type
11
+ }
12
+ }
@@ -0,0 +1,82 @@
1
+ import { AptosConfig } from "../api/aptosConfig";
2
+ import { postAptosFullNode } from "../client";
3
+ import {
4
+ TableItemRequest,
5
+ LedgerVersionArg,
6
+ PaginationArgs,
7
+ WhereArg,
8
+ OrderByArg,
9
+ GetTableItemsDataResponse,
10
+ GetTableItemsMetadataResponse,
11
+ } from "../types";
12
+ import { GetTableItemsDataQuery, GetTableItemsMetadataQuery } from "../types/generated/operations";
13
+ import { GetTableItemsData, GetTableItemsMetadata } from "../types/generated/queries";
14
+ import { TableItemsBoolExp, TableMetadatasBoolExp } from "../types/generated/types";
15
+ import { queryIndexer } from "./general";
16
+
17
+ export async function getTableItem<T>(args: {
18
+ aptosConfig: AptosConfig;
19
+ handle: string;
20
+ data: TableItemRequest;
21
+ options?: LedgerVersionArg;
22
+ }): Promise<T> {
23
+ const { aptosConfig, handle, data, options } = args;
24
+ const response = await postAptosFullNode<TableItemRequest, any>({
25
+ aptosConfig,
26
+ originMethod: "getTableItem",
27
+ path: `tables/${handle}/item`,
28
+ params: { ledger_version: options?.ledgerVersion },
29
+ body: data,
30
+ });
31
+ return response.data as T;
32
+ }
33
+
34
+ export async function getTableItemsData(args: {
35
+ aptosConfig: AptosConfig;
36
+ options?: PaginationArgs & WhereArg<TableItemsBoolExp> & OrderByArg<GetTableItemsDataResponse[0]>;
37
+ }) {
38
+ const { aptosConfig, options } = args;
39
+
40
+ const graphqlQuery = {
41
+ query: GetTableItemsData,
42
+ variables: {
43
+ where_condition: options?.where,
44
+ offset: options?.offset,
45
+ limit: options?.limit,
46
+ order_by: options?.orderBy,
47
+ },
48
+ };
49
+
50
+ const data = await queryIndexer<GetTableItemsDataQuery>({
51
+ aptosConfig,
52
+ query: graphqlQuery,
53
+ originMethod: "getTableItemsData",
54
+ });
55
+
56
+ return data.table_items;
57
+ }
58
+
59
+ export async function getTableItemsMetadata(args: {
60
+ aptosConfig: AptosConfig;
61
+ options?: PaginationArgs & WhereArg<TableMetadatasBoolExp> & OrderByArg<GetTableItemsMetadataResponse[0]>;
62
+ }): Promise<GetTableItemsMetadataResponse> {
63
+ const { aptosConfig, options } = args;
64
+
65
+ const graphqlQuery = {
66
+ query: GetTableItemsMetadata,
67
+ variables: {
68
+ where_condition: options?.where,
69
+ offset: options?.offset,
70
+ limit: options?.limit,
71
+ order_by: options?.orderBy,
72
+ },
73
+ };
74
+
75
+ const data = await queryIndexer<GetTableItemsMetadataQuery>({
76
+ aptosConfig,
77
+ query: graphqlQuery,
78
+ originMethod: "getTableItemsMetadata",
79
+ });
80
+
81
+ return data.table_metadatas;
82
+ }
@@ -8,7 +8,7 @@
8
8
  import { AptosConfig } from "../api/aptosConfig";
9
9
  import { MoveVector, U8 } from "../bcs";
10
10
  import { postAptosFullNode } from "../client";
11
- import { Account } from "../core/account";
11
+ import { Account } from "../account";
12
12
  import { AccountAddress, AccountAddressInput } from "../core/accountAddress";
13
13
  import { PrivateKey } from "../core/crypto";
14
14
  import { AccountAuthenticator } from "../transactions/authenticator/account";
@@ -18,8 +18,6 @@ import {
18
18
  generateTransactionPayload,
19
19
  generateSignedTransactionForSimulation,
20
20
  generateSignedTransaction,
21
- sign,
22
- generateSigningMessage,
23
21
  } from "../transactions/transactionBuilder/transactionBuilder";
24
22
  import {
25
23
  InputGenerateTransactionData,
@@ -35,7 +33,7 @@ import {
35
33
  } from "../transactions/types";
36
34
  import { getInfo } from "./account";
37
35
  import { UserTransactionResponse, PendingTransactionResponse, MimeType, HexInput, TransactionResponse } from "../types";
38
- import { TypeTagU8, TypeTagVector } from "../transactions";
36
+ import { TypeTagU8, TypeTagVector, generateSigningMessageForTransaction } from "../transactions";
39
37
  import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
40
38
  import { MultiAgentTransaction } from "../transactions/instances/multiAgentTransaction";
41
39
 
@@ -185,7 +183,7 @@ function isMultiAgentTransactionInput(
185
183
  */
186
184
  export function getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {
187
185
  const { transaction } = args;
188
- return generateSigningMessage(transaction);
186
+ return generateSigningMessageForTransaction(transaction);
189
187
  }
190
188
 
191
189
  /**
@@ -204,8 +202,8 @@ export function getSigningMessage(args: { transaction: AnyRawTransaction }): Uin
204
202
  * @return The signer AccountAuthenticator
205
203
  */
206
204
  export function signTransaction(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
207
- const accountAuthenticator = sign({ ...args });
208
- return accountAuthenticator;
205
+ const { signer, transaction } = args;
206
+ return signer.signTransactionWithAuthenticator(transaction);
209
207
  }
210
208
 
211
209
  /**
@@ -7,7 +7,7 @@ import { Serializer, Deserializer, Serializable } from "../../bcs";
7
7
  import { AnyPublicKey, AnySignature } from "../../core/crypto";
8
8
  import { Ed25519PublicKey, Ed25519Signature } from "../../core/crypto/ed25519";
9
9
  import { MultiEd25519PublicKey, MultiEd25519Signature } from "../../core/crypto/multiEd25519";
10
- import { MultiKey } from "../../core/crypto/multiKey";
10
+ import { MultiKey, MultiKeySignature } from "../../core/crypto/multiKey";
11
11
  import { AccountAuthenticatorVariant } from "../../types";
12
12
 
13
13
  export abstract class AccountAuthenticator extends Serializable {
@@ -149,28 +149,23 @@ export class AccountAuthenticatorSingleKey extends AccountAuthenticator {
149
149
  export class AccountAuthenticatorMultiKey extends AccountAuthenticator {
150
150
  public readonly public_keys: MultiKey;
151
151
 
152
- public readonly signatures: Array<AnySignature>;
152
+ public readonly signatures: MultiKeySignature;
153
153
 
154
- public readonly signatures_bitmap: Uint8Array;
155
-
156
- constructor(public_keys: MultiKey, signatures: Array<AnySignature>, signatures_bitmap: Uint8Array) {
154
+ constructor(public_keys: MultiKey, signatures: MultiKeySignature) {
157
155
  super();
158
156
  this.public_keys = public_keys;
159
157
  this.signatures = signatures;
160
- this.signatures_bitmap = signatures_bitmap;
161
158
  }
162
159
 
163
160
  serialize(serializer: Serializer): void {
164
161
  serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiKey);
165
162
  this.public_keys.serialize(serializer);
166
- serializer.serializeVector<AnySignature>(this.signatures);
167
- serializer.serializeBytes(this.signatures_bitmap);
163
+ this.signatures.serialize(serializer);
168
164
  }
169
165
 
170
166
  static load(deserializer: Deserializer): AccountAuthenticatorMultiKey {
171
167
  const public_keys = MultiKey.deserialize(deserializer);
172
- const signatures = deserializer.deserializeVector(AnySignature);
173
- const signatures_bitmap = deserializer.deserializeBytes();
174
- return new AccountAuthenticatorMultiKey(public_keys, signatures, signatures_bitmap);
168
+ const signatures = MultiKeySignature.deserialize(deserializer);
169
+ return new AccountAuthenticatorMultiKey(public_keys, signatures);
175
170
  }
176
171
  }
@@ -24,7 +24,7 @@
24
24
  */
25
25
 
26
26
  import { AptosConfig } from "../../api/aptosConfig";
27
- import { Account } from "../../core";
27
+ import { Account } from "../../account";
28
28
  import { getInfo } from "../../internal/account";
29
29
  import { sleep } from "../../utils/helpers";
30
30
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  import EventEmitter from "eventemitter3";
4
4
  import { AptosConfig } from "../../api/aptosConfig";
5
- import { Account } from "../../core";
5
+ import { Account } from "../../account";
6
6
  import { waitForTransaction } from "../../internal/transaction";
7
7
  import { generateTransaction, signAndSubmitTransaction } from "../../internal/transactionSubmission";
8
8
  import { PendingTransactionResponse, TransactionResponse } from "../../types";
@@ -4,3 +4,4 @@
4
4
  export * from "./helpers";
5
5
  export * from "./transactionBuilder";
6
6
  export * from "./remoteAbi";
7
+ export * from "./signingMessage";
@@ -0,0 +1,93 @@
1
+ // Copyright © Aptos Foundation
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /**
5
+ * This file handles the generation of the signing message.
6
+ */
7
+ import { sha3_256 as sha3Hash } from "@noble/hashes/sha3";
8
+ import { RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT } from "../../utils/const";
9
+ import { FeePayerRawTransaction, MultiAgentRawTransaction } from "../instances";
10
+ import { AnyRawTransaction, AnyRawTransactionInstance } from "../types";
11
+ import { Serializable } from "../../bcs";
12
+
13
+ /**
14
+ * Derive the raw transaction type - FeePayerRawTransaction or MultiAgentRawTransaction or RawTransaction
15
+ *
16
+ * @param transaction A aptos transaction type
17
+ *
18
+ * @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction
19
+ */
20
+ export function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance {
21
+ if (transaction.feePayerAddress) {
22
+ return new FeePayerRawTransaction(
23
+ transaction.rawTransaction,
24
+ transaction.secondarySignerAddresses ?? [],
25
+ transaction.feePayerAddress,
26
+ );
27
+ }
28
+ if (transaction.secondarySignerAddresses) {
29
+ return new MultiAgentRawTransaction(transaction.rawTransaction, transaction.secondarySignerAddresses);
30
+ }
31
+
32
+ return transaction.rawTransaction;
33
+ }
34
+
35
+ /**
36
+ * Generates the 'signing message' form of a message to be signed.
37
+ *
38
+ * @param bytes The byte representation of the message to be signed and sent to the chain
39
+ * @param domainSeparator A domain separator that starts with 'APTOS::'
40
+ *
41
+ * @returns The Uint8Array of the signing message
42
+ */
43
+ export function generateSigningMessage(bytes: Uint8Array, domainSeparator: string): Uint8Array {
44
+ const hash = sha3Hash.create();
45
+
46
+ if (!domainSeparator.startsWith("APTOS::")) {
47
+ throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${domainSeparator}`);
48
+ }
49
+
50
+ hash.update(domainSeparator);
51
+
52
+ const prefix = hash.digest();
53
+
54
+ const body = bytes;
55
+
56
+ const mergedArray = new Uint8Array(prefix.length + body.length);
57
+ mergedArray.set(prefix);
58
+ mergedArray.set(body, prefix.length);
59
+
60
+ return mergedArray;
61
+ }
62
+
63
+ /**
64
+ * Generates the 'signing message' form of a serilizable value. It bcs serializes the value and uses the name of
65
+ * its constructor as the domain separator.
66
+ *
67
+ * @param serializable An object that has a bcs serialized form
68
+ *
69
+ * @returns The Uint8Array of the signing message
70
+ */
71
+ export function generateSigningMessageForSerializable(serializable: Serializable): Uint8Array {
72
+ return generateSigningMessage(serializable.bcsToBytes(), `APTOS::${serializable.constructor.name}`);
73
+ }
74
+
75
+ /**
76
+ * Generates the 'signing message' form of a transaction. It derives the type of transaction and
77
+ * applies the appropriate domain separator based on if there is extra data such as a fee payer or
78
+ * secondary signers.
79
+ *
80
+ * @param transaction A transaction that is to be signed
81
+ *
82
+ * @returns The Uint8Array of the signing message
83
+ */
84
+ export function generateSigningMessageForTransaction(transaction: AnyRawTransaction): Uint8Array {
85
+ const rawTxn = deriveTransactionType(transaction);
86
+ if (transaction.feePayerAddress) {
87
+ return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);
88
+ }
89
+ if (transaction.secondarySignerAddresses) {
90
+ return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);
91
+ }
92
+ return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_SALT);
93
+ }