@aptos-labs/ts-sdk 0.0.5 → 0.0.6

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 (391) hide show
  1. package/README.md +3 -3
  2. package/dist/browser/index.d.ts +340 -288
  3. package/dist/browser/index.global.js +54 -30
  4. package/dist/browser/index.global.js.map +1 -1
  5. package/dist/common/index.d.ts +340 -288
  6. package/dist/common/index.js +24 -24
  7. package/dist/common/index.js.map +1 -1
  8. package/dist/esm/api/{account.d.ts → account.d.mts} +17 -17
  9. package/dist/esm/api/account.mjs +1 -1
  10. package/dist/esm/api/{ans.d.ts → ans.d.mts} +33 -33
  11. package/dist/esm/api/ans.mjs +1 -1
  12. package/dist/esm/api/aptos.d.mts +72 -0
  13. package/dist/esm/api/aptos.mjs +1 -1
  14. package/dist/esm/api/{aptosConfig.d.ts → aptosConfig.d.mts} +6 -6
  15. package/dist/esm/api/aptosConfig.mjs +1 -1
  16. package/dist/esm/api/coin.d.mts +59 -0
  17. package/dist/esm/api/coin.mjs +1 -1
  18. package/dist/esm/api/{digitalAsset.d.ts → digitalAsset.d.mts} +33 -33
  19. package/dist/esm/api/digitalAsset.mjs +1 -1
  20. package/dist/esm/api/{event.d.ts → event.d.mts} +14 -14
  21. package/dist/esm/api/event.mjs +1 -1
  22. package/dist/esm/api/{faucet.d.ts → faucet.d.mts} +13 -13
  23. package/dist/esm/api/faucet.mjs +1 -1
  24. package/dist/esm/api/{fungibleAsset.d.ts → fungibleAsset.d.mts} +7 -7
  25. package/dist/esm/api/fungibleAsset.mjs +1 -1
  26. package/dist/esm/api/{general.d.ts → general.d.mts} +11 -11
  27. package/dist/esm/api/general.mjs +1 -1
  28. package/dist/esm/api/index.d.mts +46 -0
  29. package/dist/esm/api/index.mjs +1 -1
  30. package/dist/esm/api/{staking.d.ts → staking.d.mts} +13 -13
  31. package/dist/esm/api/staking.mjs +1 -1
  32. package/dist/esm/api/{transaction.d.ts → transaction.d.mts} +7 -7
  33. package/dist/esm/api/transaction.mjs +1 -1
  34. package/dist/esm/api/{transactionSubmission.d.ts → transactionSubmission.d.mts} +33 -33
  35. package/dist/esm/api/transactionSubmission.mjs +1 -1
  36. package/dist/esm/bcs/{consts.d.ts → consts.d.mts} +5 -5
  37. package/dist/esm/bcs/consts.mjs +1 -1
  38. package/dist/esm/bcs/{deserializer.d.ts → deserializer.d.mts} +5 -5
  39. package/dist/esm/bcs/deserializer.mjs +1 -1
  40. package/dist/esm/bcs/index.d.mts +14 -0
  41. package/dist/esm/bcs/index.mjs +1 -1
  42. package/dist/esm/bcs/serializable/{entryFunctionBytes.d.ts → entryFunctionBytes.d.mts} +11 -11
  43. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  44. package/dist/esm/bcs/serializable/{fixedBytes.d.ts → fixedBytes.d.mts} +10 -10
  45. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  46. package/dist/esm/bcs/serializable/{movePrimitives.d.ts → movePrimitives.d.mts} +10 -10
  47. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  48. package/dist/esm/bcs/serializable/{moveStructs.d.ts → moveStructs.d.mts} +11 -11
  49. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  50. package/dist/esm/bcs/{serializer.d.ts → serializer.d.mts} +7 -7
  51. package/dist/esm/bcs/serializer.mjs +1 -1
  52. package/dist/esm/{chunk-WVMDCC4V.mjs → chunk-2W744GUN.mjs} +2 -2
  53. package/dist/esm/{chunk-WVMDCC4V.mjs.map → chunk-2W744GUN.mjs.map} +1 -1
  54. package/dist/esm/chunk-3JVGSFHP.mjs +2 -0
  55. package/dist/esm/chunk-3JVGSFHP.mjs.map +1 -0
  56. package/dist/esm/chunk-44MGBJ73.mjs +2 -0
  57. package/dist/esm/{chunk-CZZJAR3B.mjs.map → chunk-44MGBJ73.mjs.map} +1 -1
  58. package/dist/esm/chunk-4ADA5BE7.mjs +2 -0
  59. package/dist/esm/{chunk-7AQXAH6Q.mjs.map → chunk-4ADA5BE7.mjs.map} +1 -1
  60. package/dist/esm/{chunk-KYWYIK5P.mjs → chunk-4RVIA63I.mjs} +2 -2
  61. package/dist/esm/chunk-4RVIA63I.mjs.map +1 -0
  62. package/dist/esm/chunk-62SCW5NH.mjs +2 -0
  63. package/dist/esm/{chunk-YS2OX7AB.mjs.map → chunk-62SCW5NH.mjs.map} +1 -1
  64. package/dist/esm/{chunk-MIBLZSNS.mjs → chunk-7MNEEVXY.mjs} +2 -2
  65. package/dist/esm/chunk-7MNEEVXY.mjs.map +1 -0
  66. package/dist/esm/{chunk-KPESAXVI.mjs → chunk-AAIBCWZY.mjs} +2 -2
  67. package/dist/esm/{chunk-N6XWY4UT.mjs → chunk-ARVSIDVB.mjs} +1 -1
  68. package/dist/esm/{chunk-N6XWY4UT.mjs.map → chunk-ARVSIDVB.mjs.map} +1 -1
  69. package/dist/esm/{chunk-IXMH6AXJ.mjs → chunk-BFSEVKNA.mjs} +2 -2
  70. package/dist/esm/chunk-BP5ZO7NK.mjs +2 -0
  71. package/dist/esm/{chunk-FHJ7F7Z6.mjs.map → chunk-BP5ZO7NK.mjs.map} +1 -1
  72. package/dist/esm/chunk-BPYLPPEQ.mjs +2 -0
  73. package/dist/esm/{chunk-V6AAQLLJ.mjs.map → chunk-BPYLPPEQ.mjs.map} +1 -1
  74. package/dist/esm/{chunk-3OJN4I42.mjs → chunk-BV4OOU5Y.mjs} +2 -2
  75. package/dist/esm/{chunk-3OJN4I42.mjs.map → chunk-BV4OOU5Y.mjs.map} +1 -1
  76. package/dist/esm/{chunk-VAGYTPSI.mjs → chunk-BWMNPUTK.mjs} +2 -2
  77. package/dist/esm/chunk-CYDWEPFL.mjs +1 -0
  78. package/dist/esm/chunk-EFIYW4WK.mjs +2 -0
  79. package/dist/esm/{chunk-2MQZUGO6.mjs → chunk-EGOYLZBU.mjs} +2 -2
  80. package/dist/esm/chunk-EGOYLZBU.mjs.map +1 -0
  81. package/dist/esm/chunk-EQ5BEDJ7.mjs +2 -0
  82. package/dist/esm/{chunk-ADR4XQPR.mjs.map → chunk-EQ5BEDJ7.mjs.map} +1 -1
  83. package/dist/esm/chunk-EWTHPMEE.mjs +2 -0
  84. package/dist/esm/{chunk-LAXIJRYU.mjs.map → chunk-EWTHPMEE.mjs.map} +1 -1
  85. package/dist/esm/chunk-EYXHVA6W.mjs +2 -0
  86. package/dist/esm/chunk-EYXHVA6W.mjs.map +1 -0
  87. package/dist/esm/chunk-GEFQFRL3.mjs +2 -0
  88. package/dist/esm/chunk-GEFQFRL3.mjs.map +1 -0
  89. package/dist/esm/{chunk-BC2NOUYT.mjs → chunk-GTC7WHMV.mjs} +2 -2
  90. package/dist/esm/{chunk-BC2NOUYT.mjs.map → chunk-GTC7WHMV.mjs.map} +1 -1
  91. package/dist/esm/{chunk-27P7PELS.mjs → chunk-HA6JD5R6.mjs} +2 -2
  92. package/dist/esm/{chunk-27P7PELS.mjs.map → chunk-HA6JD5R6.mjs.map} +1 -1
  93. package/dist/esm/chunk-HVADSXTB.mjs +2 -0
  94. package/dist/esm/{chunk-LU6VS7PJ.mjs.map → chunk-HVADSXTB.mjs.map} +1 -1
  95. package/dist/esm/{chunk-Z56AKXJ7.mjs → chunk-IG5CHHSI.mjs} +2 -2
  96. package/dist/esm/chunk-IXMB2GOK.mjs +2 -0
  97. package/dist/esm/chunk-IXMB2GOK.mjs.map +1 -0
  98. package/dist/esm/{chunk-TYHBYRUA.mjs → chunk-J5ZFOJN2.mjs} +2 -2
  99. package/dist/esm/chunk-J5ZFOJN2.mjs.map +1 -0
  100. package/dist/esm/chunk-JDS7K2WI.mjs +2 -0
  101. package/dist/esm/{chunk-KNLMUSIO.mjs.map → chunk-JDS7K2WI.mjs.map} +1 -1
  102. package/dist/esm/chunk-JZNLZMUC.mjs +2 -0
  103. package/dist/esm/{chunk-WGXAIQ7K.mjs.map → chunk-JZNLZMUC.mjs.map} +1 -1
  104. package/dist/esm/chunk-KQXRH5FK.mjs +2 -0
  105. package/dist/esm/{chunk-UQIOMAXE.mjs.map → chunk-KQXRH5FK.mjs.map} +1 -1
  106. package/dist/esm/{chunk-2B5QXKPU.mjs → chunk-NGCFPQ22.mjs} +2 -2
  107. package/dist/esm/chunk-NGCFPQ22.mjs.map +1 -0
  108. package/dist/esm/chunk-NTD3H2S4.mjs +2 -0
  109. package/dist/esm/chunk-NTD3H2S4.mjs.map +1 -0
  110. package/dist/esm/{chunk-KFP7MDSD.mjs → chunk-NYFVEKF6.mjs} +2 -2
  111. package/dist/esm/chunk-NZIJV4O2.mjs +2 -0
  112. package/dist/esm/{chunk-HH5RSP2H.mjs.map → chunk-NZIJV4O2.mjs.map} +1 -1
  113. package/dist/esm/{chunk-TXUMB5ZO.mjs → chunk-P32MY5YF.mjs} +2 -2
  114. package/dist/esm/{chunk-TXUMB5ZO.mjs.map → chunk-P32MY5YF.mjs.map} +1 -1
  115. package/dist/esm/{chunk-DNYVUM3K.mjs → chunk-Q6N6QACD.mjs} +2 -2
  116. package/dist/esm/{chunk-DNYVUM3K.mjs.map → chunk-Q6N6QACD.mjs.map} +1 -1
  117. package/dist/esm/chunk-QWVR4RCV.mjs +2 -0
  118. package/dist/esm/{chunk-IPJKGHQY.mjs.map → chunk-QWVR4RCV.mjs.map} +1 -1
  119. package/dist/esm/chunk-R26XML3D.mjs +2 -0
  120. package/dist/esm/chunk-R26XML3D.mjs.map +1 -0
  121. package/dist/esm/chunk-R3KWVOFG.mjs +2 -0
  122. package/dist/esm/{chunk-KWJ6XKNF.mjs.map → chunk-R3KWVOFG.mjs.map} +1 -1
  123. package/dist/esm/chunk-RYETO74W.mjs +2 -0
  124. package/dist/esm/{chunk-BIUGRAMO.mjs.map → chunk-RYETO74W.mjs.map} +1 -1
  125. package/dist/esm/chunk-S36IYY6K.mjs +2 -0
  126. package/dist/esm/{chunk-DXUIJ6KA.mjs.map → chunk-S36IYY6K.mjs.map} +1 -1
  127. package/dist/esm/chunk-TIH6ARYP.mjs +2 -0
  128. package/dist/esm/{chunk-IZHPCZE3.mjs.map → chunk-TIH6ARYP.mjs.map} +1 -1
  129. package/dist/esm/{chunk-O243HOP3.mjs → chunk-TQD4IGUM.mjs} +2 -2
  130. package/dist/esm/chunk-TQD4IGUM.mjs.map +1 -0
  131. package/dist/esm/chunk-U25N2VWA.mjs +2 -0
  132. package/dist/esm/{chunk-FNB6CFQR.mjs.map → chunk-U25N2VWA.mjs.map} +1 -1
  133. package/dist/esm/chunk-U3LO2FSJ.mjs +2 -0
  134. package/dist/esm/{chunk-ZXJ5ZBTL.mjs.map → chunk-U3LO2FSJ.mjs.map} +1 -1
  135. package/dist/esm/chunk-U6SZNNVL.mjs +2 -0
  136. package/dist/esm/chunk-U6SZNNVL.mjs.map +1 -0
  137. package/dist/esm/{chunk-EKAOAGNQ.mjs → chunk-UAAI3NCA.mjs} +2 -2
  138. package/dist/esm/chunk-UNQNACJT.mjs +2 -0
  139. package/dist/esm/chunk-UPLWWSB4.mjs +2 -0
  140. package/dist/esm/{chunk-J3QOSJFP.mjs.map → chunk-UPLWWSB4.mjs.map} +1 -1
  141. package/dist/esm/{chunk-XFSL7O6Q.mjs → chunk-V45RFKH7.mjs} +2 -2
  142. package/dist/esm/chunk-V45RFKH7.mjs.map +1 -0
  143. package/dist/esm/{chunk-PJDVHU7X.mjs → chunk-VMQWW5UT.mjs} +2 -2
  144. package/dist/esm/{chunk-PJDVHU7X.mjs.map → chunk-VMQWW5UT.mjs.map} +1 -1
  145. package/dist/esm/chunk-VOYW2TZW.mjs +2 -0
  146. package/dist/esm/{chunk-KJDY66XF.mjs.map → chunk-VOYW2TZW.mjs.map} +1 -1
  147. package/dist/esm/chunk-VWVEDCBM.mjs +2 -0
  148. package/dist/esm/{chunk-BREUBEPM.mjs.map → chunk-VWVEDCBM.mjs.map} +1 -1
  149. package/dist/esm/{chunk-ZT2A5ABR.mjs → chunk-VYAVLUPJ.mjs} +2 -2
  150. package/dist/esm/{chunk-ZT2A5ABR.mjs.map → chunk-VYAVLUPJ.mjs.map} +1 -1
  151. package/dist/esm/{chunk-XFS5O5GJ.mjs → chunk-WKY5ENCK.mjs} +2 -2
  152. package/dist/esm/{chunk-XFS5O5GJ.mjs.map → chunk-WKY5ENCK.mjs.map} +1 -1
  153. package/dist/esm/{chunk-BTK34A5U.mjs → chunk-WX43AJTD.mjs} +10 -10
  154. package/dist/esm/chunk-WX43AJTD.mjs.map +1 -0
  155. package/dist/esm/chunk-X32O46IB.mjs +2 -0
  156. package/dist/esm/{chunk-PDLUCVJB.mjs.map → chunk-X32O46IB.mjs.map} +1 -1
  157. package/dist/esm/chunk-Y5DJPHJT.mjs +2 -0
  158. package/dist/esm/chunk-Y5DJPHJT.mjs.map +1 -0
  159. package/dist/esm/{chunk-GUT3G5CG.mjs → chunk-Y7VR7X5W.mjs} +2 -2
  160. package/dist/esm/chunk-Y7VR7X5W.mjs.map +1 -0
  161. package/dist/esm/chunk-YYRDFZE6.mjs +2 -0
  162. package/dist/esm/{chunk-UVGCVCNG.mjs.map → chunk-YYRDFZE6.mjs.map} +1 -1
  163. package/dist/esm/chunk-Z2UDRTHA.mjs +2 -0
  164. package/dist/esm/{chunk-JTGGMXB7.mjs.map → chunk-Z2UDRTHA.mjs.map} +1 -1
  165. package/dist/esm/{chunk-XNFEUXDS.mjs → chunk-ZWH2ESXT.mjs} +1 -1
  166. package/dist/esm/chunk-ZWH2ESXT.mjs.map +1 -0
  167. package/dist/esm/client/{core.d.ts → core.d.mts} +9 -9
  168. package/dist/esm/client/core.mjs +1 -1
  169. package/dist/esm/client/{get.d.ts → get.d.mts} +12 -12
  170. package/dist/esm/client/get.mjs +1 -1
  171. package/dist/esm/client/index.d.mts +11 -0
  172. package/dist/esm/client/index.mjs +1 -1
  173. package/dist/esm/client/{post.d.ts → post.d.mts} +14 -14
  174. package/dist/esm/client/post.mjs +1 -1
  175. package/dist/esm/client/{types.d.ts → types.d.mts} +5 -5
  176. package/dist/esm/client/types.mjs +1 -1
  177. package/dist/esm/core/{account.d.ts → account.d.mts} +13 -13
  178. package/dist/esm/core/account.mjs +1 -1
  179. package/dist/esm/core/{accountAddress.d.ts → accountAddress.d.mts} +11 -11
  180. package/dist/esm/core/accountAddress.mjs +1 -1
  181. package/dist/esm/core/{authenticationKey.d.ts → authenticationKey.d.mts} +12 -12
  182. package/dist/esm/core/authenticationKey.mjs +1 -1
  183. package/dist/esm/core/{common.d.ts → common.d.mts} +1 -1
  184. package/dist/esm/core/common.mjs +1 -1
  185. package/dist/esm/core/crypto/{anyPublicKey.d.ts → anyPublicKey.d.mts} +11 -11
  186. package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
  187. package/dist/esm/core/crypto/{anySignature.d.ts → anySignature.d.mts} +10 -10
  188. package/dist/esm/core/crypto/anySignature.mjs +1 -1
  189. package/dist/esm/core/crypto/{asymmetricCrypto.d.ts → asymmetricCrypto.d.mts} +8 -8
  190. package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
  191. package/dist/esm/core/crypto/{ed25519.d.ts → ed25519.d.mts} +10 -10
  192. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  193. package/dist/esm/core/crypto/{hdKey.d.ts → hdKey.d.mts} +1 -1
  194. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  195. package/dist/esm/core/crypto/index.d.mts +17 -0
  196. package/dist/esm/core/crypto/index.mjs +1 -1
  197. package/dist/esm/core/crypto/{multiEd25519.d.ts → multiEd25519.d.mts} +11 -11
  198. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  199. package/dist/esm/core/crypto/{multiKey.d.ts → multiKey.d.mts} +12 -12
  200. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  201. package/dist/esm/core/crypto/{secp256k1.d.ts → secp256k1.d.mts} +10 -10
  202. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  203. package/dist/esm/core/{hex.d.ts → hex.d.mts} +6 -6
  204. package/dist/esm/core/hex.mjs +1 -1
  205. package/dist/esm/core/index.d.mts +21 -0
  206. package/dist/esm/core/index.mjs +1 -1
  207. package/dist/esm/{index.d.ts → index.d.mts} +60 -60
  208. package/dist/esm/index.mjs +1 -1
  209. package/dist/esm/internal/{account.d.ts → account.d.mts} +17 -17
  210. package/dist/esm/internal/account.mjs +1 -1
  211. package/dist/esm/internal/{ans.d.ts → ans.d.mts} +32 -32
  212. package/dist/esm/internal/ans.mjs +1 -1
  213. package/dist/esm/internal/coin.d.mts +43 -0
  214. package/dist/esm/internal/coin.mjs +1 -1
  215. package/dist/esm/internal/{digitalAsset.d.ts → digitalAsset.d.mts} +32 -32
  216. package/dist/esm/internal/digitalAsset.mjs +1 -1
  217. package/dist/esm/internal/{event.d.ts → event.d.mts} +14 -14
  218. package/dist/esm/internal/event.mjs +1 -1
  219. package/dist/esm/internal/faucet.d.mts +29 -0
  220. package/dist/esm/internal/faucet.mjs +1 -1
  221. package/dist/esm/internal/{fungibleAsset.d.ts → fungibleAsset.d.mts} +7 -7
  222. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  223. package/dist/esm/internal/{general.d.ts → general.d.mts} +11 -11
  224. package/dist/esm/internal/general.mjs +1 -1
  225. package/dist/esm/internal/{staking.d.ts → staking.d.mts} +13 -13
  226. package/dist/esm/internal/staking.mjs +1 -1
  227. package/dist/esm/internal/{transaction.d.ts → transaction.d.mts} +7 -7
  228. package/dist/esm/internal/transaction.mjs +1 -1
  229. package/dist/esm/internal/{transactionSubmission.d.ts → transactionSubmission.d.mts} +32 -32
  230. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  231. package/dist/esm/transactions/authenticator/{account.d.ts → account.d.mts} +15 -15
  232. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  233. package/dist/esm/transactions/authenticator/index.d.mts +19 -0
  234. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  235. package/dist/esm/transactions/authenticator/{transaction.d.ts → transaction.d.mts} +18 -18
  236. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  237. package/dist/esm/transactions/{index.d.ts → index.d.mts} +39 -39
  238. package/dist/esm/transactions/index.mjs +1 -1
  239. package/dist/esm/transactions/instances/chainId.d.mts +21 -0
  240. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  241. package/dist/esm/transactions/instances/{identifier.d.ts → identifier.d.mts} +9 -9
  242. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  243. package/dist/esm/transactions/instances/index.d.mts +29 -0
  244. package/dist/esm/transactions/instances/index.mjs +1 -1
  245. package/dist/esm/transactions/instances/{moduleId.d.ts → moduleId.d.mts} +12 -12
  246. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  247. package/dist/esm/transactions/instances/{rawTransaction.d.ts → rawTransaction.d.mts} +16 -16
  248. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  249. package/dist/esm/transactions/instances/{rotationProofChallenge.d.ts → rotationProofChallenge.d.mts} +14 -14
  250. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  251. package/dist/esm/transactions/instances/{signedTransaction.d.ts → signedTransaction.d.mts} +25 -25
  252. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  253. package/dist/esm/transactions/instances/{transactionArgument.d.ts → transactionArgument.d.mts} +8 -8
  254. package/dist/esm/transactions/instances/{transactionPayload.d.ts → transactionPayload.d.mts} +14 -14
  255. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  256. package/dist/esm/transactions/transactionBuilder/{helpers.d.ts → helpers.d.mts} +31 -31
  257. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  258. package/dist/esm/transactions/transactionBuilder/index.d.mts +35 -0
  259. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  260. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +54 -0
  261. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  262. package/dist/esm/transactions/transactionBuilder/{transactionBuilder.d.ts → transactionBuilder.d.mts} +33 -35
  263. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  264. package/dist/esm/transactions/typeTag/{index.d.ts → index.d.mts} +12 -12
  265. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  266. package/dist/esm/transactions/typeTag/{parser.d.ts → parser.d.mts} +14 -13
  267. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  268. package/dist/esm/transactions/{types.d.ts → types.d.mts} +49 -60
  269. package/dist/esm/types/generated/{operations.d.ts → operations.d.mts} +78 -78
  270. package/dist/esm/types/generated/{queries.d.ts → queries.d.mts} +31 -31
  271. package/dist/esm/types/generated/queries.mjs +1 -1
  272. package/dist/esm/types/generated/{types.d.ts → types.d.mts} +3184 -3146
  273. package/dist/esm/types/generated/types.mjs +1 -1
  274. package/dist/esm/types/generated/types.mjs.map +1 -1
  275. package/dist/esm/types/{index.d.ts → index.d.mts} +94 -92
  276. package/dist/esm/types/index.mjs +1 -1
  277. package/dist/esm/types/indexer.d.mts +62 -0
  278. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  279. package/dist/esm/utils/const.mjs +1 -1
  280. package/dist/esm/utils/helpers.mjs +1 -1
  281. package/dist/esm/utils/index.d.mts +2 -0
  282. package/dist/esm/utils/index.mjs +2 -0
  283. package/dist/esm/utils/index.mjs.map +1 -0
  284. package/dist/esm/utils/memoize.mjs +1 -1
  285. package/dist/esm/version.mjs +1 -1
  286. package/package.json +30 -30
  287. package/src/api/account.ts +2 -2
  288. package/src/api/coin.ts +2 -2
  289. package/src/api/event.ts +2 -2
  290. package/src/api/general.ts +4 -4
  291. package/src/api/transactionSubmission.ts +7 -2
  292. package/src/client/core.ts +1 -1
  293. package/src/client/get.ts +6 -2
  294. package/src/client/post.ts +12 -4
  295. package/src/index.ts +1 -1
  296. package/src/internal/account.ts +2 -2
  297. package/src/internal/ans.ts +2 -2
  298. package/src/internal/coin.ts +2 -2
  299. package/src/internal/event.ts +2 -2
  300. package/src/internal/general.ts +7 -6
  301. package/src/internal/transactionSubmission.ts +41 -9
  302. package/src/transactions/transactionBuilder/helpers.ts +2 -2
  303. package/src/transactions/transactionBuilder/transactionBuilder.ts +15 -16
  304. package/src/transactions/typeTag/parser.ts +10 -2
  305. package/src/transactions/types.ts +3 -12
  306. package/src/types/generated/operations.ts +33 -33
  307. package/src/types/generated/queries.ts +22 -22
  308. package/src/types/generated/types.ts +2253 -2251
  309. package/src/types/index.ts +16 -10
  310. package/src/utils/index.ts +2 -0
  311. package/dist/esm/api/aptos.d.ts +0 -72
  312. package/dist/esm/api/coin.d.ts +0 -59
  313. package/dist/esm/api/index.d.ts +0 -46
  314. package/dist/esm/bcs/index.d.ts +0 -14
  315. package/dist/esm/chunk-2444YR3Y.mjs +0 -2
  316. package/dist/esm/chunk-2444YR3Y.mjs.map +0 -1
  317. package/dist/esm/chunk-2B5QXKPU.mjs.map +0 -1
  318. package/dist/esm/chunk-2MQZUGO6.mjs.map +0 -1
  319. package/dist/esm/chunk-3YOV42H5.mjs +0 -2
  320. package/dist/esm/chunk-3YOV42H5.mjs.map +0 -1
  321. package/dist/esm/chunk-7AIV5FEN.mjs +0 -2
  322. package/dist/esm/chunk-7AIV5FEN.mjs.map +0 -1
  323. package/dist/esm/chunk-7AQXAH6Q.mjs +0 -2
  324. package/dist/esm/chunk-7TL2MY2B.mjs +0 -2
  325. package/dist/esm/chunk-7TL2MY2B.mjs.map +0 -1
  326. package/dist/esm/chunk-ADR4XQPR.mjs +0 -2
  327. package/dist/esm/chunk-AY2HWVDO.mjs +0 -2
  328. package/dist/esm/chunk-AY2HWVDO.mjs.map +0 -1
  329. package/dist/esm/chunk-BIUGRAMO.mjs +0 -2
  330. package/dist/esm/chunk-BREUBEPM.mjs +0 -2
  331. package/dist/esm/chunk-BTK34A5U.mjs.map +0 -1
  332. package/dist/esm/chunk-CZZJAR3B.mjs +0 -2
  333. package/dist/esm/chunk-DXUIJ6KA.mjs +0 -2
  334. package/dist/esm/chunk-E72CFUU4.mjs +0 -2
  335. package/dist/esm/chunk-FHJ7F7Z6.mjs +0 -2
  336. package/dist/esm/chunk-FNB6CFQR.mjs +0 -2
  337. package/dist/esm/chunk-GUT3G5CG.mjs.map +0 -1
  338. package/dist/esm/chunk-HH5RSP2H.mjs +0 -2
  339. package/dist/esm/chunk-IPJKGHQY.mjs +0 -2
  340. package/dist/esm/chunk-IZHPCZE3.mjs +0 -2
  341. package/dist/esm/chunk-J3QOSJFP.mjs +0 -2
  342. package/dist/esm/chunk-J5OKXARS.mjs +0 -2
  343. package/dist/esm/chunk-J5OKXARS.mjs.map +0 -1
  344. package/dist/esm/chunk-JTGGMXB7.mjs +0 -2
  345. package/dist/esm/chunk-KJDY66XF.mjs +0 -2
  346. package/dist/esm/chunk-KNLMUSIO.mjs +0 -2
  347. package/dist/esm/chunk-KWJ6XKNF.mjs +0 -2
  348. package/dist/esm/chunk-KYWYIK5P.mjs.map +0 -1
  349. package/dist/esm/chunk-LAXIJRYU.mjs +0 -2
  350. package/dist/esm/chunk-LU6VS7PJ.mjs +0 -2
  351. package/dist/esm/chunk-MIBLZSNS.mjs.map +0 -1
  352. package/dist/esm/chunk-NKTKHC3Z.mjs +0 -2
  353. package/dist/esm/chunk-NKTKHC3Z.mjs.map +0 -1
  354. package/dist/esm/chunk-O243HOP3.mjs.map +0 -1
  355. package/dist/esm/chunk-PDLUCVJB.mjs +0 -2
  356. package/dist/esm/chunk-SJLO3JIH.mjs +0 -2
  357. package/dist/esm/chunk-TYHBYRUA.mjs.map +0 -1
  358. package/dist/esm/chunk-UQIOMAXE.mjs +0 -2
  359. package/dist/esm/chunk-UVGCVCNG.mjs +0 -2
  360. package/dist/esm/chunk-V6AAQLLJ.mjs +0 -2
  361. package/dist/esm/chunk-WGXAIQ7K.mjs +0 -2
  362. package/dist/esm/chunk-WNEZCERQ.mjs +0 -2
  363. package/dist/esm/chunk-WNEZCERQ.mjs.map +0 -1
  364. package/dist/esm/chunk-XFSL7O6Q.mjs.map +0 -1
  365. package/dist/esm/chunk-YS2OX7AB.mjs +0 -2
  366. package/dist/esm/chunk-ZXJ5ZBTL.mjs +0 -2
  367. package/dist/esm/client/index.d.ts +0 -11
  368. package/dist/esm/core/crypto/index.d.ts +0 -17
  369. package/dist/esm/core/index.d.ts +0 -21
  370. package/dist/esm/internal/coin.d.ts +0 -43
  371. package/dist/esm/internal/faucet.d.ts +0 -29
  372. package/dist/esm/transactions/authenticator/index.d.ts +0 -19
  373. package/dist/esm/transactions/instances/chainId.d.ts +0 -21
  374. package/dist/esm/transactions/instances/index.d.ts +0 -29
  375. package/dist/esm/transactions/transactionBuilder/index.d.ts +0 -35
  376. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.ts +0 -54
  377. package/dist/esm/types/indexer.d.ts +0 -62
  378. /package/dist/esm/{chunk-KPESAXVI.mjs.map → chunk-AAIBCWZY.mjs.map} +0 -0
  379. /package/dist/esm/{chunk-IXMH6AXJ.mjs.map → chunk-BFSEVKNA.mjs.map} +0 -0
  380. /package/dist/esm/{chunk-VAGYTPSI.mjs.map → chunk-BWMNPUTK.mjs.map} +0 -0
  381. /package/dist/esm/{chunk-XNFEUXDS.mjs.map → chunk-CYDWEPFL.mjs.map} +0 -0
  382. /package/dist/esm/{chunk-E72CFUU4.mjs.map → chunk-EFIYW4WK.mjs.map} +0 -0
  383. /package/dist/esm/{chunk-Z56AKXJ7.mjs.map → chunk-IG5CHHSI.mjs.map} +0 -0
  384. /package/dist/esm/{chunk-KFP7MDSD.mjs.map → chunk-NYFVEKF6.mjs.map} +0 -0
  385. /package/dist/esm/{chunk-EKAOAGNQ.mjs.map → chunk-UAAI3NCA.mjs.map} +0 -0
  386. /package/dist/esm/{chunk-SJLO3JIH.mjs.map → chunk-UNQNACJT.mjs.map} +0 -0
  387. /package/dist/esm/utils/{apiEndpoints.d.ts → apiEndpoints.d.mts} +0 -0
  388. /package/dist/esm/utils/{const.d.ts → const.d.mts} +0 -0
  389. /package/dist/esm/utils/{helpers.d.ts → helpers.d.mts} +0 -0
  390. /package/dist/esm/utils/{memoize.d.ts → memoize.d.mts} +0 -0
  391. /package/dist/esm/{version.d.ts → version.d.mts} +0 -0
