@aptos-labs/ts-sdk 1.35.0-zeta.1 → 1.35.0-zeta.2

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 (277) hide show
  1. package/dist/common/index.d.ts +31 -17
  2. package/dist/common/index.js +1044 -1026
  3. package/dist/common/index.js.map +1 -1
  4. package/dist/esm/account/AbstractKeylessAccount.mjs +19 -19
  5. package/dist/esm/account/AbstractedAccount.mjs +21 -21
  6. package/dist/esm/account/Account.mjs +20 -20
  7. package/dist/esm/account/AccountUtils.mjs +25 -25
  8. package/dist/esm/account/Ed25519Account.mjs +18 -18
  9. package/dist/esm/account/EphemeralKeyPair.mjs +12 -12
  10. package/dist/esm/account/FederatedKeylessAccount.mjs +20 -20
  11. package/dist/esm/account/KeylessAccount.mjs +20 -20
  12. package/dist/esm/account/MultiEd25519Account.mjs +18 -18
  13. package/dist/esm/account/MultiKeyAccount.d.mts +1 -0
  14. package/dist/esm/account/MultiKeyAccount.mjs +22 -22
  15. package/dist/esm/account/SingleKeyAccount.mjs +18 -18
  16. package/dist/esm/account/index.mjs +28 -28
  17. package/dist/esm/account/utils.mjs +11 -11
  18. package/dist/esm/api/account/abstraction.mjs +39 -39
  19. package/dist/esm/api/account.mjs +43 -41
  20. package/dist/esm/api/ans.mjs +39 -39
  21. package/dist/esm/api/aptos.d.mts +0 -1
  22. package/dist/esm/api/aptos.mjs +73 -70
  23. package/dist/esm/api/coin.mjs +38 -37
  24. package/dist/esm/api/digitalAsset.mjs +39 -39
  25. package/dist/esm/api/event.mjs +16 -16
  26. package/dist/esm/api/experimental.mjs +26 -40
  27. package/dist/esm/api/faucet.mjs +15 -15
  28. package/dist/esm/api/fungibleAsset.mjs +39 -39
  29. package/dist/esm/api/general.d.mts +2 -2
  30. package/dist/esm/api/general.mjs +26 -40
  31. package/dist/esm/api/index.d.mts +0 -1
  32. package/dist/esm/api/index.mjs +73 -70
  33. package/dist/esm/api/keyless.mjs +40 -38
  34. package/dist/esm/api/object.mjs +16 -16
  35. package/dist/esm/api/staking.mjs +16 -16
  36. package/dist/esm/api/table.mjs +7 -7
  37. package/dist/esm/api/transaction.d.mts +30 -18
  38. package/dist/esm/api/transaction.mjs +45 -43
  39. package/dist/esm/api/transactionSubmission/build.mjs +37 -37
  40. package/dist/esm/api/transactionSubmission/management.mjs +41 -39
  41. package/dist/esm/api/transactionSubmission/sign.mjs +36 -36
  42. package/dist/esm/api/transactionSubmission/simulate.mjs +37 -37
  43. package/dist/esm/api/transactionSubmission/submit.mjs +37 -37
  44. package/dist/esm/api/utils.mjs +5 -5
  45. package/dist/esm/bcs/index.mjs +1 -1
  46. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  47. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  48. package/dist/esm/{chunk-JJ6MU2DV.mjs → chunk-2FTF6J7F.mjs} +3 -3
  49. package/dist/esm/{chunk-54XJAHWK.mjs → chunk-2HL7JEFC.mjs} +9 -9
  50. package/dist/esm/{chunk-TZZZNGQI.mjs → chunk-2WBJAKBO.mjs} +2 -2
  51. package/dist/esm/{chunk-3E2SXJXZ.mjs → chunk-3DAVHDK4.mjs} +2 -2
  52. package/dist/esm/{chunk-F65QGYVD.mjs → chunk-3TUV6YMI.mjs} +3 -3
  53. package/dist/esm/{chunk-KZFQOE4N.mjs → chunk-5ORUQZAR.mjs} +3 -3
  54. package/dist/esm/{chunk-RTNVJKNX.mjs → chunk-62LC4PPC.mjs} +3 -3
  55. package/dist/esm/{chunk-OOQS6BEP.mjs → chunk-6OFCIXWS.mjs} +2 -2
  56. package/dist/esm/chunk-6OFCIXWS.mjs.map +1 -0
  57. package/dist/esm/{chunk-YD3KHXBD.mjs → chunk-6SNGKTWE.mjs} +2 -2
  58. package/dist/esm/{chunk-2SIDNRJH.mjs → chunk-7F32C225.mjs} +4 -4
  59. package/dist/esm/{chunk-TFDBSPIQ.mjs → chunk-7WW735TU.mjs} +3 -3
  60. package/dist/esm/{chunk-SFF4FJUD.mjs → chunk-A33OBGVN.mjs} +3 -3
  61. package/dist/esm/{chunk-J32AERDF.mjs → chunk-A7LYGPFL.mjs} +3 -3
  62. package/dist/esm/{chunk-BADWWRLN.mjs → chunk-AGKEC2IM.mjs} +5 -5
  63. package/dist/esm/{chunk-GUEJH55K.mjs → chunk-BU43ZFDJ.mjs} +2 -2
  64. package/dist/esm/{chunk-PP2U5UMC.mjs → chunk-C7EEG6SW.mjs} +4 -4
  65. package/dist/esm/{chunk-HTC3Q5JN.mjs → chunk-D4MW64RH.mjs} +4 -4
  66. package/dist/esm/{chunk-YMHFUSKX.mjs → chunk-D6RXVCE3.mjs} +3 -3
  67. package/dist/esm/{chunk-7J37IHNP.mjs → chunk-DGDZNHUJ.mjs} +5 -3
  68. package/dist/esm/{chunk-7J37IHNP.mjs.map → chunk-DGDZNHUJ.mjs.map} +1 -1
  69. package/dist/esm/{chunk-NFBLI3BS.mjs → chunk-DMFRIING.mjs} +2 -2
  70. package/dist/esm/{chunk-CPZPXG7O.mjs → chunk-ECTX2FGD.mjs} +4 -4
  71. package/dist/esm/{chunk-CDJNQ7CS.mjs → chunk-FDMI4BUL.mjs} +29 -22
  72. package/dist/esm/chunk-FDMI4BUL.mjs.map +1 -0
  73. package/dist/esm/chunk-FRLS4GRM.mjs +62 -0
  74. package/dist/esm/chunk-FRLS4GRM.mjs.map +1 -0
  75. package/dist/esm/chunk-G3MHXDYA.mjs +1 -0
  76. package/dist/esm/chunk-G3MHXDYA.mjs.map +1 -0
  77. package/dist/esm/{chunk-OVZOE4GS.mjs → chunk-G6R77JKO.mjs} +16 -16
  78. package/dist/esm/{chunk-XHQMSKZP.mjs → chunk-G7BB6K4B.mjs} +5 -5
  79. package/dist/esm/{chunk-XB4SVKZP.mjs → chunk-GCQK2S5Q.mjs} +2 -2
  80. package/dist/esm/{chunk-2WTIMHGC.mjs → chunk-HBXBODME.mjs} +3 -3
  81. package/dist/esm/{chunk-D3IWXA33.mjs → chunk-HKQY5GXT.mjs} +7 -191
  82. package/dist/esm/chunk-HKQY5GXT.mjs.map +1 -0
  83. package/dist/esm/{chunk-WSI6NVQD.mjs → chunk-HL337SEM.mjs} +3 -3
  84. package/dist/esm/{chunk-V66UC6YI.mjs → chunk-HQDHSKVS.mjs} +2 -2
  85. package/dist/esm/{chunk-ZATMRCFV.mjs → chunk-I5G7XFGT.mjs} +3 -3
  86. package/dist/esm/{chunk-MC4OOX6X.mjs → chunk-IJ7XCPP3.mjs} +36 -31
  87. package/dist/esm/chunk-IJ7XCPP3.mjs.map +1 -0
  88. package/dist/esm/{chunk-SW4ASQPY.mjs → chunk-ILTEOGFF.mjs} +6 -6
  89. package/dist/esm/{chunk-KK7SBRDQ.mjs → chunk-IP7GATDH.mjs} +6 -6
  90. package/dist/esm/{chunk-KK7SBRDQ.mjs.map → chunk-IP7GATDH.mjs.map} +1 -1
  91. package/dist/esm/{chunk-RGHKUKOX.mjs → chunk-IPUAVRGL.mjs} +5 -5
  92. package/dist/esm/{chunk-MLGROHE6.mjs → chunk-IQVHXOD3.mjs} +10 -10
  93. package/dist/esm/{chunk-IEM26R5Q.mjs → chunk-JAZJE3OR.mjs} +2 -2
  94. package/dist/esm/{chunk-VJ2Z7GO3.mjs → chunk-JEVGHYEP.mjs} +2 -2
  95. package/dist/esm/{chunk-WPJUSJJQ.mjs → chunk-JFMFZ2IL.mjs} +3 -3
  96. package/dist/esm/{chunk-IORAMQ2Y.mjs → chunk-K5OCDM3W.mjs} +8 -8
  97. package/dist/esm/{chunk-IORAMQ2Y.mjs.map → chunk-K5OCDM3W.mjs.map} +1 -1
  98. package/dist/esm/{chunk-ESGBNVCA.mjs → chunk-ORCQEMJL.mjs} +2 -2
  99. package/dist/esm/{chunk-PYLTV3KI.mjs → chunk-QYNYDQE3.mjs} +4 -4
  100. package/dist/esm/{chunk-F2EFNUWD.mjs → chunk-R45SPK6Q.mjs} +4 -4
  101. package/dist/esm/{chunk-UKYATVYK.mjs → chunk-RCXGTN36.mjs} +2 -2
  102. package/dist/esm/{chunk-6DJZITWL.mjs → chunk-SPI2HO3E.mjs} +2 -2
  103. package/dist/esm/{chunk-YGFWUFZY.mjs → chunk-SPVJXZL5.mjs} +186 -62
  104. package/dist/esm/chunk-SPVJXZL5.mjs.map +1 -0
  105. package/dist/esm/{chunk-BVBIBMAE.mjs → chunk-SRXIHVZE.mjs} +2 -2
  106. package/dist/esm/{chunk-ZAPXD4FC.mjs → chunk-T4BFWV46.mjs} +2 -2
  107. package/dist/esm/{chunk-ZZWD23YW.mjs → chunk-T573PCIR.mjs} +3 -3
  108. package/dist/esm/{chunk-AEMQUDMU.mjs → chunk-TDLL7QX5.mjs} +11 -11
  109. package/dist/esm/{chunk-HRUI6AWF.mjs → chunk-TFW6N66T.mjs} +4 -4
  110. package/dist/esm/{chunk-LK4HGGAJ.mjs → chunk-TJDF4CXI.mjs} +2 -2
  111. package/dist/esm/{chunk-U7K7AJMC.mjs → chunk-TL4Z4KHK.mjs} +2 -2
  112. package/dist/esm/{chunk-IARAGRKO.mjs → chunk-UGFIWCJQ.mjs} +4 -4
  113. package/dist/esm/{chunk-Y25NJOOO.mjs → chunk-UK7SPHIE.mjs} +4 -4
  114. package/dist/esm/{chunk-MX2R6BBJ.mjs → chunk-UOHCJOXI.mjs} +2 -2
  115. package/dist/esm/{chunk-S5JIXUS6.mjs → chunk-WHSS6I7T.mjs} +4 -4
  116. package/dist/esm/{chunk-2ZX5PHCY.mjs → chunk-WLTQHGIJ.mjs} +5 -5
  117. package/dist/esm/{chunk-MD4TZ4HA.mjs → chunk-WUM247HF.mjs} +3 -3
  118. package/dist/esm/{chunk-IY2ASLSP.mjs → chunk-WXQUBQK4.mjs} +2 -2
  119. package/dist/esm/{chunk-3T7G4OUL.mjs → chunk-X4N5BN3S.mjs} +2 -2
  120. package/dist/esm/{chunk-TQLOZKH4.mjs → chunk-XIBOO3WF.mjs} +3 -3
  121. package/dist/esm/{chunk-2JLHWA2G.mjs → chunk-Y3M32DIB.mjs} +2 -2
  122. package/dist/esm/{chunk-IKEPH7D2.mjs → chunk-YK66QBML.mjs} +4 -4
  123. package/dist/esm/{chunk-PITSYZA7.mjs → chunk-YT7V6AVJ.mjs} +2 -2
  124. package/dist/esm/chunk-ZRBUAZZD.mjs +36 -0
  125. package/dist/esm/chunk-ZRBUAZZD.mjs.map +1 -0
  126. package/dist/esm/cli/index.mjs +1 -1
  127. package/dist/esm/cli/localNode.mjs +1 -1
  128. package/dist/esm/client/core.mjs +1 -1
  129. package/dist/esm/client/get.mjs +1 -1
  130. package/dist/esm/client/index.mjs +10 -10
  131. package/dist/esm/client/post.mjs +1 -1
  132. package/dist/esm/core/account/index.mjs +1 -1
  133. package/dist/esm/core/account/utils/address.mjs +1 -1
  134. package/dist/esm/core/account/utils/index.mjs +1 -1
  135. package/dist/esm/core/accountAddress.mjs +1 -1
  136. package/dist/esm/core/authenticationKey.mjs +1 -1
  137. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  138. package/dist/esm/core/crypto/ed25519.mjs +3 -3
  139. package/dist/esm/core/crypto/ephemeral.mjs +4 -4
  140. package/dist/esm/core/crypto/federatedKeyless.mjs +7 -7
  141. package/dist/esm/core/crypto/index.mjs +13 -13
  142. package/dist/esm/core/crypto/keyless.mjs +6 -6
  143. package/dist/esm/core/crypto/multiEd25519.mjs +11 -11
  144. package/dist/esm/core/crypto/multiKey.mjs +10 -10
  145. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  146. package/dist/esm/core/crypto/proof.mjs +1 -1
  147. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  148. package/dist/esm/core/crypto/secp256k1.mjs +3 -3
  149. package/dist/esm/core/crypto/signature.mjs +1 -1
  150. package/dist/esm/core/crypto/singleKey.mjs +9 -9
  151. package/dist/esm/core/index.mjs +13 -13
  152. package/dist/esm/errors/index.mjs +1 -1
  153. package/dist/esm/index.mjs +102 -99
  154. package/dist/esm/internal/abstraction.mjs +37 -37
  155. package/dist/esm/internal/account.d.mts +45 -5
  156. package/dist/esm/internal/account.mjs +48 -34
  157. package/dist/esm/internal/ans.mjs +38 -38
  158. package/dist/esm/internal/coin.mjs +37 -36
  159. package/dist/esm/internal/digitalAsset.mjs +37 -37
  160. package/dist/esm/internal/event.mjs +13 -13
  161. package/dist/esm/internal/experimental.mjs +25 -39
  162. package/dist/esm/internal/faucet.mjs +14 -14
  163. package/dist/esm/internal/fungibleAsset.mjs +37 -37
  164. package/dist/esm/internal/general.mjs +3 -3
  165. package/dist/esm/internal/keyless.mjs +39 -37
  166. package/dist/esm/internal/object.mjs +13 -13
  167. package/dist/esm/internal/staking.mjs +13 -13
  168. package/dist/esm/internal/table.mjs +4 -4
  169. package/dist/esm/internal/transaction.mjs +4 -4
  170. package/dist/esm/internal/transactionSubmission.d.mts +6 -36
  171. package/dist/esm/internal/transactionSubmission.mjs +36 -42
  172. package/dist/esm/internal/utils/index.d.mts +15 -0
  173. package/dist/esm/internal/utils/index.mjs +39 -0
  174. package/dist/esm/internal/utils/index.mjs.map +1 -0
  175. package/dist/esm/internal/utils/utils.d.mts +65 -0
  176. package/dist/esm/internal/utils/utils.mjs +38 -0
  177. package/dist/esm/internal/utils/utils.mjs.map +1 -0
  178. package/dist/esm/internal/view.mjs +25 -39
  179. package/dist/esm/transactions/authenticator/account.mjs +12 -12
  180. package/dist/esm/transactions/authenticator/index.mjs +13 -13
  181. package/dist/esm/transactions/authenticator/transaction.mjs +13 -13
  182. package/dist/esm/transactions/index.mjs +43 -57
  183. package/dist/esm/transactions/instances/index.mjs +21 -21
  184. package/dist/esm/transactions/instances/moduleId.mjs +11 -11
  185. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +12 -12
  186. package/dist/esm/transactions/instances/rawTransaction.mjs +12 -12
  187. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  188. package/dist/esm/transactions/instances/signedTransaction.mjs +15 -15
  189. package/dist/esm/transactions/instances/simpleTransaction.mjs +12 -12
  190. package/dist/esm/transactions/instances/transactionPayload.mjs +11 -11
  191. package/dist/esm/transactions/management/accountSequenceNumber.mjs +45 -33
  192. package/dist/esm/transactions/management/index.mjs +40 -38
  193. package/dist/esm/transactions/management/transactionWorker.mjs +40 -38
  194. package/dist/esm/transactions/scriptComposer/index.mjs +24 -38
  195. package/dist/esm/transactions/transactionBuilder/helpers.mjs +11 -11
  196. package/dist/esm/transactions/transactionBuilder/index.mjs +23 -37
  197. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +14 -45
  198. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +17 -17
  199. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +23 -38
  200. package/dist/esm/transactions/typeTag/index.mjs +11 -11
  201. package/dist/esm/transactions/typeTag/parser.mjs +11 -11
  202. package/dist/esm/types/index.mjs +1 -1
  203. package/dist/esm/utils/helpers.mjs +1 -1
  204. package/dist/esm/utils/index.mjs +1 -1
  205. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  206. package/package.json +25 -24
  207. package/src/account/MultiKeyAccount.ts +3 -2
  208. package/src/api/general.ts +2 -2
  209. package/src/api/transaction.ts +30 -29
  210. package/src/internal/account.ts +202 -61
  211. package/src/internal/transactionSubmission.ts +4 -202
  212. package/src/internal/utils/index.ts +4 -0
  213. package/src/internal/utils/utils.ts +116 -0
  214. package/src/transactions/scriptComposer/index.ts +3 -1
  215. package/src/transactions/transactionBuilder/remoteAbi.ts +1 -1
  216. package/src/transactions/transactionBuilder/transactionBuilder.ts +7 -2
  217. package/dist/esm/chunk-CDJNQ7CS.mjs.map +0 -1
  218. package/dist/esm/chunk-D3IWXA33.mjs.map +0 -1
  219. package/dist/esm/chunk-MC4OOX6X.mjs.map +0 -1
  220. package/dist/esm/chunk-OOQS6BEP.mjs.map +0 -1
  221. package/dist/esm/chunk-YGFWUFZY.mjs.map +0 -1
  222. /package/dist/esm/{chunk-JJ6MU2DV.mjs.map → chunk-2FTF6J7F.mjs.map} +0 -0
  223. /package/dist/esm/{chunk-54XJAHWK.mjs.map → chunk-2HL7JEFC.mjs.map} +0 -0
  224. /package/dist/esm/{chunk-TZZZNGQI.mjs.map → chunk-2WBJAKBO.mjs.map} +0 -0
  225. /package/dist/esm/{chunk-3E2SXJXZ.mjs.map → chunk-3DAVHDK4.mjs.map} +0 -0
  226. /package/dist/esm/{chunk-F65QGYVD.mjs.map → chunk-3TUV6YMI.mjs.map} +0 -0
  227. /package/dist/esm/{chunk-KZFQOE4N.mjs.map → chunk-5ORUQZAR.mjs.map} +0 -0
  228. /package/dist/esm/{chunk-RTNVJKNX.mjs.map → chunk-62LC4PPC.mjs.map} +0 -0
  229. /package/dist/esm/{chunk-YD3KHXBD.mjs.map → chunk-6SNGKTWE.mjs.map} +0 -0
  230. /package/dist/esm/{chunk-2SIDNRJH.mjs.map → chunk-7F32C225.mjs.map} +0 -0
  231. /package/dist/esm/{chunk-TFDBSPIQ.mjs.map → chunk-7WW735TU.mjs.map} +0 -0
  232. /package/dist/esm/{chunk-SFF4FJUD.mjs.map → chunk-A33OBGVN.mjs.map} +0 -0
  233. /package/dist/esm/{chunk-J32AERDF.mjs.map → chunk-A7LYGPFL.mjs.map} +0 -0
  234. /package/dist/esm/{chunk-BADWWRLN.mjs.map → chunk-AGKEC2IM.mjs.map} +0 -0
  235. /package/dist/esm/{chunk-GUEJH55K.mjs.map → chunk-BU43ZFDJ.mjs.map} +0 -0
  236. /package/dist/esm/{chunk-PP2U5UMC.mjs.map → chunk-C7EEG6SW.mjs.map} +0 -0
  237. /package/dist/esm/{chunk-HTC3Q5JN.mjs.map → chunk-D4MW64RH.mjs.map} +0 -0
  238. /package/dist/esm/{chunk-YMHFUSKX.mjs.map → chunk-D6RXVCE3.mjs.map} +0 -0
  239. /package/dist/esm/{chunk-NFBLI3BS.mjs.map → chunk-DMFRIING.mjs.map} +0 -0
  240. /package/dist/esm/{chunk-CPZPXG7O.mjs.map → chunk-ECTX2FGD.mjs.map} +0 -0
  241. /package/dist/esm/{chunk-OVZOE4GS.mjs.map → chunk-G6R77JKO.mjs.map} +0 -0
  242. /package/dist/esm/{chunk-XHQMSKZP.mjs.map → chunk-G7BB6K4B.mjs.map} +0 -0
  243. /package/dist/esm/{chunk-XB4SVKZP.mjs.map → chunk-GCQK2S5Q.mjs.map} +0 -0
  244. /package/dist/esm/{chunk-2WTIMHGC.mjs.map → chunk-HBXBODME.mjs.map} +0 -0
  245. /package/dist/esm/{chunk-WSI6NVQD.mjs.map → chunk-HL337SEM.mjs.map} +0 -0
  246. /package/dist/esm/{chunk-V66UC6YI.mjs.map → chunk-HQDHSKVS.mjs.map} +0 -0
  247. /package/dist/esm/{chunk-ZATMRCFV.mjs.map → chunk-I5G7XFGT.mjs.map} +0 -0
  248. /package/dist/esm/{chunk-SW4ASQPY.mjs.map → chunk-ILTEOGFF.mjs.map} +0 -0
  249. /package/dist/esm/{chunk-RGHKUKOX.mjs.map → chunk-IPUAVRGL.mjs.map} +0 -0
  250. /package/dist/esm/{chunk-MLGROHE6.mjs.map → chunk-IQVHXOD3.mjs.map} +0 -0
  251. /package/dist/esm/{chunk-IEM26R5Q.mjs.map → chunk-JAZJE3OR.mjs.map} +0 -0
  252. /package/dist/esm/{chunk-VJ2Z7GO3.mjs.map → chunk-JEVGHYEP.mjs.map} +0 -0
  253. /package/dist/esm/{chunk-WPJUSJJQ.mjs.map → chunk-JFMFZ2IL.mjs.map} +0 -0
  254. /package/dist/esm/{chunk-ESGBNVCA.mjs.map → chunk-ORCQEMJL.mjs.map} +0 -0
  255. /package/dist/esm/{chunk-PYLTV3KI.mjs.map → chunk-QYNYDQE3.mjs.map} +0 -0
  256. /package/dist/esm/{chunk-F2EFNUWD.mjs.map → chunk-R45SPK6Q.mjs.map} +0 -0
  257. /package/dist/esm/{chunk-UKYATVYK.mjs.map → chunk-RCXGTN36.mjs.map} +0 -0
  258. /package/dist/esm/{chunk-6DJZITWL.mjs.map → chunk-SPI2HO3E.mjs.map} +0 -0
  259. /package/dist/esm/{chunk-BVBIBMAE.mjs.map → chunk-SRXIHVZE.mjs.map} +0 -0
  260. /package/dist/esm/{chunk-ZAPXD4FC.mjs.map → chunk-T4BFWV46.mjs.map} +0 -0
  261. /package/dist/esm/{chunk-ZZWD23YW.mjs.map → chunk-T573PCIR.mjs.map} +0 -0
  262. /package/dist/esm/{chunk-AEMQUDMU.mjs.map → chunk-TDLL7QX5.mjs.map} +0 -0
  263. /package/dist/esm/{chunk-HRUI6AWF.mjs.map → chunk-TFW6N66T.mjs.map} +0 -0
  264. /package/dist/esm/{chunk-LK4HGGAJ.mjs.map → chunk-TJDF4CXI.mjs.map} +0 -0
  265. /package/dist/esm/{chunk-U7K7AJMC.mjs.map → chunk-TL4Z4KHK.mjs.map} +0 -0
  266. /package/dist/esm/{chunk-IARAGRKO.mjs.map → chunk-UGFIWCJQ.mjs.map} +0 -0
  267. /package/dist/esm/{chunk-Y25NJOOO.mjs.map → chunk-UK7SPHIE.mjs.map} +0 -0
  268. /package/dist/esm/{chunk-MX2R6BBJ.mjs.map → chunk-UOHCJOXI.mjs.map} +0 -0
  269. /package/dist/esm/{chunk-S5JIXUS6.mjs.map → chunk-WHSS6I7T.mjs.map} +0 -0
  270. /package/dist/esm/{chunk-2ZX5PHCY.mjs.map → chunk-WLTQHGIJ.mjs.map} +0 -0
  271. /package/dist/esm/{chunk-MD4TZ4HA.mjs.map → chunk-WUM247HF.mjs.map} +0 -0
  272. /package/dist/esm/{chunk-IY2ASLSP.mjs.map → chunk-WXQUBQK4.mjs.map} +0 -0
  273. /package/dist/esm/{chunk-3T7G4OUL.mjs.map → chunk-X4N5BN3S.mjs.map} +0 -0
  274. /package/dist/esm/{chunk-TQLOZKH4.mjs.map → chunk-XIBOO3WF.mjs.map} +0 -0
  275. /package/dist/esm/{chunk-2JLHWA2G.mjs.map → chunk-Y3M32DIB.mjs.map} +0 -0
  276. /package/dist/esm/{chunk-IKEPH7D2.mjs.map → chunk-YK66QBML.mjs.map} +0 -0
  277. /package/dist/esm/{chunk-PITSYZA7.mjs.map → chunk-YT7V6AVJ.mjs.map} +0 -0
@@ -1,12 +1,22 @@
1
1
  import {
2
2
  getTableItem
3
- } from "./chunk-PITSYZA7.mjs";
3
+ } from "./chunk-YT7V6AVJ.mjs";
4
4
  import {
5
- getTransactionByVersion
6
- } from "./chunk-GUEJH55K.mjs";
5
+ generateTransaction,
6
+ signAndSubmitTransaction
7
+ } from "./chunk-HKQY5GXT.mjs";
8
+ import {
9
+ getInfo,
10
+ getModule,
11
+ getModules
12
+ } from "./chunk-FRLS4GRM.mjs";
13
+ import {
14
+ getTransactionByVersion,
15
+ waitForTransaction
16
+ } from "./chunk-BU43ZFDJ.mjs";
7
17
  import {
8
18
  queryIndexer
9
- } from "./chunk-IKEPH7D2.mjs";
19
+ } from "./chunk-YK66QBML.mjs";
10
20
  import {
11
21
  GetAccountAddressesForAuthKey,
12
22
  GetAccountCoinsCount,
@@ -21,41 +31,51 @@ import {
21
31
  GetObjectData,
22
32
  GetSignatures
23
33
  } from "./chunk-EPTUAWRA.mjs";
34
+ import {
35
+ MultiEd25519Account
36
+ } from "./chunk-5ORUQZAR.mjs";
24
37
  import {
25
38
  Account
26
- } from "./chunk-S5JIXUS6.mjs";
39
+ } from "./chunk-WHSS6I7T.mjs";
40
+ import {
41
+ Ed25519Account
42
+ } from "./chunk-62LC4PPC.mjs";
43
+ import {
44
+ RotationProofChallenge
45
+ } from "./chunk-QJ6CGH7N.mjs";
46
+ import {
47
+ TypeTagU8,
48
+ TypeTagVector
49
+ } from "./chunk-DDZGHA66.mjs";
27
50
  import {
28
51
  createObjectAddress
29
52
  } from "./chunk-6I37A76G.mjs";