package/package.json CHANGED
@@ -45,39 +45,39 @@
45
45
  "dependencies": {
46
46
  "@aptos-labs/aptos-client": "^0.0.2",
47
47
  "@noble/curves": "^1.2.0",
48
- "@noble/hashes": "1.1.3",
48
+ "@noble/hashes": "^1.3.2",
49
49
  "@scure/bip32": "^1.3.2",
50
- "@scure/bip39": "1.1.0",
51
- "form-data": "4.0.0",
52
- "tweetnacl": "1.0.3"
50
+ "@scure/bip39": "^1.2.1",
51
+ "form-data": "^4.0.0",
52
+ "tweetnacl": "^1.0.3"
53
53
  },
54
54
  "devDependencies": {
55
- "@graphql-codegen/cli": "^2.13.5",
56
- "@graphql-codegen/import-types-preset": "^2.2.3",
57
- "@graphql-codegen/typescript": "^2.7.3",
58
- "@graphql-codegen/typescript-graphql-request": "^4.5.8",
59
- "@graphql-codegen/typescript-operations": "^2.5.3",
60
- "@types/jest": "28.1.8",
61
- "@types/node": "18.6.2",
62
- "@typescript-eslint/eslint-plugin": "5.36.2",
63
- "@typescript-eslint/parser": "5.36.2",
55
+ "@graphql-codegen/cli": "^5.0.0",
56
+ "@graphql-codegen/import-types-preset": "^3.0.0",
57
+ "@graphql-codegen/typescript": "^4.0.1",
58
+ "@graphql-codegen/typescript-graphql-request": "^6.0.1",
59
+ "@graphql-codegen/typescript-operations": "^4.0.1",
60
+ "@types/jest": "^29.5.7",
61
+ "@types/node": "^20.8.10",
62
+ "@typescript-eslint/eslint-plugin": "^6.9.1",
63
+ "@typescript-eslint/parser": "^6.9.1",
64
64
  "cross-var": "^1.1.0",
65
- "dotenv": "16.0.2",
66
- "eslint": "8.23.0",
67
- "eslint-config-airbnb-base": "15.0.0",
68
- "eslint-config-airbnb-typescript": "17.0.0",
69
- "eslint-config-prettier": "8.5.0",
70
- "eslint-plugin-import": "2.26.0",
71
- "graphql": "^16.5.0",
72
- "graphql-request": "5.1.0",
73
- "jest": "28.1.3",
74
- "prettier": "2.6.2",
75
- "ts-jest": "28.0.8",
76
- "ts-loader": "9.3.1",
77
- "ts-node": "10.9.1",
78
- "tsup": "7.2.0",
79
- "typedoc": "^0.23.20",
80
- "typescript": "4.8.2"
65
+ "dotenv": "^16.3.1",
66
+ "eslint": "^8.52.0",
67
+ "eslint-config-airbnb-base": "^15.0.0",
68
+ "eslint-config-airbnb-typescript": "^17.1.0",
69
+ "eslint-config-prettier": "^9.0.0",
70
+ "eslint-plugin-import": "^2.29.0",
71
+ "graphql": "^16.8.1",
72
+ "graphql-request": "^6.1.0",
73
+ "jest": "^29.7.0",
74
+ "prettier": "^3.0.3",
75
+ "ts-jest": "^29.1.1",
76
+ "ts-loader": "^9.5.0",
77
+ "ts-node": "^10.9.1",
78
+ "tsup": "^7.2.0",
79
+ "typedoc": "^0.25.3",
80
+ "typescript": "^5.2.2"
81
81
  },