30
53
  import {
31
54
  MultiEd25519PublicKey
32
- } from "./chunk-F65QGYVD.mjs";
55
+ } from "./chunk-3TUV6YMI.mjs";
33
56
  import {
34
57
  MultiKey
35
- } from "./chunk-NFBLI3BS.mjs";
58
+ } from "./chunk-DMFRIING.mjs";
36
59
  import {
37
60
  AnyPublicKey
38
- } from "./chunk-RGHKUKOX.mjs";
61
+ } from "./chunk-IPUAVRGL.mjs";
39
62
  import {
40
63
  Secp256k1PrivateKey,
41
64
  Secp256k1PublicKey
42
- } from "./chunk-CPZPXG7O.mjs";
65
+ } from "./chunk-ECTX2FGD.mjs";
43
66
  import {
44
67
  FederatedKeylessPublicKey
45
- } from "./chunk-YD3KHXBD.mjs";
68
+ } from "./chunk-6SNGKTWE.mjs";
46
69
  import {
47
70
  KeylessPublicKey
48
- } from "./chunk-ZZWD23YW.mjs";
71
+ } from "./chunk-T573PCIR.mjs";
49
72
  import {
50
73
  Ed25519PrivateKey,
51
74
  Ed25519PublicKey
52
- } from "./chunk-HRUI6AWF.mjs";
75
+ } from "./chunk-TFW6N66T.mjs";
53
76
  import {
54
77
  AuthenticationKey
55
78
  } from "./chunk-PKUXOBIV.mjs";
56
- import {
57
- memoizeAsync
58
- } from "./chunk-BEYIOC2H.mjs";
59
79
  import {
60
80
  getAptosFullNode,
61
81
  paginateWithCursor,
@@ -67,6 +87,12 @@ import {
67
87
  import {
68
88
  AccountAddress
69
89
  } from "./chunk-CXLXUSCG.mjs";
90
+ import {
91
+ MoveVector
92
+ } from "./chunk-KSK3XIGF.mjs";
93
+ import {
94
+ U8
95
+ } from "./chunk-QSYWLSSN.mjs";
70
96
  import {
71
97
  isEd25519Signature,
72
98
  isMultiEd25519Signature,
@@ -85,48 +111,14 @@ import {
85
111
  } from "./chunk-5QHMFYVL.mjs";
86
112
 
87
113
  // src/internal/account.ts
88
- async function getInfo(args) {
89
- const { aptosConfig, accountAddress } = args;
90
- const { data } = await getAptosFullNode({
91
- aptosConfig,
92
- originMethod: "getInfo",
93
- path: `accounts/${AccountAddress.from(accountAddress).toString()}`
94
- });
95
- return data;
96
- }
97
- async function getModules(args) {
98
- const { aptosConfig, accountAddress, options } = args;
99
- return paginateWithObfuscatedCursor({
100
- aptosConfig,
101
- originMethod: "getModules",
102
- path: `accounts/${AccountAddress.from(accountAddress).toString()}/modules`,
103
- params: {
104
- ledger_version: options?.ledgerVersion,
105
- offset: options?.offset,
106
- limit: options?.limit ?? 1e3
107
- }
108
- });
114
+ async function getInfo2(args) {
115
+ return getInfo(args);
109
116
  }
110
- async function getModule(args) {
111
- if (args.options?.ledgerVersion !== void 0) {
112
- return getModuleInner(args);
113
- }
114
- return memoizeAsync(
115
- async () => getModuleInner(args),
116
- `module-${args.accountAddress}-${args.moduleName}`,
117
- 1e3 * 60 * 5
118
- // 5 minutes
119
- )();
117
+ async function getModules2(args) {
118
+ return getModules(args);
120
119
  }
121
- async function getModuleInner(args) {
122
- const { aptosConfig, accountAddress, moduleName, options } = args;
123
- const { data } = await getAptosFullNode({
124
- aptosConfig,
125
- originMethod: "getModule",
126
- path: `accounts/${AccountAddress.from(accountAddress).toString()}/module/${moduleName}`,
127
- params: { ledger_version: options?.ledgerVersion }
128
- });
129
- return data;
120
+ async function getModule2(args) {
121
+ return getModule(args);
130
122
  }
131
123
  async function getTransactions(args) {
132
124
  const { aptosConfig, accountAddress, options } = args;
@@ -439,7 +431,7 @@ async function isAccountExist(args) {
439
431
  authenticationKey: authKey.derivedAddress()
440
432
  });
441
433
  try {
442
- await getInfo({
434
+ await getInfo2({
443
435
  aptosConfig,
444
436
  accountAddress
445
437
  });
@@ -451,6 +443,137 @@ async function isAccountExist(args) {
451
443
  throw new Error(`Error while looking for an account info ${accountAddress.toString()}`);
452
444
  }
453
445
  }
446
+ var rotateAuthKeyAbi = {
447
+ typeParameters: [],
448
+ parameters: [
449
+ new TypeTagU8(),
450
+ TypeTagVector.u8(),
451
+ new TypeTagU8(),
452
+ TypeTagVector.u8(),
453
+ TypeTagVector.u8(),
454
+ TypeTagVector.u8()
455
+ ]
456
+ };
457
+ async function rotateAuthKey(args) {
458
+ const { aptosConfig, fromAccount, dangerouslySkipVerification } = args;
459
+ if ("toNewPrivateKey" in args) {
460
+ return rotateAuthKeyWithChallenge({
461
+ aptosConfig,
462
+ fromAccount,
463
+ toNewPrivateKey: args.toNewPrivateKey
464
+ });
465
+ }
466
+ let authKey;
467
+ if ("toAccount" in args) {
468
+ if (args.toAccount instanceof Ed25519Account) {
469
+ return rotateAuthKeyWithChallenge({ aptosConfig, fromAccount, toNewPrivateKey: args.toAccount.privateKey });
470
+ }
471
+ if (args.toAccount instanceof MultiEd25519Account) {
472
+ return rotateAuthKeyWithChallenge({ aptosConfig, fromAccount, toAccount: args.toAccount });
473
+ }
474
+ authKey = args.toAccount.publicKey.authKey();
475
+ } else if ("toAuthKey" in args) {
476
+ authKey = args.toAuthKey;
477
+ } else {
478
+ throw new Error("Invalid arguments");
479
+ }
480
+ const pendingTxn = await rotateAuthKeyUnverified({
481
+ aptosConfig,
482
+ fromAccount,
483
+ toAuthKey: authKey
484
+ });
485
+ if (dangerouslySkipVerification === true) {
486
+ return pendingTxn;
487
+ }
488
+ const rotateAuthKeyTxnResponse = await waitForTransaction({
489
+ aptosConfig,
490
+ transactionHash: pendingTxn.hash
491
+ });
492
+ if (!rotateAuthKeyTxnResponse.success) {
493
+ throw new Error(`Failed to rotate authentication key - ${rotateAuthKeyTxnResponse}`);
494
+ }
495
+ const verificationTxn = await generateTransaction({
496
+ aptosConfig,
497
+ sender: fromAccount.accountAddress,
498
+ data: {
499
+ function: "0x1::account::set_originating_address",
500
+ functionArguments: []
501
+ }
502
+ });
503
+ return signAndSubmitTransaction({
504
+ aptosConfig,
505
+ signer: args.toAccount,
506
+ // Use the new account to sign
507
+ transaction: verificationTxn
508
+ });
509
+ }
510
+ async function rotateAuthKeyWithChallenge(args) {
511
+ const { aptosConfig, fromAccount } = args;
512
+ const accountInfo = await getInfo2({
513
+ aptosConfig,
514
+ accountAddress: fromAccount.accountAddress
515
+ });
516
+ let newAccount;
517
+ if ("toNewPrivateKey" in args) {
518
+ newAccount = Account.fromPrivateKey({ privateKey: args.toNewPrivateKey, legacy: true });
519
+ } else {
520
+ newAccount = args.toAccount;
521
+ }
522
+ const challenge = new RotationProofChallenge({
523
+ sequenceNumber: BigInt(accountInfo.sequence_number),
524
+ originator: fromAccount.accountAddress,
525
+ currentAuthKey: AccountAddress.from(accountInfo.authentication_key),
526
+ newPublicKey: newAccount.publicKey
527
+ });
528
+ const challengeHex = challenge.bcsToBytes();
529
+ const proofSignedByCurrentKey = fromAccount.sign(challengeHex);
530
+ const proofSignedByNewKey = newAccount.sign(challengeHex);
531
+ const rawTxn = await generateTransaction({
532
+ aptosConfig,
533
+ sender: fromAccount.accountAddress,
534
+ data: {
535
+ function: "0x1::account::rotate_authentication_key",
536
+ functionArguments: [
537
+ new U8(fromAccount.signingScheme),
538
+ // from scheme
539
+ MoveVector.U8(fromAccount.publicKey.toUint8Array()),
540
+ new U8(newAccount.signingScheme),
541
+ // to scheme
542
+ MoveVector.U8(newAccount.publicKey.toUint8Array()),
543
+ MoveVector.U8(proofSignedByCurrentKey.toUint8Array()),
544
+ MoveVector.U8(proofSignedByNewKey.toUint8Array())
545
+ ],
546
+ abi: rotateAuthKeyAbi
547
+ }
548
+ });
549
+ return signAndSubmitTransaction({
550
+ aptosConfig,
551
+ signer: fromAccount,
552
+ transaction: rawTxn
553
+ });
554
+ }
555
+ var rotateAuthKeyUnverifiedAbi = {
556
+ typeParameters: [],
557
+ parameters: [TypeTagVector.u8()]
558
+ };
559
+ async function rotateAuthKeyUnverified(args) {
560
+ const { aptosConfig, fromAccount, toAuthKey } = args;
561
+ const authKey = toAuthKey;
562
+ const rawTxn = await generateTransaction({
563
+ aptosConfig,
564
+ sender: fromAccount.accountAddress,
565
+ data: {
566
+ function: "0x1::account::rotate_authentication_key_call",
567
+ functionArguments: [MoveVector.U8(authKey.toUint8Array())],
568
+ abi: rotateAuthKeyUnverifiedAbi
569
+ }
570
+ });
571
+ return signAndSubmitTransaction({
572
+ aptosConfig,
573
+ signer: fromAccount,
574
+ transaction: rawTxn
575
+ });
576
+ }
454
577
  async function getMultiKeysForAuthenticationKeys(args) {
455
578
  const { aptosConfig, authKeys } = args;
456
579
  if (authKeys.length === 0) {
@@ -573,7 +696,7 @@ async function getLastestTransactionVersionForAddress(args) {
573
696
  originMethod: "getSignatures"
574
697
  });
575
698
  if (data.length !== 1) {
576
- throw new Error(`Expected 1 account address for address ${address}, got ${data.length}`);
699
+ throw new Error(`No signatures found for address ${address}`);
577
700
  }
578
701
  return Number(data[0].transaction_version);
579
702
  }
@@ -647,7 +770,7 @@ async function getAccountsForPublicKey(args) {
647
770
  }
648
771
  async function getPublicKeyFromAccountAddress(args) {
649
772
  const { aptosConfig, accountAddress } = args;
650
- const accountData = await getInfo({ aptosConfig, accountAddress });
773
+ const accountData = await getInfo2({ aptosConfig, accountAddress });
651
774
  const lastTransactionVersion = await getLastestTransactionVersionForAddress({
652
775
  aptosConfig,
653
776
  accountAddress
@@ -716,9 +839,9 @@ function parsePublicKey(data) {
716
839
  }
717
840
 
718
841
  export {
719
- getInfo,
720
- getModules,
721
- getModule,
842
+ getInfo2 as getInfo,
843
+ getModules2 as getModules,
844
+ getModule2 as getModule,
722
845
  getTransactions,
723
846
  getResources,
724
847
  getResource,
@@ -734,8 +857,9 @@ export {
734
857
  getAccountOwnedObjects,
735
858
  deriveAccountFromPrivateKey,
736
859
  isAccountExist,
860
+ rotateAuthKey,
737
861
  getAccountsForPublicKey,
738
862
  getPublicKeyFromAccountAddress,
739
863
  getMultiKeyFromAuthenticationKey
740
864
  };
741
- //# sourceMappingURL=chunk-YGFWUFZY.mjs.map
865
+ //# sourceMappingURL=chunk-SPVJXZL5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/account}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * account namespace and without having a dependency cycle error.\n * @group Implementation\n */\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { getAptosFullNode, paginateWithCursor, paginateWithObfuscatedCursor } from \"../client\";\nimport {\n AccountData,\n AnyPublicKeyVariant,\n GetAccountCoinsDataResponse,\n GetAccountCollectionsWithOwnedTokenResponse,\n GetAccountOwnedTokensFromCollectionResponse,\n GetAccountOwnedTokensQueryResponse,\n GetMultiKeyForAuthKeyResponse,\n GetObjectDataQueryResponse,\n isEd25519Signature,\n isMultiEd25519Signature,\n isSingleSenderMultiKeySignature,\n isSingleSenderSingleKeySignature,\n isUserTransactionResponse,\n LedgerVersionArg,\n MoveModuleBytecode,\n MoveResource,\n MoveStructId,\n OrderByArg,\n PaginationArgs,\n PendingTransactionResponse,\n TokenStandardArg,\n TransactionResponse,\n WhereArg,\n} from \"../types\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { Account, Ed25519Account, MultiEd25519Account } from \"../account\";\nimport {\n AbstractMultiKey,\n AccountPublicKey,\n AnyPublicKey,\n Ed25519PublicKey,\n FederatedKeylessPublicKey,\n KeylessPublicKey,\n MultiEd25519PublicKey,\n MultiKey,\n PrivateKey,\n PublicKey,\n Secp256k1PublicKey,\n} from \"../core/crypto\";\nimport { queryIndexer } from \"./general\";\nimport { getModules as getModulesUtil, getModule as getModuleUtil, getInfo as getInfoUtil } from \"./utils\";\nimport {\n GetAccountCoinsCountQuery,\n GetAccountCoinsDataQuery,\n GetAccountCollectionsWithOwnedTokensQuery,\n GetObjectDataQuery,\n GetAccountOwnedTokensFromCollectionQuery,\n GetAccountOwnedTokensQuery,\n GetAccountTokensCountQuery,\n GetAccountTransactionsCountQuery,\n GetMultiKeyForAuthKeyQuery,\n GetAuthKeysForPublicKeyQuery,\n GetAccountAddressesForAuthKeyQuery,\n GetSignaturesQuery,\n} from \"../types/generated/operations\";\nimport {\n GetAccountCoinsCount,\n GetAccountCoinsData,\n GetAccountCollectionsWithOwnedTokens,\n GetObjectData,\n GetAccountOwnedTokens,\n GetAccountOwnedTokensFromCollection,\n GetAccountTokensCount,\n GetAccountTransactionsCount,\n GetMultiKeyForAuthKey,\n GetAuthKeysForPublicKey,\n GetAccountAddressesForAuthKey,\n GetSignatures,\n} from \"../types/generated/queries\";\nimport { Secp256k1PrivateKey, AuthenticationKey, Ed25519PrivateKey, createObjectAddress, Hex } from \"../core\";\nimport { CurrentFungibleAssetBalancesBoolExp } from \"../types/generated/types\";\nimport { getTableItem } from \"./table\";\nimport { APTOS_COIN } from \"../utils\";\nimport { AptosApiError } from \"../errors\";\nimport { Deserializer } from \"../bcs\";\nimport { getTransactionByVersion } from \"./transaction\";\nimport { signAndSubmitTransaction, generateTransaction } from \"./transactionSubmission\";\nimport { EntryFunctionABI, RotationProofChallenge, TypeTagU8, TypeTagVector } from \"../transactions\";\nimport { U8, MoveVector } from \"../bcs\";\nimport { waitForTransaction } from \"./transaction\";\nimport { deriveKeylessAccount, DeriveKeylessAccountParams } from \"./keyless\";\n\n/**\n * Retrieves account information for a specified account address.\n *\n * @param args - The arguments for retrieving account information.\n * @param args.aptosConfig - The configuration object for Aptos.\n * @param args.accountAddress - The address of the account to retrieve information for.\n * @group Implementation\n */\nexport async function getInfo(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<AccountData> {\n return getInfoUtil(args);\n}\n\n/**\n * Retrieves the modules associated with a specified account address.\n *\n * @param args - The arguments for retrieving modules.\n * @param args.aptosConfig - The configuration for connecting to the Aptos blockchain.\n * @param args.accountAddress - The address of the account whose modules are to be retrieved.\n * @param args.options - Optional parameters for pagination and ledger version.\n * @param args.options.limit - The maximum number of modules to retrieve (default is 1000).\n * @param args.options.offset - The starting point for pagination. Note, this is obfuscated and is not an index.\n * @param args.options.ledgerVersion - The specific ledger version to query.\n * @group Implementation\n */\nexport async function getModules(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n}): Promise<MoveModuleBytecode[]> {\n return getModulesUtil(args);\n}\n\n/**\n * Queries for a move module given an account address and module name.\n * This function can help you retrieve the module's ABI and other relevant information.\n *\n * @param args - The arguments for retrieving the module.\n * @param args.aptosConfig - The configuration for the Aptos client.\n * @param args.accountAddress - The account address in hex-encoded 32 byte format.\n * @param args.moduleName - The name of the module to retrieve.\n * @param args.options - Optional parameters for the request.\n * @param args.options.ledgerVersion - Specifies the ledger version of transactions. By default, the latest version will be used.\n * @returns The move module.\n * @group Implementation\n */\nexport async function getModule(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersionArg;\n}): Promise<MoveModuleBytecode> {\n return getModuleUtil(args);\n}\n\n/**\n * Retrieves a list of transactions associated with a specific account address.\n * This function allows you to paginate through the transactions for better performance and usability.\n *\n * @param args - The arguments for retrieving transactions.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.accountAddress - The account address for which to retrieve transactions.\n * @param args.options - Optional pagination parameters.\n * @param args.options.offset - The starting point for pagination.\n * @param args.options.limit - The maximum number of transactions to retrieve.\n * @group Implementation\n */\nexport async function getTransactions(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs;\n}): Promise<TransactionResponse[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithCursor<{}, TransactionResponse[]>({\n aptosConfig,\n originMethod: \"getTransactions\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/transactions`,\n params: { start: options?.offset, limit: options?.limit },\n });\n}\n\n/**\n * Retrieves a list of resources associated with a specific account address.\n *\n * @param args - The arguments for retrieving resources.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.accountAddress - The address of the account to fetch resources for.\n * @param args.options - Optional pagination and ledger version parameters.\n * @param args.options.offset - The starting point for pagination. Note, this is obfuscated and is not an index.\n * @param args.options.limit - The maximum number of resources to retrieve (default is 999).\n * @param args.options.ledgerVersion - The specific ledger version to query.\n * @group Implementation\n */\nexport async function getResources(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n}): Promise<MoveResource[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithObfuscatedCursor<{}, MoveResource[]>({\n aptosConfig,\n originMethod: \"getResources\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/resources`,\n params: {\n ledger_version: options?.ledgerVersion,\n offset: options?.offset,\n limit: options?.limit ?? 999,\n },\n });\n}\n\n/**\n * Retrieves a specific resource of a given type for the specified account address.\n *\n * @param args - The arguments for retrieving the resource.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.accountAddress - The address of the account from which to retrieve the resource.\n * @param args.resourceType - The type of the resource to retrieve, specified as a MoveStructId.\n * @param args.options - Optional parameters for specifying the ledger version.\n * @group Implementation\n */\nexport async function getResource<T extends {}>(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n resourceType: MoveStructId;\n options?: LedgerVersionArg;\n}): Promise<T> {\n const { aptosConfig, accountAddress, resourceType, options } = args;\n const { data } = await getAptosFullNode<{}, MoveResource>({\n aptosConfig,\n originMethod: \"getResource\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/resource/${resourceType}`,\n params: { ledger_version: options?.ledgerVersion },\n });\n return data.data as T;\n}\n\n/**\n * Retrieves the original account address associated with a given authentication key, which is useful for handling key rotations.\n *\n * @param args - The arguments for the lookup.\n * @param args.aptosConfig - The configuration for the Aptos client.\n * @param args.authenticationKey - The authentication key for which to look up the original address.\n * @param args.options - Optional parameters for specifying the ledger version.\n * @returns The original account address or the provided authentication key address if not found.\n * @throws Throws an error if the lookup fails for reasons other than the address not being found.\n * @group Implementation\n */\nexport async function lookupOriginalAccountAddress(args: {\n aptosConfig: AptosConfig;\n authenticationKey: AccountAddressInput;\n options?: LedgerVersionArg;\n}): Promise<AccountAddress> {\n const { aptosConfig, authenticationKey, options } = args;\n type OriginatingAddress = {\n address_map: { handle: string };\n };\n const resource = await getResource<OriginatingAddress>({\n aptosConfig,\n accountAddress: \"0x1\",\n resourceType: \"0x1::account::OriginatingAddress\",\n options,\n });\n\n const {\n address_map: { handle },\n } = resource;\n\n const authKeyAddress = AccountAddress.from(authenticationKey);\n\n // If the address is not found in the address map, which means its not rotated\n // then return the address as is\n try {\n const originalAddress = await getTableItem<string>({\n aptosConfig,\n handle,\n data: {\n key: authKeyAddress.toString(),\n key_type: \"address\",\n value_type: \"address\",\n },\n options,\n });\n\n return AccountAddress.from(originalAddress);\n } catch (err) {\n if (err instanceof AptosApiError && err.data.error_code === \"table_item_not_found\") {\n return authKeyAddress;\n }\n\n throw err;\n }\n}\n\n/**\n * Retrieves the count of tokens owned by a specific account address.\n *\n * @param args - The arguments for retrieving the account tokens count.\n * @param args.aptosConfig - The configuration settings for the Aptos network.\n * @param args.accountAddress - The address of the account for which to count the tokens.\n * @returns The count of tokens owned by the specified account.\n * @group Implementation\n */\nexport async function getAccountTokensCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string }; amount: { _gt: number } } = {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n const graphqlQuery = {\n query: GetAccountTokensCount,\n variables: { where_condition: whereCondition },\n };\n\n const data = await queryIndexer<GetAccountTokensCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountTokensCount\",\n });\n\n // commonjs (aka cjs) doesn't handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data.current_token_ownerships_v2_aggregate.aggregate\n ? data.current_token_ownerships_v2_aggregate.aggregate.count\n : 0;\n}\n\n/**\n * Retrieves the tokens owned by a specified account address.\n *\n * @param args - The arguments for retrieving the account's tokens.\n * @param args.aptosConfig - The configuration for the Aptos client.\n * @param args.accountAddress - The address of the account whose tokens are being queried.\n * @param args.options - Optional parameters for filtering and pagination.\n * @param args.options.tokenStandard - The specific token standard to filter the results.\n * @param args.options.offset - The number of records to skip before starting to collect the result set.\n * @param args.options.limit - The maximum number of records to return.\n * @param args.options.orderBy - The criteria for ordering the results.\n * @returns A promise that resolves to the current token ownerships of the specified account.\n * @group Implementation\n */\nexport async function getAccountOwnedTokens(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensQueryResponse[0]>;\n}): Promise<GetAccountOwnedTokensQueryResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string }; amount: { _gt: number }; token_standard?: { _eq: string } } =\n {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.token_standard = { _eq: options?.tokenStandard };\n }\n\n const graphqlQuery = {\n query: GetAccountOwnedTokens,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountOwnedTokensQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedTokens\",\n });\n\n return data.current_token_ownerships_v2;\n}\n\n/**\n * Retrieves the tokens owned by a specific account from a particular collection address.\n *\n * @param args - The parameters required to fetch the owned tokens.\n * @param args.aptosConfig - The Aptos configuration object.\n * @param args.accountAddress - The address of the account whose tokens are being queried.\n * @param args.collectionAddress - The address of the collection from which tokens are being retrieved.\n * @param args.options - Optional parameters for filtering and pagination, including token standard, pagination arguments, and\n * order by options.\n * @group Implementation\n */\nexport async function getAccountOwnedTokensFromCollectionAddress(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n collectionAddress: AccountAddressInput;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensFromCollectionResponse[0]>;\n}): Promise<GetAccountOwnedTokensFromCollectionResponse> {\n const { aptosConfig, accountAddress, collectionAddress, options } = args;\n const ownerAddress = AccountAddress.from(accountAddress).toStringLong();\n const collAddress = AccountAddress.from(collectionAddress).toStringLong();\n\n const whereCondition: {\n owner_address: { _eq: string };\n current_token_data: { collection_id: { _eq: string } };\n amount: { _gt: number };\n token_standard?: { _eq: string };\n } = {\n owner_address: { _eq: ownerAddress },\n current_token_data: { collection_id: { _eq: collAddress } },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.token_standard = { _eq: options?.tokenStandard };\n }\n\n const graphqlQuery = {\n query: GetAccountOwnedTokensFromCollection,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountOwnedTokensFromCollectionQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedTokensFromCollectionAddress\",\n });\n\n return data.current_token_ownerships_v2;\n}\n\n/**\n * Retrieves the collections owned by a specified account along with the tokens in those collections.\n *\n * @param args - The arguments for the function.\n * @param args.aptosConfig - The configuration for the Aptos client.\n * @param args.accountAddress - The address of the account whose collections are being queried.\n * @param args.options - Optional parameters for filtering and pagination.\n * @param args.options.tokenStandard - An optional token standard to filter the collections.\n * @param args.options.offset - An optional offset for pagination.\n * @param args.options.limit - An optional limit for the number of results returned.\n * @param args.options.orderBy - An optional parameter to specify the order of the results.\n * @group Implementation\n */\nexport async function getAccountCollectionsWithOwnedTokens(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountCollectionsWithOwnedTokenResponse[0]>;\n}): Promise<GetAccountCollectionsWithOwnedTokenResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: {\n owner_address: { _eq: string };\n current_collection?: { token_standard: { _eq: string } };\n } = {\n owner_address: { _eq: address },\n };\n\n if (options?.tokenStandard) {\n whereCondition.current_collection = {\n token_standard: { _eq: options?.tokenStandard },\n };\n }\n\n const graphqlQuery = {\n query: GetAccountCollectionsWithOwnedTokens,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountCollectionsWithOwnedTokensQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCollectionsWithOwnedTokens\",\n });\n\n return data.current_collection_ownership_v2_view;\n}\n\n/**\n * Retrieves the count of transactions associated with a specified account.\n *\n * @param args - The arguments for the function.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.accountAddress - The address of the account for which to retrieve the transaction count.\n * @returns The number of transactions associated with the specified account.\n * @group Implementation\n */\nexport async function getAccountTransactionsCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const graphqlQuery = {\n query: GetAccountTransactionsCount,\n variables: { address },\n };\n\n const data = await queryIndexer<GetAccountTransactionsCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountTransactionsCount\",\n });\n\n // commonjs (aka cjs) doesn't handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data.account_transactions_aggregate.aggregate ? data.account_transactions_aggregate.aggregate.count : 0;\n}\n\n/**\n * Retrieves the amount of a specific coin held by an account.\n *\n * @param args - The parameters for the request.\n * @param args.aptosConfig - The Aptos configuration object.\n * @param args.accountAddress - The address of the account to query.\n * @param args.coinType - Optional; the type of coin to check the amount for.\n * @param args.faMetadataAddress - Optional; the address of the fungible asset metadata.\n * @returns The amount of the specified coin held by the account, or 0 if none is found.\n * @throws Error if neither coinType nor faMetadataAddress is provided.\n * @group Implementation\n */\nexport async function getAccountCoinAmount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n coinType?: MoveStructId;\n faMetadataAddress?: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress, coinType, faMetadataAddress } = args;\n\n let coinAssetType: string | undefined = coinType;\n let faAddress: string;\n\n if (coinType !== undefined && faMetadataAddress !== undefined) {\n faAddress = AccountAddress.from(faMetadataAddress).toStringLong();\n } else if (coinType !== undefined && faMetadataAddress === undefined) {\n // TODO Move to a separate function as defined in the AIP for coin migration\n if (coinType === APTOS_COIN) {\n faAddress = AccountAddress.A.toStringLong();\n } else {\n faAddress = createObjectAddress(AccountAddress.A, coinType).toStringLong();\n }\n } else if (coinType === undefined && faMetadataAddress !== undefined) {\n const addr = AccountAddress.from(faMetadataAddress);\n faAddress = addr.toStringLong();\n if (addr === AccountAddress.A) {\n coinAssetType = APTOS_COIN;\n }\n // The paired CoinType should be populated outside of this function in another\n // async call. We cannot do this internally due to dependency cycles issue.\n } else {\n throw new Error(\"Either coinType, fungibleAssetAddress, or both must be provided\");\n }\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n // Search by fungible asset address, unless it has a coin it migrated from\n let where: any = { asset_type: { _eq: faAddress } };\n if (coinAssetType !== undefined) {\n where = { asset_type: { _in: [coinAssetType, faAddress] } };\n }\n\n const data = await getAccountCoinsData({\n aptosConfig,\n accountAddress: address,\n options: {\n where,\n },\n });\n\n // commonjs (aka cjs) doesn't handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data[0] ? data[0].amount : 0;\n}\n\n/**\n * Retrieves the current fungible asset balances for a specified account.\n *\n * @param args - The arguments for retrieving account coins data.\n * @param args.aptosConfig - The configuration for connecting to the Aptos network.\n * @param args.accountAddress - The address of the account for which to retrieve coin data.\n * @param args.options - Optional parameters for pagination and filtering the results.\n * @param args.options.offset - The number of items to skip before starting to collect the result set.\n * @param args.options.limit - The maximum number of items to return.\n * @param args.options.orderBy - The criteria for ordering the results.\n * @param args.options.where - Conditions to filter the results based on the current fungible asset balances.\n * @group Implementation\n */\nexport async function getAccountCoinsData(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & OrderByArg<GetAccountCoinsDataResponse[0]> & WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n}): Promise<GetAccountCoinsDataResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string } } = {\n ...options?.where,\n owner_address: { _eq: address },\n };\n\n const graphqlQuery = {\n query: GetAccountCoinsData,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountCoinsDataQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCoinsData\",\n });\n\n return data.current_fungible_asset_balances;\n}\n\n/**\n * Retrieves the count of fungible asset coins held by a specified account.\n *\n * @param args - The arguments for the function.\n * @param args.aptosConfig - The configuration settings for the Aptos network.\n * @param args.accountAddress - The address of the account for which to retrieve the coin count.\n * @throws Error if the count of account coins cannot be retrieved.\n * @group Implementation\n */\nexport async function getAccountCoinsCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const graphqlQuery = {\n query: GetAccountCoinsCount,\n variables: { address },\n };\n\n const data = await queryIndexer<GetAccountCoinsCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCoinsCount\",\n });\n\n if (!data.current_fungible_asset_balances_aggregate.aggregate) {\n throw Error(\"Failed to get the count of account coins\");\n }\n\n return data.current_fungible_asset_balances_aggregate.aggregate.count;\n}\n\n/**\n * Retrieves the objects owned by a specified account.\n *\n * @param args - The parameters for the request.\n * @param args.aptosConfig - The configuration for the Aptos client.\n * @param args.accountAddress - The address of the account whose owned objects are to be retrieved.\n * @param args.options - Optional parameters for pagination and ordering of the results.\n * @param args.options.offset - The number of items to skip before starting to collect the result set.\n * @param args.options.limit - The maximum number of items to return.\n * @param args.options.orderBy - The criteria to order the results by.\n * @returns A promise that resolves to the current objects owned by the specified account.\n * @group Implementation\n */\nexport async function getAccountOwnedObjects(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & OrderByArg<GetObjectDataQueryResponse[0]>;\n}): Promise<GetObjectDataQueryResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string } } = {\n owner_address: { _eq: address },\n };\n const graphqlQuery = {\n query: GetObjectData,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n const data = await queryIndexer<GetObjectDataQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedObjects\",\n });\n\n return data.current_objects;\n}\n\n/**\n * Derives an account from the provided private key and Aptos configuration.\n * This function helps in obtaining the account details associated with a given private key,\n * considering both unified and legacy authentication schemes.\n *\n * NOTE: There is a potential issue once the unified single signer scheme is adopted by the community.\n * Because one could create two accounts with the same private key with this new authenticator type,\n * we’ll need to determine the order in which we look up the accounts: first unified scheme and then legacy scheme,\n * or first legacy scheme and then unified scheme.\n *\n * @param args - The arguments for deriving the account.\n * @param args.aptosConfig - The Aptos configuration used for account lookup.\n * @param args.privateKey - The private key used to derive the account.\n * @throws Error if the account cannot be derived from the private key.\n * @group Implementation\n */\nexport async function deriveAccountFromPrivateKey(args: {\n aptosConfig: AptosConfig;\n privateKey: PrivateKey;\n}): Promise<Account> {\n const { aptosConfig, privateKey } = args;\n const publicKey = new AnyPublicKey(privateKey.publicKey());\n\n if (privateKey instanceof Secp256k1PrivateKey) {\n // private key is secp256k1, therefore we know it for sure uses a single signer key\n const authKey = AuthenticationKey.fromPublicKey({ publicKey });\n const address = authKey.derivedAddress();\n return Account.fromPrivateKey({ privateKey, address });\n }\n\n if (privateKey instanceof Ed25519PrivateKey) {\n // lookup single sender ed25519\n const singleSenderTransactionAuthenticatorAuthKey = AuthenticationKey.fromPublicKey({\n publicKey,\n });\n const isSingleSenderTransactionAuthenticator = await isAccountExist({\n authKey: singleSenderTransactionAuthenticatorAuthKey,\n aptosConfig,\n });\n if (isSingleSenderTransactionAuthenticator) {\n const address = singleSenderTransactionAuthenticatorAuthKey.derivedAddress();\n return Account.fromPrivateKey({ privateKey, address, legacy: false });\n }\n // lookup legacy ed25519\n const legacyAuthKey = AuthenticationKey.fromPublicKey({\n publicKey: publicKey.publicKey as Ed25519PublicKey,\n });\n const isLegacyEd25519 = await isAccountExist({ authKey: legacyAuthKey, aptosConfig });\n if (isLegacyEd25519) {\n const address = legacyAuthKey.derivedAddress();\n return Account.fromPrivateKey({ privateKey, address, legacy: true });\n }\n }\n // if we are here, it means we couldn't find an address with an\n // auth key that matches the provided private key\n throw new Error(`Can't derive account from private key ${privateKey}`);\n}\n\n/**\n * Checks if an account exists by verifying its information against the Aptos blockchain.\n *\n * @param args - The arguments for the function.\n * @param args.aptosConfig - The configuration for connecting to the Aptos blockchain.\n * @param args.authKey - The authentication key used to derive the account address.\n * @returns A promise that resolves to a boolean indicating whether the account exists.\n *\n * @throws Throws an Error if there is an issue while looking for account information.\n * @group Implementation\n */\nexport async function isAccountExist(args: { aptosConfig: AptosConfig; authKey: AuthenticationKey }): Promise<boolean> {\n const { aptosConfig, authKey } = args;\n const accountAddress = await lookupOriginalAccountAddress({\n aptosConfig,\n authenticationKey: authKey.derivedAddress(),\n });\n\n try {\n await getInfo({\n aptosConfig,\n accountAddress,\n });\n return true;\n } catch (error: any) {\n // account not found\n if (error.status === 404) {\n return false;\n }\n throw new Error(`Error while looking for an account info ${accountAddress.toString()}`);\n }\n}\n\nconst rotateAuthKeyAbi: EntryFunctionABI = {\n typeParameters: [],\n parameters: [\n new TypeTagU8(),\n TypeTagVector.u8(),\n new TypeTagU8(),\n TypeTagVector.u8(),\n TypeTagVector.u8(),\n TypeTagVector.u8(),\n ],\n};\n\n/**\n * Rotates the authentication key for a given account.\n *\n * @param args - The arguments for rotating the authentication key.\n * @param args.aptosConfig - The configuration settings for the Aptos network.\n * @param args.fromAccount - The account from which the authentication key will be rotated.\n * @param args.toAccount - (Optional) The target account to rotate to. Required if not using toNewPrivateKey or toAuthKey.\n * @param args.toNewPrivateKey - (Optional) The new private key to rotate to. Required if not using toAccount or toAuthKey.\n * @param args.toAuthKey - (Optional) The new authentication key to rotate to. Can only be used with dangerouslySkipVerification=true.\n * @param args.dangerouslySkipVerification - (Optional) If true, skips verification steps after rotation. Required when using toAuthKey.\n *\n * @remarks\n * This function supports three modes of rotation:\n * 1. Using a target Account object (toAccount)\n * 2. Using a new private key (toNewPrivateKey)\n * 3. Using a raw authentication key (toAuthKey) - requires dangerouslySkipVerification=true\n *\n * When not using dangerouslySkipVerification, the function performs additional safety checks and account setup.\n *\n * If the new key is a multi key, skipping verification is dangerous because verification will publish the public key onchain and\n * prevent users from being locked out of the account from loss of knowledge of one of the public keys.\n *\n * @returns A promise that resolves to the pending transaction response.\n * @throws Error if the rotation fails or verification fails.\n *\n * @group Implementation\n */\nexport async function rotateAuthKey(\n args: {\n aptosConfig: AptosConfig;\n fromAccount: Account;\n } & (\n | { toAccount: Account; dangerouslySkipVerification?: never }\n | { toNewPrivateKey: Ed25519PrivateKey; dangerouslySkipVerification?: never }\n | { toAuthKey: AuthenticationKey; dangerouslySkipVerification: true }\n ),\n): Promise<PendingTransactionResponse> {\n const { aptosConfig, fromAccount, dangerouslySkipVerification } = args;\n if (\"toNewPrivateKey\" in args) {\n return rotateAuthKeyWithChallenge({\n aptosConfig,\n fromAccount,\n toNewPrivateKey: args.toNewPrivateKey,\n });\n }\n let authKey: AuthenticationKey;\n if (\"toAccount\" in args) {\n if (args.toAccount instanceof Ed25519Account) {\n return rotateAuthKeyWithChallenge({ aptosConfig, fromAccount, toNewPrivateKey: args.toAccount.privateKey });\n }\n if (args.toAccount instanceof MultiEd25519Account) {\n return rotateAuthKeyWithChallenge({ aptosConfig, fromAccount, toAccount: args.toAccount });\n }\n authKey = args.toAccount.publicKey.authKey();\n } else if (\"toAuthKey\" in args) {\n authKey = args.toAuthKey;\n } else {\n throw new Error(\"Invalid arguments\");\n }\n\n const pendingTxn = await rotateAuthKeyUnverified({\n aptosConfig,\n fromAccount,\n toAuthKey: authKey,\n });\n\n if (dangerouslySkipVerification === true) {\n return pendingTxn;\n }\n\n const rotateAuthKeyTxnResponse = await waitForTransaction({\n aptosConfig,\n transactionHash: pendingTxn.hash,\n });\n if (!rotateAuthKeyTxnResponse.success) {\n throw new Error(`Failed to rotate authentication key - ${rotateAuthKeyTxnResponse}`);\n }\n\n // Verify the rotation by setting the originating address to the new account.\n // This verifies the rotation even if the transaction payload fails to execute successfully.\n const verificationTxn = await generateTransaction({\n aptosConfig,\n sender: fromAccount.accountAddress,\n data: {\n function: \"0x1::account::set_originating_address\",\n functionArguments: [],\n },\n });\n\n return signAndSubmitTransaction({\n aptosConfig,\n signer: args.toAccount, // Use the new account to sign\n transaction: verificationTxn,\n });\n}\n\nasync function rotateAuthKeyWithChallenge(\n args: {\n aptosConfig: AptosConfig;\n fromAccount: Account;\n } & ({ toNewPrivateKey: Ed25519PrivateKey } | { toAccount: MultiEd25519Account }),\n): Promise<PendingTransactionResponse> {\n const { aptosConfig, fromAccount } = args;\n const accountInfo = await getInfo({\n aptosConfig,\n accountAddress: fromAccount.accountAddress,\n });\n\n let newAccount: Account;\n if (\"toNewPrivateKey\" in args) {\n newAccount = Account.fromPrivateKey({ privateKey: args.toNewPrivateKey, legacy: true });\n } else {\n newAccount = args.toAccount;\n }\n\n const challenge = new RotationProofChallenge({\n sequenceNumber: BigInt(accountInfo.sequence_number),\n originator: fromAccount.accountAddress,\n currentAuthKey: AccountAddress.from(accountInfo.authentication_key),\n newPublicKey: newAccount.publicKey,\n });\n\n // Sign the challenge\n const challengeHex = challenge.bcsToBytes();\n const proofSignedByCurrentKey = fromAccount.sign(challengeHex);\n const proofSignedByNewKey = newAccount.sign(challengeHex);\n\n // Generate transaction\n const rawTxn = await generateTransaction({\n aptosConfig,\n sender: fromAccount.accountAddress,\n data: {\n function: \"0x1::account::rotate_authentication_key\",\n functionArguments: [\n new U8(fromAccount.signingScheme), // from scheme\n MoveVector.U8(fromAccount.publicKey.toUint8Array()),\n new U8(newAccount.signingScheme), // to scheme\n MoveVector.U8(newAccount.publicKey.toUint8Array()),\n MoveVector.U8(proofSignedByCurrentKey.toUint8Array()),\n MoveVector.U8(proofSignedByNewKey.toUint8Array()),\n ],\n abi: rotateAuthKeyAbi,\n },\n });\n return signAndSubmitTransaction({\n aptosConfig,\n signer: fromAccount,\n transaction: rawTxn,\n });\n}\n\nconst rotateAuthKeyUnverifiedAbi: EntryFunctionABI = {\n typeParameters: [],\n parameters: [TypeTagVector.u8()],\n};\n\nasync function rotateAuthKeyUnverified(args: {\n aptosConfig: AptosConfig;\n fromAccount: Account;\n toAuthKey: AuthenticationKey;\n}): Promise<PendingTransactionResponse> {\n const { aptosConfig, fromAccount, toAuthKey } = args;\n const authKey = toAuthKey;\n const rawTxn = await generateTransaction({\n aptosConfig,\n sender: fromAccount.accountAddress,\n data: {\n function: \"0x1::account::rotate_authentication_key_call\",\n functionArguments: [MoveVector.U8(authKey.toUint8Array())],\n abi: rotateAuthKeyUnverifiedAbi,\n },\n });\n return signAndSubmitTransaction({\n aptosConfig,\n signer: fromAccount,\n transaction: rawTxn,\n });\n}\n\nasync function getMultiKeysForAuthenticationKeys(args: {\n aptosConfig: AptosConfig;\n authKeys: AuthenticationKey[];\n}): Promise<{ authKey: AuthenticationKey; publicKey: MultiKey | MultiEd25519PublicKey }[]> {\n const { aptosConfig, authKeys } = args;\n if (authKeys.length === 0) {\n throw new Error(\"No authentication keys provided\");\n }\n\n const whereCondition: { auth_key: { _in: string[] } } = {\n auth_key: { _in: authKeys.map((authKey) => authKey.toString()) },\n };\n\n const graphqlQuery = {\n query: GetMultiKeyForAuthKey,\n variables: {\n where_condition: whereCondition,\n },\n };\n const { auth_key_multikey_layout: data } = await queryIndexer<GetMultiKeyForAuthKeyQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getMultiKeysForAuthenticationKeys\",\n });\n\n const authKeyToMultiKey = new Map(data.map((entry) => [entry.auth_key, entry]));\n\n const result: { authKey: AuthenticationKey; publicKey: MultiKey | MultiEd25519PublicKey }[] = [];\n for (let i = 0; i < authKeys.length; i += 1) {\n const entry = authKeyToMultiKey.get(authKeys[i].toString());\n if (!entry) {\n throw new Error(`Failed to find multikey for authentication key ${authKeys[i]}`);\n }\n const publicKey = extractMultiKeyFromData(entry);\n result.push({ authKey: authKeys[i], publicKey });\n }\n\n return result;\n}\n\nfunction extractMultiKeyFromData(data: GetMultiKeyForAuthKeyResponse): MultiKey | MultiEd25519PublicKey {\n const signaturesRequired = data.signatures_required;\n const multikeyLayout = data.multikey_layout_with_prefixes;\n const multikeyType = data.multikey_type;\n\n if (multikeyType === \"multi_ed25519\") {\n const ed25519PublicKeys: Array<Ed25519PublicKey> = [];\n for (const key of multikeyLayout) {\n ed25519PublicKeys.push(new Ed25519PublicKey(key));\n }\n return new MultiEd25519PublicKey({\n publicKeys: ed25519PublicKeys,\n threshold: signaturesRequired,\n });\n }\n if (multikeyType === \"multi_key\") {\n const publicKeys: Array<PublicKey> = [];\n for (const key of multikeyLayout) {\n const deserializer = Deserializer.fromHex(key);\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let publicKey: PublicKey;\n switch (variantIndex) {\n case AnyPublicKeyVariant.Ed25519:\n publicKey = new Ed25519PublicKey(deserializer.deserializeFixedBytes(32));\n break;\n case AnyPublicKeyVariant.Secp256k1:\n publicKey = new Secp256k1PublicKey(deserializer.deserializeFixedBytes(65));\n break;\n case AnyPublicKeyVariant.Keyless:\n publicKey = KeylessPublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.FederatedKeyless:\n publicKey = FederatedKeylessPublicKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnyPublicKey: ${variantIndex}`);\n }\n publicKeys.push(new AnyPublicKey(publicKey));\n }\n return new MultiKey({\n publicKeys,\n signaturesRequired,\n });\n }\n throw new Error(\"Unknown multikey type\");\n}\n\nasync function getAuthKeysForPublicKey(args: {\n aptosConfig: AptosConfig;\n publicKey: Exclude<AccountPublicKey, AbstractMultiKey>;\n options?: { verified?: boolean };\n}): Promise<AuthenticationKey[]> {\n const { aptosConfig, publicKey, options } = args;\n const verified = options?.verified ?? true;\n let baseKey: PublicKey = publicKey;\n if (publicKey instanceof AnyPublicKey) {\n baseKey = publicKey.publicKey;\n }\n const whereCondition: any = {\n public_key: { _eq: baseKey.toString() },\n verified: { _eq: verified },\n };\n const graphqlQuery = {\n query: GetAuthKeysForPublicKey,\n variables: {\n where_condition: whereCondition,\n },\n };\n const { public_key_auth_keys: data } = await queryIndexer<GetAuthKeysForPublicKeyQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAuthKeysForPublicKey\",\n });\n\n const sortedData = data.sort((a, b) => Number(b.last_transaction_version) - Number(a.last_transaction_version));\n const authKeys = sortedData.map((entry) => new AuthenticationKey({ data: entry.auth_key }));\n return authKeys;\n}\n\nasync function getLastestTransactionVersionForAddress(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n const address = AccountAddress.from(accountAddress).toString();\n\n const whereCondition: any = {\n signer: { _eq: accountAddress.toString() },\n };\n\n const graphqlQuery = {\n query: GetSignatures,\n variables: {\n where_condition: whereCondition,\n limit: 1,\n order_by: { transaction_version: \"desc\" },\n },\n };\n\n const { signatures: data } = await queryIndexer<GetSignaturesQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getSignatures\",\n });\n\n if (data.length !== 1) {\n throw new Error(`No signatures found for address ${address}`);\n }\n return Number(data[0].transaction_version);\n}\n\nasync function getAccountAddressesForAuthKeys(args: {\n aptosConfig: AptosConfig;\n authKeys: AuthenticationKey[];\n options?: { verified?: boolean };\n}): Promise<\n { authKey: AuthenticationKey; accountAddress: AccountAddress; verified: boolean; lastTransactionVersion: number }[]\n> {\n const { aptosConfig, options, authKeys } = args;\n const verified = options?.verified ?? true;\n if (authKeys.length === 0) {\n throw new Error(\"No authentication keys provided\");\n }\n\n const whereCondition: any = {\n auth_key: { _in: authKeys.map((authKey) => authKey.toString()) },\n verified: { _eq: verified },\n };\n\n const graphqlQuery = {\n query: GetAccountAddressesForAuthKey,\n variables: {\n where_condition: whereCondition,\n },\n };\n const { auth_key_account_addresses: data } = await queryIndexer<GetAccountAddressesForAuthKeyQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountAddressesForAuthKeys\",\n });\n return data.map((entry) => ({\n authKey: new AuthenticationKey({ data: entry.auth_key }),\n accountAddress: new AccountAddress(Hex.hexInputToUint8Array(entry.address)),\n verified: entry.verified,\n lastTransactionVersion: Number(entry.last_transaction_version),\n }));\n}\n\nexport async function getAccountsForPublicKey(args: {\n aptosConfig: AptosConfig;\n publicKey: AccountPublicKey;\n}): Promise<\n { accountAddress: AccountAddress; publicKey: PublicKey; verified: boolean; lastTransactionVersion: number }[]\n> {\n const { aptosConfig, publicKey } = args;\n\n let baseKey: PublicKey = publicKey;\n if (publicKey instanceof AnyPublicKey) {\n baseKey = publicKey.publicKey;\n }\n const singleKeyPublicKeys: AccountPublicKey[] = [];\n if (baseKey instanceof Ed25519PublicKey) {\n singleKeyPublicKeys.push(baseKey);\n }\n const anyPublicKey = new AnyPublicKey(baseKey);\n singleKeyPublicKeys.push(anyPublicKey);\n\n const singleKeyAuthKeyPublicKeyPairs = singleKeyPublicKeys.map((pubKey) => {\n const authKey = pubKey.authKey();\n return { authKey, publicKey: pubKey };\n });\n\n const multiKeyAuthKeys = await getAuthKeysForPublicKey({ aptosConfig, publicKey });\n\n const [multiKeyPairs, authKeyAccountAddressPairs] = await Promise.all([\n getMultiKeysForAuthenticationKeys({ aptosConfig, authKeys: multiKeyAuthKeys }),\n getAccountAddressesForAuthKeys({\n aptosConfig,\n authKeys: multiKeyAuthKeys.concat(singleKeyAuthKeyPublicKeyPairs.map((pair) => pair.publicKey.authKey())),\n }),\n ]);\n\n const authKeyPublicKeyPairs = singleKeyAuthKeyPublicKeyPairs.concat(multiKeyPairs);\n\n const result: {\n accountAddress: AccountAddress;\n publicKey: PublicKey;\n verified: boolean;\n lastTransactionVersion: number;\n }[] = [];\n const authKeyToPublicKey = new Map(authKeyPublicKeyPairs.map((pair) => [pair.authKey.toString(), pair.publicKey]));\n for (const authKeyAccountAddressPair of authKeyAccountAddressPairs) {\n if (!authKeyToPublicKey.has(authKeyAccountAddressPair.authKey.toString())) {\n throw new Error(`No publicKey found for authentication key ${authKeyAccountAddressPair.authKey}.`);\n }\n result.push({\n accountAddress: authKeyAccountAddressPair.accountAddress,\n publicKey: authKeyToPublicKey.get(authKeyAccountAddressPair.authKey.toString()) as PublicKey,\n verified: authKeyAccountAddressPair.verified,\n lastTransactionVersion: authKeyAccountAddressPair.lastTransactionVersion,\n });\n }\n\n return result;\n}\n\nexport async function getPublicKeyFromAccountAddress(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<PublicKey> {\n const { aptosConfig, accountAddress } = args;\n\n const accountData = await getInfo({ aptosConfig, accountAddress });\n\n const lastTransactionVersion = await getLastestTransactionVersionForAddress({\n aptosConfig,\n accountAddress,\n });\n console.log(\"lastTransactionVersion\", lastTransactionVersion);\n\n const transaction = await getTransactionByVersion({ aptosConfig, ledgerVersion: lastTransactionVersion });\n if (!isUserTransactionResponse(transaction)) {\n throw new Error(\"Transaction is not a user transaction\");\n }\n\n const { signature } = transaction;\n if (!signature) {\n throw new Error(\"Transaction has no signature\");\n }\n\n let publicKey: AccountPublicKey;\n if (isEd25519Signature(signature)) {\n publicKey = new Ed25519PublicKey(signature.public_key);\n } else if (isMultiEd25519Signature(signature)) {\n publicKey = new MultiEd25519PublicKey({\n publicKeys: signature.public_keys.map((pk) => new Ed25519PublicKey(pk)),\n threshold: signature.threshold,\n });\n } else if (isSingleSenderSingleKeySignature(signature)) {\n publicKey = parsePublicKey(signature.public_key);\n } else if (isSingleSenderMultiKeySignature(signature)) {\n const publicKeys: Array<PublicKey> = [];\n for (const pk of signature.public_keys) {\n publicKeys.push(parsePublicKey(pk));\n }\n publicKey = new MultiKey({\n publicKeys,\n signaturesRequired: signature.signatures_required,\n });\n } else {\n throw new Error(\"Unknown signature type\");\n }\n if (publicKey.authKey().toString() !== accountData.authentication_key) {\n throw new Error(\n \"Derived public key does not match authentication key. The most recent signature was likely a key rotation.\",\n );\n }\n return publicKey;\n}\n\nexport async function getMultiKeyFromAuthenticationKey(args: {\n aptosConfig: AptosConfig;\n authKey: AuthenticationKey;\n}): Promise<MultiKey | MultiEd25519PublicKey> {\n const { aptosConfig, authKey } = args;\n\n const result = await getMultiKeysForAuthenticationKeys({ aptosConfig, authKeys: [authKey] });\n\n if (result.length === 0) {\n throw new Error(`No multikey found for the given authentication key ${authKey}`);\n }\n if (result.length > 1) {\n // This should never happen. Rows are uniquely keyed by auth key.\n throw new Error(`More than one multikey found for the given authentication key ${authKey}`);\n }\n\n return result[0].publicKey;\n}\n\n// export async function deriveAccount(\n// args: { aptosConfig: AptosConfig } & (\n// | { privateKey: PrivateKey }\n// | DeriveKeylessAccountParams\n// | { multiKeyDerivation: (PrivateKey | DeriveKeylessAccountParams)[] }\n// ),\n// ): Promise<Account> {\n// const { aptosConfig, ...rest } = args;\n// if (\"privateKey\" in rest) {\n// const accounts = await getAccountsForPublicKey({ aptosConfig, publicKey: rest.privateKey.publicKey() as AccountPublicKey });\n// return deriveAccountFromPrivateKey({ aptosConfig, ...rest });\n// } else if (\"jwt\" in rest) {\n// return deriveKeylessAccount({ aptosConfig, ...rest });\n// }\n// const accounts: Account[] = [];\n// for (const derivation of rest.multiKeyDerivation) { \n// if (\"privateKey\" in derivation) {\n// accounts.push(deriveAccountFromPrivateKey({ aptosConfig, ...derivation }));\n// } else if (\"jwt\" in derivation) {\n// accounts.push(deriveKeylessAccount({ aptosConfig, ...derivation }));\n// }\n// }\n// return new MultiKey({\n// publicKeys: accounts.map((account) => account.publicKey),\n// threshold: rest.multiKeyDerivation.length,\n// });\n// } \n\ntype AccountDerivationParams = { privateKey: PrivateKey } | DeriveKeylessAccountParams;\n\nfunction parsePublicKey(data: { value: string; type: string }): AnyPublicKey {\n if (data.type === \"keyless\") {\n const deserializer = Deserializer.fromHex(data.value);\n return new AnyPublicKey(KeylessPublicKey.deserialize(deserializer));\n }\n if (data.type === \"ed25519\") {\n return new AnyPublicKey(new Ed25519PublicKey(data.value));\n }\n if (data.type === \"secp256k1_ecdsa\") {\n return new AnyPublicKey(new Secp256k1PublicKey(data.value));\n }\n throw new Error(\"Unknown public key type\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA,eAAsBA,SAAQ,MAGL;AACvB,SAAO,QAAY,IAAI;AACzB;AAcA,eAAsBC,YAAW,MAIC;AAChC,SAAO,WAAe,IAAI;AAC5B;AAeA,eAAsBC,WAAU,MAKA;AAC9B,SAAO,UAAc,IAAI;AAC3B;AAcA,eAAsB,gBAAgB,MAIH;AACjC,QAAM,EAAE,aAAa,gBAAgB,QAAQ,IAAI;AACjD,SAAO,mBAA8C;AAAA,IACnD;AAAA,IACA,cAAc;AAAA,IACd,MAAM,YAAY,eAAe,KAAK,cAAc,EAAE,SAAS,CAAC;AAAA,IAChE,QAAQ,EAAE,OAAO,SAAS,QAAQ,OAAO,SAAS,MAAM;AAAA,EAC1D,CAAC;AACH;AAcA,eAAsB,aAAa,MAIP;AAC1B,QAAM,EAAE,aAAa,gBAAgB,QAAQ,IAAI;AACjD,SAAO,6BAAiD;AAAA,IACtD;AAAA,IACA,cAAc;AAAA,IACd,MAAM,YAAY,eAAe,KAAK,cAAc,EAAE,SAAS,CAAC;AAAA,IAChE,QAAQ;AAAA,MACN,gBAAgB,SAAS;AAAA,MACzB,QAAQ,SAAS;AAAA,MACjB,OAAO,SAAS,SAAS;AAAA,IAC3B;AAAA,EACF,CAAC;A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AAE;AAAA,EAC5F;AAEA,SAAO,OAAO,CAAC,EAAE;AACnB;AAgCA,SAAS,eAAe,MAAqD;AAC3E,MAAI,KAAK,SAAS,WAAW;AAC3B,UAAM,eAAe,aAAa,QAAQ,KAAK,KAAK;AACpD,WAAO,IAAI,aAAa,iBAAiB,YAAY,YAAY,CAAC;AAAA,EACpE;AACA,MAAI,KAAK,SAAS,WAAW;AAC3B,WAAO,IAAI,aAAa,IAAI,iBAAiB,KAAK,KAAK,CAAC;AAAA,EAC1D;AACA,MAAI,KAAK,SAAS,mBAAmB;AACnC,WAAO,IAAI,aAAa,IAAI,mBAAmB,KAAK,KAAK,CAAC;AAAA,EAC5D;AACA,QAAM,IAAI,MAAM,yBAAyB;AAC3C;","names":["getInfo","getModules","getModule"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  viewBinary
3
- } from "./chunk-3T7G4OUL.mjs";
3
+ } from "./chunk-X4N5BN3S.mjs";
4
4
 
5
5
  // src/api/experimental.ts
6
6
  var Experimental = class {
@@ -47,4 +47,4 @@ var Experimental = class {
47
47
  export {
48
48
  Experimental
49
49
  };
50
- //# sourceMappingURL=chunk-BVBIBMAE.mjs.map
50
+ //# sourceMappingURL=chunk-SRXIHVZE.mjs.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ZWCTF3NQ.mjs";
4
4
  import {
5
5
  submitTransaction
6
- } from "./chunk-D3IWXA33.mjs";
6
+ } from "./chunk-HKQY5GXT.mjs";
7
7
  import {
8
8
  __decorateClass
9
9
  } from "./chunk-SAWN7RJP.mjs";
@@ -60,4 +60,4 @@ __decorateClass([
60
60
  export {
61
61
  Submit
62
62
  };
63
- //# sourceMappingURL=chunk-ZAPXD4FC.mjs.map
63
+ //# sourceMappingURL=chunk-T4BFWV46.mjs.map
@@ -10,11 +10,11 @@ import {
10
10
  import {
11
11
  EphemeralPublicKey,
12
12
  EphemeralSignature
13
- } from "./chunk-MX2R6BBJ.mjs";
13
+ } from "./chunk-UOHCJOXI.mjs";
14
14
  import {
15
15
  Ed25519PublicKey,
16
16
  Ed25519Signature
17
- } from "./chunk-HRUI6AWF.mjs";
17
+ } from "./chunk-TFW6N66T.mjs";
18
18
  import {
19
19
  AccountPublicKey
20
20
  } from "./chunk-R4JTQQBX.mjs";
@@ -697,4 +697,4 @@ export {
697
697
  MoveJWK,
698
698
  parseJwtHeader
699
699
  };
700
- //# sourceMappingURL=chunk-ZZWD23YW.mjs.map
700
+ //# sourceMappingURL=chunk-T573PCIR.mjs.map
@@ -1,38 +1,38 @@
1
1
  import {
2
2
  FederatedKeylessAccount
3
- } from "./chunk-IARAGRKO.mjs";
3
+ } from "./chunk-UGFIWCJQ.mjs";
4
4
  import {
5
5
  KeylessAccount
6
- } from "./chunk-MD4TZ4HA.mjs";
6
+ } from "./chunk-WUM247HF.mjs";
7
7
  import {
8
8
  MultiKeyAccount
9
- } from "./chunk-IORAMQ2Y.mjs";
9
+ } from "./chunk-K5OCDM3W.mjs";
10
10
  import {
11
11
  deserializeSchemeAndAddress
12
12
  } from "./chunk-56UCIGTO.mjs";
13
13
  import {
14
14
  SingleKeyAccount,
15
15
  isSingleKeySigner
16
- } from "./chunk-XHQMSKZP.mjs";
16
+ } from "./chunk-G7BB6K4B.mjs";
17
17
  import {
18
18
  Ed25519Account
19
- } from "./chunk-RTNVJKNX.mjs";
19
+ } from "./chunk-62LC4PPC.mjs";
20
20
  import {
21
21
  EphemeralKeyPair
22
- } from "./chunk-TQLOZKH4.mjs";
22
+ } from "./chunk-XIBOO3WF.mjs";
23
23
  import {
24
24
  MultiKey
25
- } from "./chunk-NFBLI3BS.mjs";
25
+ } from "./chunk-DMFRIING.mjs";
26
26
  import {
27
27
  Secp256k1PrivateKey
28
- } from "./chunk-CPZPXG7O.mjs";
28
+ } from "./chunk-ECTX2FGD.mjs";
29
29
  import {
30
30
  ZeroKnowledgeSig,
31
31
  getIssAudAndUidVal
32
- } from "./chunk-ZZWD23YW.mjs";
32
+ } from "./chunk-T573PCIR.mjs";
33
33
  import {
34
34
  Ed25519PrivateKey
35
- } from "./chunk-HRUI6AWF.mjs";
35
+ } from "./chunk-TFW6N66T.mjs";
36
36
  import {
37
37
  AccountAddress
38
38
  } from "./chunk-CXLXUSCG.mjs";
@@ -236,4 +236,4 @@ var AccountUtils;
236
236
  export {
237
237
  AccountUtils
238
238
  };
239
- //# sourceMappingURL=chunk-AEMQUDMU.mjs.map
239
+ //# sourceMappingURL=chunk-TDLL7QX5.mjs.map
@@ -1,6 +1,3 @@
1
- import {
2
- PrivateKey
3
- } from "./chunk-YU65LNIC.mjs";
4
1
  import {
5
2
  convertSigningMessage
6
3
  } from "./chunk-THWEBWUC.mjs";
@@ -12,6 +9,9 @@ import {
12
9
  mnemonicToSeed,
13
10
  splitPath
14
11
  } from "./chunk-F7W7KS5C.mjs";
12
+ import {
13
+ PrivateKey
14
+ } from "./chunk-YU65LNIC.mjs";
15
15
  import {
16
16
  AccountPublicKey
17
17
  } from "./chunk-R4JTQQBX.mjs";
@@ -412,4 +412,4 @@ export {
412
412
  Ed25519PrivateKey,
413
413
  Ed25519Signature
414
414
  };
415
- //# sourceMappingURL=chunk-HRUI6AWF.mjs.map
415
+ //# sourceMappingURL=chunk-TFW6N66T.mjs.map
@@ -12,7 +12,7 @@ import {
12
12
  renewDomain,
13
13
  setPrimaryName,
14
14
  setTargetAddress
15
- } from "./chunk-Y25NJOOO.mjs";
15
+ } from "./chunk-UK7SPHIE.mjs";
16
16
 
17
17
  // src/api/ans.ts
18
18
  var ANS = class {
@@ -510,4 +510,4 @@ var ANS = class {
510
510
  export {
511
511
  ANS
512
512
  };
513
- //# sourceMappingURL=chunk-LK4HGGAJ.mjs.map
513
+ //# sourceMappingURL=chunk-TJDF4CXI.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generateTransaction
3
- } from "./chunk-D3IWXA33.mjs";
3
+ } from "./chunk-HKQY5GXT.mjs";
4
4
  import {
5
5
  TypeTagAddress,
6
6
  TypeTagStruct,
@@ -67,4 +67,4 @@ export {
67
67
  removeAuthenticationFunctionTransaction,
68
68
  removeDispatchableAuthenticatorTransaction
69
69
  };
70
- //# sourceMappingURL=chunk-U7K7AJMC.mjs.map
70
+ //# sourceMappingURL=chunk-TL4Z4KHK.mjs.map