82
- "version": "0.0.5"
82
+ "version": "0.0.6"
83
83
  }
@@ -13,7 +13,7 @@ import {
13
13
  LedgerVersion,
14
14
  MoveModuleBytecode,
15
15
  MoveResource,
16
- MoveStructType,
16
+ MoveStructId,
17
17
  OrderBy,
18
18
  PaginationArgs,
19
19
  TokenStandard,
@@ -174,7 +174,7 @@ export class Account {
174
174
  */
175
175
  async getAccountResource<T extends {} = any>(args: {
176
176
  accountAddress: AccountAddressInput;
177
- resourceType: MoveStructType;
177
+ resourceType: MoveStructId;
178
178
  options?: LedgerVersion;
179
179
  }): Promise<T> {
180
180
  return getResource<T>({ aptosConfig: this.config, ...args });
package/src/api/coin.ts CHANGED
@@ -5,7 +5,7 @@ import { AptosConfig } from "./aptosConfig";
5
5
  import { Account, AccountAddressInput } from "../core";
6
6
  import { transferCoinTransaction } from "../internal/coin";
7
7
  import { InputSingleSignerTransaction, InputGenerateTransactionOptions } from "../transactions/types";
8
- import { AnyNumber, MoveStructType } from "../types";
8
+ import { AnyNumber, MoveStructId } from "../types";
9
9
 
10
10
  /**
11
11
  * A class to handle all `Coin` operations
@@ -31,7 +31,7 @@ export class Coin {
31
31
  sender: Account;
32
32
  recipient: AccountAddressInput;
33
33
  amount: AnyNumber;
34
- coinType?: MoveStructType;
34
+ coinType?: MoveStructId;
35
35
  options?: InputGenerateTransactionOptions;
36
36
  }): Promise<InputSingleSignerTransaction> {
37
37
  return transferCoinTransaction({ aptosConfig: this.config, ...args });
package/src/api/event.ts CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { AptosConfig } from "./aptosConfig";
5
5
  import { getAccountEventsByCreationNumber, getAccountEventsByEventType, getEvents } from "../internal/event";
6
- import { AnyNumber, GetEventsResponse, MoveStructType, OrderBy, PaginationArgs } from "../types";
6
+ import { AnyNumber, GetEventsResponse, MoveStructId, OrderBy, PaginationArgs } from "../types";
7
7
  import { EventsBoolExp } from "../types/generated/types";
8
8
  import { AccountAddressInput } from "../core";
9
9
 
@@ -42,7 +42,7 @@ export class Event {
42
42
  */
43
43
  async getAccountEventsByEventType(args: {
44
44
  accountAddress: AccountAddressInput;
45
- eventType: MoveStructType;
45
+ eventType: MoveStructId;
46
46
  options?: {
47
47
  pagination?: PaginationArgs;
48
48
  orderBy?: OrderBy<GetEventsResponse[0]>;
@@ -21,7 +21,7 @@ import {
21
21
  LedgerVersion,
22
22
  MoveValue,
23
23
  TableItemRequest,
24
- ViewRequestData,
24
+ InputViewRequestData,
25
25
  } from "../types";
26
26
 
27
27
  /**
@@ -133,8 +133,8 @@ export class General {
133
133
  *
134
134
  * @returns an array of Move values
135
135
  */
136
- async view(args: { payload: ViewRequestData; options?: LedgerVersion }): Promise<Array<MoveValue>> {
137
- return view({ aptosConfig: this.config, ...args });
136
+ async view<T extends Array<MoveValue>>(args: { payload: InputViewRequestData; options?: LedgerVersion }): Promise<T> {
137
+ return view<T>({ aptosConfig: this.config, ...args });
138
138
  }
139
139
 
140
140
  /**
@@ -170,7 +170,7 @@ export class General {
170
170
  *
171
171
  * @return The provided T type
172
172
  */
173
- async queryIndexer<T>(args: { query: GraphqlQuery }): Promise<T> {
173
+ async queryIndexer<T extends {}>(args: { query: GraphqlQuery }): Promise<T> {
174
174
  return queryIndexer<T>({
175
175
  aptosConfig: this.config,
176
176
  ...args,
@@ -99,7 +99,7 @@ export class TransactionSubmission {
99
99
  * ```
100
100
  * {
101
101
  * rawTransaction: RawTransaction,
102
- * secondarySignerAddresses? : Array<AccountAddress>,
102
+ * secondarySignerAddresses?: Array<AccountAddress>,
103
103
  * feePayerAddress?: AccountAddress
104
104
  * }
105
105
  * ```
@@ -113,9 +113,14 @@ export class TransactionSubmission {
113
113
  asFeePayer?: boolean;
114
114
  }): AccountAuthenticator {
115
115
  const { signer, transaction, asFeePayer } = args;
116
- if (asFeePayer) {
116
+
117
+ // Account can only sign as fee payer if it's a fee payer transaction
118
+ if ("feePayerAddress" in transaction && asFeePayer) {
117
119
  transaction.feePayerAddress = signer.accountAddress;
120
+ } else if (asFeePayer) {
121
+ throw new Error("Transaction being signed is not a Fee payer transaction, but `asFeePayer` is set to true");
118
122
  }
123
+
119
124
  return signTransaction({
120
125
  signer,
121
126
  transaction,
@@ -60,7 +60,7 @@ export async function request<Req, Res>(options: ClientRequest<Req>, client: Cli
60
60
  * @param aptosConfig The config information for the SDK client instance
61
61
  * @returns the response or AptosApiError
62
62
  */
63
- export async function aptosRequest<Req, Res>(
63
+ export async function aptosRequest<Req extends {}, Res extends {}>(
64
64
  options: AptosRequest,
65
65
  aptosConfig: AptosConfig,
66
66
  ): Promise<AptosResponse<Req, Res>> {
package/src/client/get.ts CHANGED
@@ -47,7 +47,9 @@ export type GetAptosRequestOptions = Omit<GetRequestOptions, "type">;
47
47
  * @param options GetRequestOptions
48
48
  * @returns
49
49
  */
50
- export async function get<Req, Res>(options: GetRequestOptions): Promise<AptosResponse<Req, Res>> {
50
+ export async function get<Req extends {}, Res extends {}>(
51
+ options: GetRequestOptions,
52
+ ): Promise<AptosResponse<Req, Res>> {
51
53
  const { aptosConfig, overrides, params, contentType, acceptType, path, originMethod, type } = options;
52
54
  const url = aptosConfig.getRequestUrl(type);
53
55
 
@@ -69,7 +71,9 @@ export async function get<Req, Res>(options: GetRequestOptions): Promise<AptosRe
69
71
  );
70
72
  }
71
73
 
72
- export async function getAptosFullNode<Req, Res>(options: GetAptosRequestOptions): Promise<AptosResponse<Req, Res>> {
74
+ export async function getAptosFullNode<Req extends {}, Res extends {}>(
75
+ options: GetAptosRequestOptions,
76
+ ): Promise<AptosResponse<Req, Res>> {
73
77
  return get<Req, Res>({ ...options, type: AptosApiType.FULLNODE });
74
78
  }
75
79
 
@@ -54,7 +54,9 @@ export type PostAptosRequestOptions = Omit<PostRequestOptions, "type">;
54
54
  * @param options PostRequestOptions
55
55
  * @returns
56
56
  */
57
- export async function post<Req, Res>(options: PostRequestOptions): Promise<AptosResponse<Req, Res>> {
57
+ export async function post<Req extends {}, Res extends {}>(
58
+ options: PostRequestOptions,
59
+ ): Promise<AptosResponse<Req, Res>> {
58
60
  const { type, originMethod, path, body, acceptType, contentType, params, aptosConfig, overrides } = options;
59
61
  const url = aptosConfig.getRequestUrl(type);
60
62
 
@@ -77,14 +79,20 @@ export async function post<Req, Res>(options: PostRequestOptions): Promise<Aptos
77
79
  );
78
80
  }
79
81
 
80
- export async function postAptosFullNode<Req, Res>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>> {
82
+ export async function postAptosFullNode<Req extends {}, Res extends {}>(
83
+ options: PostAptosRequestOptions,
84
+ ): Promise<AptosResponse<Req, Res>> {
81
85
  return post<Req, Res>({ ...options, type: AptosApiType.FULLNODE });
82
86
  }
83
87
 
84
- export async function postAptosIndexer<Req, Res>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>> {
88
+ export async function postAptosIndexer<Req extends {}, Res extends {}>(
89
+ options: PostAptosRequestOptions,
90
+ ): Promise<AptosResponse<Req, Res>> {
85
91
  return post<Req, Res>({ ...options, type: AptosApiType.INDEXER });
86
92
  }
87
93
 
88
- export async function postAptosFaucet<Req, Res>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>> {
94
+ export async function postAptosFaucet<Req extends {}, Res extends {}>(
95
+ options: PostAptosRequestOptions,
96
+ ): Promise<AptosResponse<Req, Res>> {
89
97
  return post<Req, Res>({ ...options, type: AptosApiType.FAUCET });
90
98
  }
package/src/index.ts CHANGED
@@ -7,4 +7,4 @@ export * from "./client";
7
7
  export * from "./core";
8
8
  export * from "./transactions";
9
9
  export * from "./types";
10
- export * from "./utils/apiEndpoints";
10
+ export * from "./utils";
@@ -24,7 +24,7 @@ import {
24
24
  LedgerVersion,
25
25
  MoveModuleBytecode,
26
26
  MoveResource,
27
- MoveStructType,
27
+ MoveStructId,
28
28
  OrderBy,
29
29
  PaginationArgs,
30
30
  SigningScheme,
@@ -165,7 +165,7 @@ export async function getResources(args: {
165
165
  export async function getResource<T extends {}>(args: {
166
166
  aptosConfig: AptosConfig;
167
167
  accountAddress: AccountAddressInput;
168
- resourceType: MoveStructType;
168
+ resourceType: MoveStructId;
169
169
  options?: LedgerVersion;
170
170
  }): Promise<T> {
171
171
  const { aptosConfig, accountAddress, resourceType, options } = args;
@@ -82,8 +82,8 @@ function getRouterAddress(aptosConfig: AptosConfig): string {
82
82
  return address;
83
83
  }
84
84
 
85
- const Some = <T>(value: T): MoveValue => ({ vec: [value] } as any);
86
- const None = (): MoveValue => ({ vec: [] } as any);
85
+ const Some = <T>(value: T): MoveValue => ({ vec: [value] }) as any;
86
+ const None = (): MoveValue => ({ vec: [] }) as any;
87
87
  // != here is intentional, we want to check for null and undefined
88
88
  // eslint-disable-next-line eqeqeq
89
89
  const Option = <T>(value: T | undefined | null): MoveValue => (value != undefined ? Some(value) : None());
@@ -2,7 +2,7 @@ import { AptosConfig } from "../api/aptosConfig";
2
2
  import { U64 } from "../bcs/serializable/movePrimitives";
3
3
  import { Account, AccountAddress, AccountAddressInput } from "../core";
4
4
  import { InputGenerateTransactionOptions, InputSingleSignerTransaction } from "../transactions/types";
5
- import { AnyNumber, MoveStructType } from "../types";
5
+ import { AnyNumber, MoveStructId } from "../types";
6
6
  import { APTOS_COIN } from "../utils/const";
7
7
  import { generateTransaction } from "./transactionSubmission";
8
8
  import { parseTypeTag } from "../transactions/typeTag/parser";
@@ -12,7 +12,7 @@ export async function transferCoinTransaction(args: {
12
12
  sender: Account;
13
13
  recipient: AccountAddressInput;
14
14
  amount: AnyNumber;
15
- coinType?: MoveStructType;
15
+ coinType?: MoveStructId;
16
16
  options?: InputGenerateTransactionOptions;
17
17
  }): Promise<InputSingleSignerTransaction> {
18
18
  const { aptosConfig, sender, recipient, amount, coinType, options } = args;
@@ -10,7 +10,7 @@
10
10
 
11
11
  import { AptosConfig } from "../api/aptosConfig";
12
12
  import { AccountAddress, AccountAddressInput } from "../core";
13
- import { AnyNumber, GetEventsResponse, PaginationArgs, MoveStructType, OrderBy } from "../types";
13
+ import { AnyNumber, GetEventsResponse, PaginationArgs, MoveStructId, OrderBy } from "../types";
14
14
  import { GetEventsQuery } from "../types/generated/operations";
15
15
  import { GetEvents } from "../types/generated/queries";
16
16
  import { EventsBoolExp } from "../types/generated/types";
@@ -35,7 +35,7 @@ export async function getAccountEventsByCreationNumber(args: {
35
35
  export async function getAccountEventsByEventType(args: {
36
36
  aptosConfig: AptosConfig;
37
37
  accountAddress: AccountAddressInput;
38
- eventType: MoveStructType;
38
+ eventType: MoveStructId;
39
39
  options?: {
40
40
  pagination?: PaginationArgs;
41
41
  orderBy?: OrderBy<GetEventsResponse[0]>;
@@ -21,7 +21,7 @@ import {
21
21
  MoveValue,
22
22
  TableItemRequest,
23
23
  ViewRequest,
24
- ViewRequestData,
24
+ InputViewRequestData,
25
25
  } from "../types";
26
26
  import { GetChainTopUserTransactionsQuery, GetProcessorStatusQuery } from "../types/generated/operations";
27
27
  import { GetChainTopUserTransactions, GetProcessorStatus } from "../types/generated/queries";
@@ -83,11 +83,11 @@ export async function getTableItem<T>(args: {
83
83
  return response.data as T;
84
84
  }
85
85
 
86
- export async function view(args: {
86
+ export async function view<T extends Array<MoveValue> = Array<MoveValue>>(args: {
87
87
  aptosConfig: AptosConfig;
88
- payload: ViewRequestData;
88
+ payload: InputViewRequestData;
89
89
  options?: LedgerVersion;
90
- }): Promise<MoveValue[]> {
90
+ }): Promise<T> {
91
91
  const { aptosConfig, payload, options } = args;
92
92
  const { data } = await postAptosFullNode<ViewRequest, MoveValue[]>({
93
93
  aptosConfig,
@@ -100,7 +100,8 @@ export async function view(args: {
100
100
  arguments: payload.functionArguments ?? [],
101
101
  },
102
102
  });
103
- return data;
103
+
104
+ return data as T;
104
105
  }
105
106
 
106
107
  export async function getChainTopUserTransactions(args: {
@@ -122,7 +123,7 @@ export async function getChainTopUserTransactions(args: {
122
123
  return data.user_transactions;
123
124
  }
124
125
 
125
- export async function queryIndexer<T>(args: {
126
+ export async function queryIndexer<T extends {}>(args: {
126
127
  aptosConfig: AptosConfig;
127
128
  query: GraphqlQuery;
128
129
  originMethod?: string;
@@ -28,6 +28,8 @@ import {
28
28
  InputSingleSignerTransaction,
29
29
  InputGenerateTransactionPayloadDataWithRemoteABI,
30
30
  InputSubmitTransactionData,
31
+ InputGenerateFeePayerRawTransactionData,
32
+ InputGenerateMultiAgentRawTransactionData,
31
33
  } from "../transactions/types";
32
34
  import { getInfo } from "./account";
33
35
  import { UserTransactionResponse, PendingTransactionResponse, MimeType, HexInput, TransactionResponse } from "../types";
@@ -75,13 +77,7 @@ import { UserTransactionResponse, PendingTransactionResponse, MimeType, HexInput
75
77
  export async function generateTransaction(
76
78
  args: { aptosConfig: AptosConfig } & InputGenerateTransactionData,
77
79
  ): Promise<AnyRawTransaction> {
78
- const { aptosConfig, sender, data, options, secondarySignerAddresses, hasFeePayer } = args;
79
-
80
- // Upate feePayerAddress if it has sponsor
81
- let feePayerAddress;
82
- if (hasFeePayer === true) {
83
- feePayerAddress = AccountAddress.ZERO.toString();
84
- }
80
+ const { aptosConfig, sender, data, options } = args;
85
81
 
86
82
  // Merge in aptosConfig for remote ABI on non-script payloads
87
83
  let generateTransactionPayloadData: InputGenerateTransactionPayloadDataWithRemoteABI;
@@ -103,17 +99,53 @@ export async function generateTransaction(
103
99
  typeArguments: data.typeArguments,
104
100
  };
105
101
  }
102
+
103
+ if (isFeePayerTransactionInput(args)) {
104
+ const { secondarySignerAddresses } = args;
105
+ const feePayerAddress = args.hasFeePayer ? AccountAddress.ZERO : undefined;
106
+ const payload = await generateTransactionPayload(generateTransactionPayloadData);
107
+ return buildTransaction({
108
+ aptosConfig,
109
+ sender,
110
+ payload,
111
+ options,
112
+ secondarySignerAddresses,
113
+ feePayerAddress,
114
+ });
115
+ }
116
+ if (isMultiAgentTransactionInput(args)) {
117
+ const { secondarySignerAddresses } = args;
118
+ const payload = await generateTransactionPayload(generateTransactionPayloadData);
119
+ return buildTransaction({
120
+ aptosConfig,
121
+ sender,
122
+ payload,
123
+ options,
124
+ secondarySignerAddresses,
125
+ });
126
+ }
127
+
106
128
  const payload = await generateTransactionPayload(generateTransactionPayloadData);
107
129
  return buildTransaction({
108
130
  aptosConfig,
109
131
  sender,
110
132
  payload,
111
133
  options,
112
- secondarySignerAddresses,
113
- feePayerAddress,
114
134
  });
115
135
  }
116
136
 
137
+ function isFeePayerTransactionInput(
138
+ data: InputGenerateTransactionData,
139
+ ): data is InputGenerateFeePayerRawTransactionData {
140
+ return "hasFeePayer" in data;
141
+ }
142
+
143
+ function isMultiAgentTransactionInput(
144
+ data: InputGenerateTransactionData,
145
+ ): data is InputGenerateMultiAgentRawTransactionData {
146
+ return "secondarySignerAddresses" in data;
147
+ }
148
+
117
149
  /**
118
150
  * Sign a transaction that can later be submitted to chain
119
151
  *
@@ -10,7 +10,7 @@ import {
10
10
  } from "../types";
11
11
  import { Bool, FixedBytes, MoveString, U128, U16, U256, U32, U64, U8 } from "../../bcs";
12
12
  import { AccountAddress } from "../../core";
13
- import { MoveFunction, MoveStructType } from "../../types";
13
+ import { MoveFunction, MoveFunctionId } from "../../types";
14
14
 
15
15
  export function isBool(arg: SimpleEntryFunctionArgumentTypes): arg is boolean {
16
16
  return typeof arg === "boolean";
@@ -91,7 +91,7 @@ export function findFirstNonSignerArg(functionAbi: MoveFunction): number {
91
91
  return index;
92
92
  }
93
93
 
94
- export function getFunctionParts(functionArg: MoveStructType) {
94
+ export function getFunctionParts(functionArg: MoveFunctionId) {
95
95
  const funcNameParts = functionArg.split("::");
96
96
  if (funcNameParts.length !== 3) {
97
97
  throw new Error(`Invalid function ${functionArg}`);
@@ -86,9 +86,7 @@ import { getFunctionParts, isScriptDataInput } from "./helpers";
86
86
  * When we call our `generateTransactionPayload` function with the relevant type properties,
87
87
  * Typescript can infer the return type based on the appropriate function overload.
88
88
  */
89
- export async function generateTransactionPayload(
90
- args: InputScriptData & { aptosConfig?: undefined },
91
- ): Promise<TransactionPayloadScript>;
89
+ export async function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;
92
90
  export async function generateTransactionPayload(
93
91
  args: InputEntryFunctionDataWithRemoteABI,
94
92
  ): Promise<TransactionPayloadEntryFunction>;
@@ -234,7 +232,7 @@ export async function generateRawTransaction(args: {
234
232
  );
235
233
 
236
234
  const { maxGasAmount, gasUnitPrice, expireTimestamp } = {
237
- maxGasAmount: BigInt(DEFAULT_MAX_GAS_AMOUNT),
235
+ maxGasAmount: options?.maxGasAmount ? BigInt(options.maxGasAmount) : BigInt(DEFAULT_MAX_GAS_AMOUNT),
238
236
  gasUnitPrice: BigInt(gasEstimate),
239
237
  expireTimestamp: BigInt(Math.floor(Date.now() / 1000) + DEFAULT_TXN_EXP_SEC_FROM_NOW),
240
238
  ...options,
@@ -290,7 +288,7 @@ export async function buildTransaction(args: InputGenerateRawTransactionArgs): P
290
288
  * ```
291
289
  */
292
290
  export async function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction> {
293
- const { aptosConfig, sender, payload, options, secondarySignerAddresses, feePayerAddress } = args;
291
+ const { aptosConfig, sender, payload, options } = args;
294
292
  // generate raw transaction
295
293
  const rawTxn = await generateRawTransaction({
296
294
  aptosConfig,
@@ -299,20 +297,21 @@ export async function buildTransaction(args: InputGenerateRawTransactionArgs): P
299
297
  options,
300
298
  });
301
299
 
302
- if (feePayerAddress) {
303
- const signers: Array<AccountAddress> = secondarySignerAddresses
304
- ? secondarySignerAddresses.map((signer) => AccountAddress.fromRelaxed(signer))
305
- : [];
300
+ if ("feePayerAddress" in args) {
301
+ const signers: Array<AccountAddress> =
302
+ args.secondarySignerAddresses?.map((signer) => AccountAddress.fromRelaxed(signer)) ?? [];
306
303
 
307
304
  return {
308
305
  rawTransaction: rawTxn,
309
306
  secondarySignerAddresses: signers,
310
- feePayerAddress: AccountAddress.fromRelaxed(feePayerAddress),
307
+ feePayerAddress:
308
+ args?.feePayerAddress !== undefined ? AccountAddress.fromRelaxed(args.feePayerAddress) : undefined,
311
309
  };
312
310
  }
313
311
 
314
- if (secondarySignerAddresses) {
315
- const signers: Array<AccountAddress> = secondarySignerAddresses.map((signer) => AccountAddress.fromRelaxed(signer));
312
+ if ("secondarySignerAddresses" in args) {
313
+ const signers: Array<AccountAddress> =
314
+ args.secondarySignerAddresses?.map((signer) => AccountAddress.fromRelaxed(signer)) ?? [];
316
315
 
317
316
  return {
318
317
  rawTransaction: rawTxn,
@@ -342,7 +341,7 @@ export function generateSignedTransactionForSimulation(args: InputSimulateTransa
342
341
 
343
342
  const accountAuthenticator = getAuthenticatorForSimulation(signerPublicKey);
344
343
  // fee payer transaction
345
- if (transaction.feePayerAddress) {
344
+ if ("feePayerAddress" in transaction) {
346
345
  const transactionToSign = new FeePayerRawTransaction(
347
346
  deserializedTransaction,
348
347
  transaction.secondarySignerAddresses ?? [],
@@ -371,7 +370,7 @@ export function generateSignedTransactionForSimulation(args: InputSimulateTransa
371
370
  }
372
371
 
373
372
  // multi agent transaction
374
- if (transaction.secondarySignerAddresses) {
373
+ if ("secondarySignerAddresses" in transaction) {
375
374
  const transactionToSign = new MultiAgentRawTransaction(
376
375
  deserializedTransaction,
377
376
  transaction.secondarySignerAddresses,
@@ -515,14 +514,14 @@ export function generateSignedTransaction(args: InputSubmitTransactionData): Uin
515
514
  * @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction
516
515
  */
517
516
  export function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance {
518
- if (transaction.feePayerAddress) {
517
+ if ("feePayerAddress" in transaction) {
519
518
  return new FeePayerRawTransaction(
520
519
  transaction.rawTransaction,
521
520
  transaction.secondarySignerAddresses ?? [],
522
521
  transaction.feePayerAddress,
523
522
  );
524
523
  }
525
- if (transaction.secondarySignerAddresses) {
524
+ if ("secondarySignerAddresses" in transaction) {
526
525
  return new MultiAgentRawTransaction(transaction.rawTransaction, transaction.secondarySignerAddresses);
527
526
  }
528
527
 
@@ -29,6 +29,10 @@ function isValidWhitespaceCharacter(char: string) {
29
29
  return !!char.match(/\s/);
30
30
  }
31
31
 
32
+ function isGeneric(str: string) {
33
+ return !!str.match(/^T[0-9]+$/);
34
+ }
35
+
32
36
  function consumeWhitespace(tagStr: string, pos: number) {
33
37
  let i = pos;
34
38
  for (; i < tagStr.length; i += 1) {
@@ -50,6 +54,7 @@ type TypeTagState = {
50
54
 
51
55
  export enum TypeTagParserErrorType {
52
56
  InvalidTypeTag = "unknown type",
57
+ UnexpectedGenericType = "unexpected generic type",
53
58
  UnexpectedTypeArgumentClose = "unexpected '>'",
54
59
  UnexpectedWhitespaceCharacter = "unexpected whitespace character",
55
60
  UnexpectedComma = "unexpected ','",
@@ -262,8 +267,11 @@ function parseTypeTagInner(str: string, types: Array<TypeTag>, allowGenerics: bo
262
267
  }
263
268
  return new TypeTagVector(types[0]);
264
269
  default:
265
- if (allowGenerics && str.match(/^T[0-9]+$/)) {
266
- return new TypeTagGeneric(Number(str.split("T")[1]));
270
+ if (isGeneric(str)) {
271
+ if (allowGenerics) {
272
+ return new TypeTagGeneric(Number(str.split("T")[1]));
273
+ }
274
+ throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedGenericType);
267
275
  }
268
276
 
269
277
  // If the value doesn't contain a colon, then we'll assume it isn't trying to be a struct