@aptos-labs/ts-sdk 1.29.0 → 1.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/dist/common/index.d.ts +5 -0
  2. package/dist/common/index.js +3 -3
  3. package/dist/common/index.js.map +1 -1
  4. package/dist/esm/account/AbstractKeylessAccount.d.mts +1 -0
  5. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  6. package/dist/esm/account/Account.mjs +1 -1
  7. package/dist/esm/account/Ed25519Account.mjs +1 -1
  8. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  9. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  10. package/dist/esm/account/KeylessAccount.d.mts +5 -1
  11. package/dist/esm/account/KeylessAccount.mjs +1 -1
  12. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  13. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  14. package/dist/esm/account/index.mjs +1 -1
  15. package/dist/esm/api/account.d.mts +1 -1
  16. package/dist/esm/api/account.mjs +1 -1
  17. package/dist/esm/api/ans.mjs +1 -1
  18. package/dist/esm/api/aptos.mjs +1 -1
  19. package/dist/esm/api/coin.d.mts +2 -2
  20. package/dist/esm/api/coin.mjs +1 -1
  21. package/dist/esm/api/digitalAsset.d.mts +2 -2
  22. package/dist/esm/api/digitalAsset.mjs +1 -1
  23. package/dist/esm/api/event.d.mts +1 -1
  24. package/dist/esm/api/event.mjs +1 -1
  25. package/dist/esm/api/faucet.mjs +1 -1
  26. package/dist/esm/api/fungibleAsset.d.mts +1 -1
  27. package/dist/esm/api/fungibleAsset.mjs +1 -1
  28. package/dist/esm/api/general.d.mts +2 -2
  29. package/dist/esm/api/general.mjs +1 -1
  30. package/dist/esm/api/index.mjs +1 -1
  31. package/dist/esm/api/keyless.d.mts +1 -1
  32. package/dist/esm/api/keyless.mjs +1 -1
  33. package/dist/esm/api/object.d.mts +2 -2
  34. package/dist/esm/api/object.mjs +1 -1
  35. package/dist/esm/api/staking.d.mts +2 -2
  36. package/dist/esm/api/staking.mjs +1 -1
  37. package/dist/esm/api/table.d.mts +1 -1
  38. package/dist/esm/api/table.mjs +1 -1
  39. package/dist/esm/api/transaction.mjs +1 -1
  40. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  41. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  42. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  43. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  44. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  45. package/dist/esm/api/utils.mjs +1 -1
  46. package/dist/esm/bcs/index.mjs +1 -1
  47. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  48. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  49. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  50. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  51. package/dist/esm/bcs/serializer.mjs +1 -1
  52. package/dist/esm/{chunk-MNVUSJEK.mjs → chunk-25NSCK4Q.mjs} +2 -2
  53. package/dist/esm/{chunk-HVMFZF6P.mjs → chunk-25TIHDS6.mjs} +2 -2
  54. package/dist/esm/{chunk-7VKFXX5Q.mjs → chunk-2TQIU7CG.mjs} +2 -2
  55. package/dist/esm/{chunk-F63E4CR7.mjs → chunk-3MCYLML2.mjs} +2 -2
  56. package/dist/esm/{chunk-53RB2PRH.mjs → chunk-3YKAGVHZ.mjs} +2 -2
  57. package/dist/esm/{chunk-RXE6NNOL.mjs → chunk-46D5QX3G.mjs} +2 -2
  58. package/dist/esm/chunk-555I4YHP.mjs +2 -0
  59. package/dist/esm/{chunk-UAEODDZS.mjs.map → chunk-555I4YHP.mjs.map} +1 -1
  60. package/dist/esm/{chunk-QBSU3L5Q.mjs → chunk-5655UVIK.mjs} +2 -2
  61. package/dist/esm/{chunk-YPHH6CAO.mjs → chunk-6QGVRNV6.mjs} +2 -2
  62. package/dist/esm/chunk-6RZZIOGH.mjs +2 -0
  63. package/dist/esm/chunk-6RZZIOGH.mjs.map +1 -0
  64. package/dist/esm/{chunk-CRA2MFJC.mjs → chunk-7V6DEA7G.mjs} +2 -2
  65. package/dist/esm/{chunk-HKBBA653.mjs → chunk-7ZLBJUVZ.mjs} +2 -2
  66. package/dist/esm/{chunk-S2KDCIZN.mjs → chunk-AFOPNDOJ.mjs} +2 -2
  67. package/dist/esm/{chunk-ADE6MVXC.mjs → chunk-B2CXRZL5.mjs} +2 -2
  68. package/dist/esm/{chunk-4HR32TSY.mjs → chunk-B6M7QBUO.mjs} +2 -2
  69. package/dist/esm/{chunk-45IUUCAV.mjs → chunk-BD6BJETG.mjs} +2 -2
  70. package/dist/esm/{chunk-MLDQ2TY2.mjs → chunk-BF4ZE37Q.mjs} +2 -2
  71. package/dist/esm/{chunk-STUXKQVZ.mjs → chunk-BKEJMQQ6.mjs} +2 -2
  72. package/dist/esm/{chunk-JH6VLTMS.mjs → chunk-BRFHAO2Y.mjs} +2 -2
  73. package/dist/esm/{chunk-LNEZEYYE.mjs → chunk-CCMHWJ3Q.mjs} +2 -2
  74. package/dist/esm/{chunk-KUOB4DDE.mjs → chunk-CPPBQDHB.mjs} +2 -2
  75. package/dist/esm/{chunk-5PCNWXRN.mjs → chunk-CVDR5SJR.mjs} +2 -2
  76. package/dist/esm/{chunk-GWSDIX6C.mjs → chunk-DAJOX4PL.mjs} +2 -2
  77. package/dist/esm/{chunk-WJRZWAIS.mjs → chunk-DAXKRXRK.mjs} +2 -2
  78. package/dist/esm/{chunk-4TB3AWQE.mjs → chunk-DF4WKSTK.mjs} +2 -2
  79. package/dist/esm/{chunk-YUNDX5I7.mjs → chunk-E37YRKWK.mjs} +2 -2
  80. package/dist/esm/{chunk-OKAQO57B.mjs → chunk-ECWOLU5T.mjs} +2 -2
  81. package/dist/esm/{chunk-YU3IYJRL.mjs → chunk-EV2USF7B.mjs} +2 -2
  82. package/dist/esm/{chunk-SDWE6WMM.mjs → chunk-EWZ2M5BW.mjs} +2 -2
  83. package/dist/esm/{chunk-QPB6EJVM.mjs → chunk-FRGXKOU5.mjs} +2 -2
  84. package/dist/esm/{chunk-ZROQH5YL.mjs → chunk-G7MWTE2J.mjs} +2 -2
  85. package/dist/esm/{chunk-2BTTX2KO.mjs → chunk-GFGX3QDP.mjs} +2 -2
  86. package/dist/esm/{chunk-HHGJXVAE.mjs → chunk-GGR3P2TG.mjs} +2 -2
  87. package/dist/esm/{chunk-A63SMUOU.mjs → chunk-HPZ2S4FE.mjs} +2 -2
  88. package/dist/esm/{chunk-P3TAY5PP.mjs → chunk-HSPBA2TZ.mjs} +2 -2
  89. package/dist/esm/{chunk-76OH2Z4Q.mjs → chunk-IMGLHDIA.mjs} +2 -2
  90. package/dist/esm/{chunk-367OG3DB.mjs → chunk-IYQISVDX.mjs} +2 -2
  91. package/dist/esm/chunk-K2O24YLZ.mjs +2 -0
  92. package/dist/esm/chunk-K2O24YLZ.mjs.map +1 -0
  93. package/dist/esm/{chunk-G5MGSV7Y.mjs → chunk-KA6FZNWP.mjs} +2 -2
  94. package/dist/esm/{chunk-O2BPA6TS.mjs → chunk-KXBIA4KR.mjs} +2 -2
  95. package/dist/esm/{chunk-3W2DHZXK.mjs → chunk-KYSDF3CA.mjs} +2 -2
  96. package/dist/esm/{chunk-IR4SLC2M.mjs → chunk-L5NY7TMI.mjs} +2 -2
  97. package/dist/esm/{chunk-BSAHPS6E.mjs → chunk-LDFTE4MM.mjs} +2 -2
  98. package/dist/esm/{chunk-G5XLMQ5E.mjs → chunk-LG3DAAPD.mjs} +2 -2
  99. package/dist/esm/{chunk-GDO6Q2FI.mjs → chunk-LGD5KU56.mjs} +2 -2
  100. package/dist/esm/{chunk-BOYYQAB4.mjs → chunk-LXLISEQ4.mjs} +2 -2
  101. package/dist/esm/{chunk-MQGW234H.mjs → chunk-M2QV232A.mjs} +2 -2
  102. package/dist/esm/chunk-MEWFJJJN.mjs +2 -0
  103. package/dist/esm/chunk-MEWFJJJN.mjs.map +1 -0
  104. package/dist/esm/{chunk-FZ5EYP3D.mjs → chunk-MO4IZXLK.mjs} +2 -2
  105. package/dist/esm/{chunk-H6YNXJNF.mjs → chunk-MS4MRLGA.mjs} +2 -2
  106. package/dist/esm/{chunk-A42BPAD4.mjs → chunk-N5JNKD5F.mjs} +2 -2
  107. package/dist/esm/{chunk-2F7Z7RMW.mjs → chunk-NH2S6SB2.mjs} +2 -2
  108. package/dist/esm/{chunk-TQWGQLM6.mjs → chunk-NNRAQP36.mjs} +2 -2
  109. package/dist/esm/{chunk-6UZ3VI5Y.mjs → chunk-OY2IX7HW.mjs} +2 -2
  110. package/dist/esm/{chunk-NWOMSL6K.mjs → chunk-PKXEB7XP.mjs} +2 -2
  111. package/dist/esm/{chunk-BA4RBST6.mjs → chunk-PNXUYOYI.mjs} +2 -2
  112. package/dist/esm/chunk-PUZ25PTD.mjs +2 -0
  113. package/dist/esm/chunk-PUZ25PTD.mjs.map +1 -0
  114. package/dist/esm/{chunk-Y2GWUE7C.mjs → chunk-QCUFTD7K.mjs} +2 -2
  115. package/dist/esm/{chunk-SUJLWCRN.mjs → chunk-QDIKOQRK.mjs} +2 -2
  116. package/dist/esm/{chunk-YDZBU2DJ.mjs → chunk-QIW56MUH.mjs} +2 -2
  117. package/dist/esm/{chunk-GDUAFXIQ.mjs → chunk-QLN2URFX.mjs} +2 -2
  118. package/dist/esm/{chunk-OHRL766V.mjs → chunk-QPP6BX53.mjs} +2 -2
  119. package/dist/esm/{chunk-SWNFKKRE.mjs → chunk-RNTXQYJQ.mjs} +2 -2
  120. package/dist/esm/{chunk-X34JJPW5.mjs → chunk-SAPUZZEU.mjs} +2 -2
  121. package/dist/esm/{chunk-Q3TAEOH5.mjs → chunk-SR24OGHJ.mjs} +2 -2
  122. package/dist/esm/{chunk-D3Q4BC3I.mjs → chunk-STGYDB5E.mjs} +2 -2
  123. package/dist/esm/{chunk-APN6AV5Q.mjs → chunk-SWHLSREF.mjs} +2 -2
  124. package/dist/esm/{chunk-L2QXU6F4.mjs → chunk-TL7DR54X.mjs} +2 -2
  125. package/dist/esm/{chunk-KUZ2YTJH.mjs → chunk-TMW2HIXC.mjs} +2 -2
  126. package/dist/esm/{chunk-R76DHMGR.mjs → chunk-TS3PYRAT.mjs} +2 -2
  127. package/dist/esm/{chunk-F3M2UQA4.mjs → chunk-TVFIUUVY.mjs} +2 -2
  128. package/dist/esm/{chunk-GMBSQDPO.mjs → chunk-U67PFBTL.mjs} +2 -2
  129. package/dist/esm/{chunk-WRRQ7L5K.mjs → chunk-WP7WF54Q.mjs} +2 -2
  130. package/dist/esm/{chunk-BWNTSJOC.mjs → chunk-WS4RPKL6.mjs} +2 -2
  131. package/dist/esm/{chunk-P2EIZ7WL.mjs → chunk-WWZ3METZ.mjs} +2 -2
  132. package/dist/esm/{chunk-S2W4D6NZ.mjs → chunk-X4KEZTUQ.mjs} +2 -2
  133. package/dist/esm/{chunk-F76N4MQO.mjs → chunk-XH7YKEYR.mjs} +2 -2
  134. package/dist/esm/{chunk-ELYS7CWV.mjs → chunk-XK3JFCP3.mjs} +2 -2
  135. package/dist/esm/{chunk-MAMPMCO7.mjs → chunk-XONG5JZ4.mjs} +2 -2
  136. package/dist/esm/{chunk-J64ARI4E.mjs → chunk-XXHW3ZT3.mjs} +2 -2
  137. package/dist/esm/{chunk-OMV7445F.mjs → chunk-Y7F2V3R6.mjs} +2 -2
  138. package/dist/esm/chunk-YHAPZP5A.mjs +2 -0
  139. package/dist/esm/chunk-YHAPZP5A.mjs.map +1 -0
  140. package/dist/esm/{chunk-P5V7OZNN.mjs → chunk-YJCZU6PR.mjs} +2 -2
  141. package/dist/esm/{chunk-5VD4MHB3.mjs → chunk-ZGO2SK6F.mjs} +2 -2
  142. package/dist/esm/cli/index.mjs +1 -1
  143. package/dist/esm/client/core.mjs +1 -1
  144. package/dist/esm/client/get.mjs +1 -1
  145. package/dist/esm/client/index.mjs +1 -1
  146. package/dist/esm/client/post.mjs +1 -1
  147. package/dist/esm/core/account/index.mjs +1 -1
  148. package/dist/esm/core/account/utils/address.mjs +1 -1
  149. package/dist/esm/core/account/utils/index.mjs +1 -1
  150. package/dist/esm/core/accountAddress.mjs +1 -1
  151. package/dist/esm/core/authenticationKey.mjs +1 -1
  152. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  153. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  154. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  155. package/dist/esm/core/crypto/index.mjs +1 -1
  156. package/dist/esm/core/crypto/keyless.mjs +1 -1
  157. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  158. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  159. package/dist/esm/core/crypto/proof.mjs +1 -1
  160. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  161. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  162. package/dist/esm/core/crypto/signature.mjs +1 -1
  163. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  164. package/dist/esm/core/index.mjs +1 -1
  165. package/dist/esm/index.mjs +1 -1
  166. package/dist/esm/internal/account.mjs +1 -1
  167. package/dist/esm/internal/ans.mjs +1 -1
  168. package/dist/esm/internal/coin.mjs +1 -1
  169. package/dist/esm/internal/digitalAsset.mjs +1 -1
  170. package/dist/esm/internal/event.mjs +1 -1
  171. package/dist/esm/internal/faucet.mjs +1 -1
  172. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  173. package/dist/esm/internal/general.mjs +1 -1
  174. package/dist/esm/internal/keyless.mjs +1 -1
  175. package/dist/esm/internal/object.mjs +1 -1
  176. package/dist/esm/internal/staking.mjs +1 -1
  177. package/dist/esm/internal/table.mjs +1 -1
  178. package/dist/esm/internal/transaction.mjs +1 -1
  179. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  180. package/dist/esm/internal/view.mjs +1 -1
  181. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  182. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  183. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  184. package/dist/esm/transactions/index.mjs +1 -1
  185. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  186. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  187. package/dist/esm/transactions/instances/index.mjs +1 -1
  188. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  189. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  190. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  191. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  192. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  193. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  194. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  195. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  196. package/dist/esm/transactions/management/index.mjs +1 -1
  197. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  198. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  199. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  200. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  201. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  202. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
  203. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  204. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  205. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  206. package/dist/esm/utils/index.mjs +1 -1
  207. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  208. package/dist/esm/version.d.mts +1 -1
  209. package/dist/esm/version.mjs +1 -1
  210. package/package.json +21 -21
  211. package/src/account/AbstractKeylessAccount.ts +3 -2
  212. package/src/account/FederatedKeylessAccount.ts +3 -2
  213. package/src/account/KeylessAccount.ts +9 -2
  214. package/src/client/core.ts +1 -1
  215. package/src/transactions/transactionBuilder/transactionBuilder.ts +13 -2
  216. package/src/version.ts +1 -1
  217. package/dist/esm/chunk-CB6H4VMZ.mjs +0 -2
  218. package/dist/esm/chunk-CB6H4VMZ.mjs.map +0 -1
  219. package/dist/esm/chunk-E4O26ZJB.mjs +0 -2
  220. package/dist/esm/chunk-E4O26ZJB.mjs.map +0 -1
  221. package/dist/esm/chunk-MDJ66AA3.mjs +0 -2
  222. package/dist/esm/chunk-MDJ66AA3.mjs.map +0 -1
  223. package/dist/esm/chunk-UAEODDZS.mjs +0 -2
  224. package/dist/esm/chunk-XMW65WCQ.mjs +0 -2
  225. package/dist/esm/chunk-XMW65WCQ.mjs.map +0 -1
  226. package/dist/esm/chunk-Y3BATGHX.mjs +0 -2
  227. package/dist/esm/chunk-Y3BATGHX.mjs.map +0 -1
  228. /package/dist/esm/{chunk-MNVUSJEK.mjs.map → chunk-25NSCK4Q.mjs.map} +0 -0
  229. /package/dist/esm/{chunk-HVMFZF6P.mjs.map → chunk-25TIHDS6.mjs.map} +0 -0
  230. /package/dist/esm/{chunk-7VKFXX5Q.mjs.map → chunk-2TQIU7CG.mjs.map} +0 -0
  231. /package/dist/esm/{chunk-F63E4CR7.mjs.map → chunk-3MCYLML2.mjs.map} +0 -0
  232. /package/dist/esm/{chunk-53RB2PRH.mjs.map → chunk-3YKAGVHZ.mjs.map} +0 -0
  233. /package/dist/esm/{chunk-RXE6NNOL.mjs.map → chunk-46D5QX3G.mjs.map} +0 -0
  234. /package/dist/esm/{chunk-QBSU3L5Q.mjs.map → chunk-5655UVIK.mjs.map} +0 -0
  235. /package/dist/esm/{chunk-YPHH6CAO.mjs.map → chunk-6QGVRNV6.mjs.map} +0 -0
  236. /package/dist/esm/{chunk-CRA2MFJC.mjs.map → chunk-7V6DEA7G.mjs.map} +0 -0
  237. /package/dist/esm/{chunk-HKBBA653.mjs.map → chunk-7ZLBJUVZ.mjs.map} +0 -0
  238. /package/dist/esm/{chunk-S2KDCIZN.mjs.map → chunk-AFOPNDOJ.mjs.map} +0 -0
  239. /package/dist/esm/{chunk-ADE6MVXC.mjs.map → chunk-B2CXRZL5.mjs.map} +0 -0
  240. /package/dist/esm/{chunk-4HR32TSY.mjs.map → chunk-B6M7QBUO.mjs.map} +0 -0
  241. /package/dist/esm/{chunk-45IUUCAV.mjs.map → chunk-BD6BJETG.mjs.map} +0 -0
  242. /package/dist/esm/{chunk-MLDQ2TY2.mjs.map → chunk-BF4ZE37Q.mjs.map} +0 -0
  243. /package/dist/esm/{chunk-STUXKQVZ.mjs.map → chunk-BKEJMQQ6.mjs.map} +0 -0
  244. /package/dist/esm/{chunk-JH6VLTMS.mjs.map → chunk-BRFHAO2Y.mjs.map} +0 -0
  245. /package/dist/esm/{chunk-LNEZEYYE.mjs.map → chunk-CCMHWJ3Q.mjs.map} +0 -0
  246. /package/dist/esm/{chunk-KUOB4DDE.mjs.map → chunk-CPPBQDHB.mjs.map} +0 -0
  247. /package/dist/esm/{chunk-5PCNWXRN.mjs.map → chunk-CVDR5SJR.mjs.map} +0 -0
  248. /package/dist/esm/{chunk-GWSDIX6C.mjs.map → chunk-DAJOX4PL.mjs.map} +0 -0
  249. /package/dist/esm/{chunk-WJRZWAIS.mjs.map → chunk-DAXKRXRK.mjs.map} +0 -0
  250. /package/dist/esm/{chunk-4TB3AWQE.mjs.map → chunk-DF4WKSTK.mjs.map} +0 -0
  251. /package/dist/esm/{chunk-YUNDX5I7.mjs.map → chunk-E37YRKWK.mjs.map} +0 -0
  252. /package/dist/esm/{chunk-OKAQO57B.mjs.map → chunk-ECWOLU5T.mjs.map} +0 -0
  253. /package/dist/esm/{chunk-YU3IYJRL.mjs.map → chunk-EV2USF7B.mjs.map} +0 -0
  254. /package/dist/esm/{chunk-SDWE6WMM.mjs.map → chunk-EWZ2M5BW.mjs.map} +0 -0
  255. /package/dist/esm/{chunk-QPB6EJVM.mjs.map → chunk-FRGXKOU5.mjs.map} +0 -0
  256. /package/dist/esm/{chunk-ZROQH5YL.mjs.map → chunk-G7MWTE2J.mjs.map} +0 -0
  257. /package/dist/esm/{chunk-2BTTX2KO.mjs.map → chunk-GFGX3QDP.mjs.map} +0 -0
  258. /package/dist/esm/{chunk-HHGJXVAE.mjs.map → chunk-GGR3P2TG.mjs.map} +0 -0
  259. /package/dist/esm/{chunk-A63SMUOU.mjs.map → chunk-HPZ2S4FE.mjs.map} +0 -0
  260. /package/dist/esm/{chunk-P3TAY5PP.mjs.map → chunk-HSPBA2TZ.mjs.map} +0 -0
  261. /package/dist/esm/{chunk-76OH2Z4Q.mjs.map → chunk-IMGLHDIA.mjs.map} +0 -0
  262. /package/dist/esm/{chunk-367OG3DB.mjs.map → chunk-IYQISVDX.mjs.map} +0 -0
  263. /package/dist/esm/{chunk-G5MGSV7Y.mjs.map → chunk-KA6FZNWP.mjs.map} +0 -0
  264. /package/dist/esm/{chunk-O2BPA6TS.mjs.map → chunk-KXBIA4KR.mjs.map} +0 -0
  265. /package/dist/esm/{chunk-3W2DHZXK.mjs.map → chunk-KYSDF3CA.mjs.map} +0 -0
  266. /package/dist/esm/{chunk-IR4SLC2M.mjs.map → chunk-L5NY7TMI.mjs.map} +0 -0
  267. /package/dist/esm/{chunk-BSAHPS6E.mjs.map → chunk-LDFTE4MM.mjs.map} +0 -0
  268. /package/dist/esm/{chunk-G5XLMQ5E.mjs.map → chunk-LG3DAAPD.mjs.map} +0 -0
  269. /package/dist/esm/{chunk-GDO6Q2FI.mjs.map → chunk-LGD5KU56.mjs.map} +0 -0
  270. /package/dist/esm/{chunk-BOYYQAB4.mjs.map → chunk-LXLISEQ4.mjs.map} +0 -0
  271. /package/dist/esm/{chunk-MQGW234H.mjs.map → chunk-M2QV232A.mjs.map} +0 -0
  272. /package/dist/esm/{chunk-FZ5EYP3D.mjs.map → chunk-MO4IZXLK.mjs.map} +0 -0
  273. /package/dist/esm/{chunk-H6YNXJNF.mjs.map → chunk-MS4MRLGA.mjs.map} +0 -0
  274. /package/dist/esm/{chunk-A42BPAD4.mjs.map → chunk-N5JNKD5F.mjs.map} +0 -0
  275. /package/dist/esm/{chunk-2F7Z7RMW.mjs.map → chunk-NH2S6SB2.mjs.map} +0 -0
  276. /package/dist/esm/{chunk-TQWGQLM6.mjs.map → chunk-NNRAQP36.mjs.map} +0 -0
  277. /package/dist/esm/{chunk-6UZ3VI5Y.mjs.map → chunk-OY2IX7HW.mjs.map} +0 -0
  278. /package/dist/esm/{chunk-NWOMSL6K.mjs.map → chunk-PKXEB7XP.mjs.map} +0 -0
  279. /package/dist/esm/{chunk-BA4RBST6.mjs.map → chunk-PNXUYOYI.mjs.map} +0 -0
  280. /package/dist/esm/{chunk-Y2GWUE7C.mjs.map → chunk-QCUFTD7K.mjs.map} +0 -0
  281. /package/dist/esm/{chunk-SUJLWCRN.mjs.map → chunk-QDIKOQRK.mjs.map} +0 -0
  282. /package/dist/esm/{chunk-YDZBU2DJ.mjs.map → chunk-QIW56MUH.mjs.map} +0 -0
  283. /package/dist/esm/{chunk-GDUAFXIQ.mjs.map → chunk-QLN2URFX.mjs.map} +0 -0
  284. /package/dist/esm/{chunk-OHRL766V.mjs.map → chunk-QPP6BX53.mjs.map} +0 -0
  285. /package/dist/esm/{chunk-SWNFKKRE.mjs.map → chunk-RNTXQYJQ.mjs.map} +0 -0
  286. /package/dist/esm/{chunk-X34JJPW5.mjs.map → chunk-SAPUZZEU.mjs.map} +0 -0
  287. /package/dist/esm/{chunk-Q3TAEOH5.mjs.map → chunk-SR24OGHJ.mjs.map} +0 -0
  288. /package/dist/esm/{chunk-D3Q4BC3I.mjs.map → chunk-STGYDB5E.mjs.map} +0 -0
  289. /package/dist/esm/{chunk-APN6AV5Q.mjs.map → chunk-SWHLSREF.mjs.map} +0 -0
  290. /package/dist/esm/{chunk-L2QXU6F4.mjs.map → chunk-TL7DR54X.mjs.map} +0 -0
  291. /package/dist/esm/{chunk-KUZ2YTJH.mjs.map → chunk-TMW2HIXC.mjs.map} +0 -0
  292. /package/dist/esm/{chunk-R76DHMGR.mjs.map → chunk-TS3PYRAT.mjs.map} +0 -0
  293. /package/dist/esm/{chunk-F3M2UQA4.mjs.map → chunk-TVFIUUVY.mjs.map} +0 -0
  294. /package/dist/esm/{chunk-GMBSQDPO.mjs.map → chunk-U67PFBTL.mjs.map} +0 -0
  295. /package/dist/esm/{chunk-WRRQ7L5K.mjs.map → chunk-WP7WF54Q.mjs.map} +0 -0
  296. /package/dist/esm/{chunk-BWNTSJOC.mjs.map → chunk-WS4RPKL6.mjs.map} +0 -0
  297. /package/dist/esm/{chunk-P2EIZ7WL.mjs.map → chunk-WWZ3METZ.mjs.map} +0 -0
  298. /package/dist/esm/{chunk-S2W4D6NZ.mjs.map → chunk-X4KEZTUQ.mjs.map} +0 -0
  299. /package/dist/esm/{chunk-F76N4MQO.mjs.map → chunk-XH7YKEYR.mjs.map} +0 -0
  300. /package/dist/esm/{chunk-ELYS7CWV.mjs.map → chunk-XK3JFCP3.mjs.map} +0 -0
  301. /package/dist/esm/{chunk-MAMPMCO7.mjs.map → chunk-XONG5JZ4.mjs.map} +0 -0
  302. /package/dist/esm/{chunk-J64ARI4E.mjs.map → chunk-XXHW3ZT3.mjs.map} +0 -0
  303. /package/dist/esm/{chunk-OMV7445F.mjs.map → chunk-Y7F2V3R6.mjs.map} +0 -0
  304. /package/dist/esm/{chunk-P5V7OZNN.mjs.map → chunk-YJCZU6PR.mjs.map} +0 -0
  305. /package/dist/esm/{chunk-5VD4MHB3.mjs.map → chunk-ZGO2SK6F.mjs.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k}from"../../chunk-MDJ66AA3.mjs";import"../../chunk-TQWGQLM6.mjs";import"../../chunk-NWOMSL6K.mjs";import"../../chunk-53RB2PRH.mjs";import"../../chunk-STUXKQVZ.mjs";import"../../chunk-D3Q4BC3I.mjs";import"../../chunk-FZ5EYP3D.mjs";import"../../chunk-2BTTX2KO.mjs";import"../../chunk-VHNX2NUR.mjs";import"../../chunk-GAEAYY44.mjs";import"../../chunk-RXE6NNOL.mjs";import"../../chunk-QPB6EJVM.mjs";import"../../chunk-4HR32TSY.mjs";import"../../chunk-3W2DHZXK.mjs";import"../../chunk-CB6H4VMZ.mjs";import"../../chunk-E4O26ZJB.mjs";import"../../chunk-Y3BATGHX.mjs";import"../../chunk-O2BPA6TS.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-MAMPMCO7.mjs";import"../../chunk-SWNFKKRE.mjs";import"../../chunk-5PCNWXRN.mjs";import"../../chunk-L2QXU6F4.mjs";import"../../chunk-QBSU3L5Q.mjs";import"../../chunk-7VKFXX5Q.mjs";import"../../chunk-SUJLWCRN.mjs";import"../../chunk-YDZBU2DJ.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-A42BPAD4.mjs";import"../../chunk-KUZ2YTJH.mjs";import"../../chunk-BOYYQAB4.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-WRRQ7L5K.mjs";import"../../chunk-ADE6MVXC.mjs";import"../../chunk-HEZ2ZYZA.mjs";import"../../chunk-45IUUCAV.mjs";import"../../chunk-HHGJXVAE.mjs";import"../../chunk-GMBSQDPO.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-GDO6Q2FI.mjs";import"../../chunk-BA4RBST6.mjs";import"../../chunk-G5XLMQ5E.mjs";import"../../chunk-SRPI2FFA.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-F63E4CR7.mjs";import"../../chunk-GWSDIX6C.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-Q4XR6QOZ.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-G5MGSV7Y.mjs";import"../../chunk-OHRL766V.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-YU3IYJRL.mjs";import"../../chunk-CRA2MFJC.mjs";import"../../chunk-XMW65WCQ.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-BSUYPXRD.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-LNEZEYYE.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-44GYWUSH.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-TDGQGILY.mjs";import"../../chunk-EXP5STXZ.mjs";import"../../chunk-UAL27G6B.mjs";import"../../chunk-KEYAPEAX.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-UAEODDZS.mjs";import"../../chunk-FVA2OPG4.mjs";export{f as buildTransaction,e as generateRawTransaction,i as generateSignedTransaction,g as generateSignedTransactionForSimulation,a as generateTransactionPayload,b as generateTransactionPayloadWithABI,k as generateUserTransactionHash,c as generateViewFunctionPayload,d as generateViewFunctionPayloadWithABI,h as getAuthenticatorForSimulation,j as hashValues};
1
+ import{a,b,c,d,e,f,g,h,i,j,k}from"../../chunk-MEWFJJJN.mjs";import"../../chunk-NNRAQP36.mjs";import"../../chunk-3YKAGVHZ.mjs";import"../../chunk-PKXEB7XP.mjs";import"../../chunk-BKEJMQQ6.mjs";import"../../chunk-STGYDB5E.mjs";import"../../chunk-MO4IZXLK.mjs";import"../../chunk-GFGX3QDP.mjs";import"../../chunk-VHNX2NUR.mjs";import"../../chunk-GAEAYY44.mjs";import"../../chunk-46D5QX3G.mjs";import"../../chunk-FRGXKOU5.mjs";import"../../chunk-B6M7QBUO.mjs";import"../../chunk-KYSDF3CA.mjs";import"../../chunk-6RZZIOGH.mjs";import"../../chunk-YHAPZP5A.mjs";import"../../chunk-K2O24YLZ.mjs";import"../../chunk-KXBIA4KR.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-XONG5JZ4.mjs";import"../../chunk-RNTXQYJQ.mjs";import"../../chunk-CVDR5SJR.mjs";import"../../chunk-TL7DR54X.mjs";import"../../chunk-5655UVIK.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-2TQIU7CG.mjs";import"../../chunk-QDIKOQRK.mjs";import"../../chunk-QIW56MUH.mjs";import"../../chunk-LXLISEQ4.mjs";import"../../chunk-E37YRKWK.mjs";import"../../chunk-N5JNKD5F.mjs";import"../../chunk-TMW2HIXC.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-WP7WF54Q.mjs";import"../../chunk-B2CXRZL5.mjs";import"../../chunk-HEZ2ZYZA.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-BD6BJETG.mjs";import"../../chunk-GGR3P2TG.mjs";import"../../chunk-U67PFBTL.mjs";import"../../chunk-LGD5KU56.mjs";import"../../chunk-PNXUYOYI.mjs";import"../../chunk-LG3DAAPD.mjs";import"../../chunk-SRPI2FFA.mjs";import"../../chunk-M2QV232A.mjs";import"../../chunk-3MCYLML2.mjs";import"../../chunk-DAJOX4PL.mjs";import"../../chunk-IMGLHDIA.mjs";import"../../chunk-BF4ZE37Q.mjs";import"../../chunk-Q4XR6QOZ.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-KA6FZNWP.mjs";import"../../chunk-QPP6BX53.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-EV2USF7B.mjs";import"../../chunk-7V6DEA7G.mjs";import"../../chunk-PUZ25PTD.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-BSUYPXRD.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-CCMHWJ3Q.mjs";import"../../chunk-6QGVRNV6.mjs";import"../../chunk-YJCZU6PR.mjs";import"../../chunk-MS4MRLGA.mjs";import"../../chunk-KEYAPEAX.mjs";import"../../chunk-TDGQGILY.mjs";import"../../chunk-44GYWUSH.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-HPZ2S4FE.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-UAL27G6B.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-EXP5STXZ.mjs";import"../../chunk-555I4YHP.mjs";import"../../chunk-FVA2OPG4.mjs";export{f as buildTransaction,e as generateRawTransaction,i as generateSignedTransaction,g as generateSignedTransactionForSimulation,a as generateTransactionPayload,b as generateTransactionPayloadWithABI,k as generateUserTransactionHash,c as generateViewFunctionPayload,d as generateViewFunctionPayloadWithABI,h as getAuthenticatorForSimulation,j as hashValues};
2
2
  //# sourceMappingURL=transactionBuilder.mjs.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s}from"../../chunk-SUJLWCRN.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-WRRQ7L5K.mjs";import"../../chunk-HEZ2ZYZA.mjs";import"../../chunk-45IUUCAV.mjs";import"../../chunk-HHGJXVAE.mjs";import"../../chunk-GMBSQDPO.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-GDO6Q2FI.mjs";import"../../chunk-BA4RBST6.mjs";import"../../chunk-G5XLMQ5E.mjs";import"../../chunk-SRPI2FFA.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-F63E4CR7.mjs";import"../../chunk-GWSDIX6C.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-Q4XR6QOZ.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-G5MGSV7Y.mjs";import"../../chunk-OHRL766V.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-YU3IYJRL.mjs";import"../../chunk-CRA2MFJC.mjs";import"../../chunk-XMW65WCQ.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-BSUYPXRD.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-LNEZEYYE.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-44GYWUSH.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-TDGQGILY.mjs";import"../../chunk-EXP5STXZ.mjs";import"../../chunk-UAL27G6B.mjs";import"../../chunk-KEYAPEAX.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-UAEODDZS.mjs";import"../../chunk-FVA2OPG4.mjs";export{o as StructTag,a as TypeTag,i as TypeTagAddress,b as TypeTagBool,l as TypeTagGeneric,k as TypeTagReference,j as TypeTagSigner,n as TypeTagStruct,g as TypeTagU128,d as TypeTagU16,h as TypeTagU256,e as TypeTagU32,f as TypeTagU64,c as TypeTagU8,m as TypeTagVector,p as aptosCoinStructTag,s as objectStructTag,r as optionStructTag,q as stringStructTag};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s}from"../../chunk-QDIKOQRK.mjs";import"../../chunk-E37YRKWK.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-WP7WF54Q.mjs";import"../../chunk-HEZ2ZYZA.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-BD6BJETG.mjs";import"../../chunk-GGR3P2TG.mjs";import"../../chunk-U67PFBTL.mjs";import"../../chunk-LGD5KU56.mjs";import"../../chunk-PNXUYOYI.mjs";import"../../chunk-LG3DAAPD.mjs";import"../../chunk-SRPI2FFA.mjs";import"../../chunk-M2QV232A.mjs";import"../../chunk-3MCYLML2.mjs";import"../../chunk-DAJOX4PL.mjs";import"../../chunk-IMGLHDIA.mjs";import"../../chunk-BF4ZE37Q.mjs";import"../../chunk-Q4XR6QOZ.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-KA6FZNWP.mjs";import"../../chunk-QPP6BX53.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-EV2USF7B.mjs";import"../../chunk-7V6DEA7G.mjs";import"../../chunk-PUZ25PTD.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-BSUYPXRD.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-CCMHWJ3Q.mjs";import"../../chunk-6QGVRNV6.mjs";import"../../chunk-YJCZU6PR.mjs";import"../../chunk-MS4MRLGA.mjs";import"../../chunk-KEYAPEAX.mjs";import"../../chunk-TDGQGILY.mjs";import"../../chunk-44GYWUSH.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-HPZ2S4FE.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-UAL27G6B.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-EXP5STXZ.mjs";import"../../chunk-555I4YHP.mjs";import"../../chunk-FVA2OPG4.mjs";export{o as StructTag,a as TypeTag,i as TypeTagAddress,b as TypeTagBool,l as TypeTagGeneric,k as TypeTagReference,j as TypeTagSigner,n as TypeTagStruct,g as TypeTagU128,d as TypeTagU16,h as TypeTagU256,e as TypeTagU32,f as TypeTagU64,c as TypeTagU8,m as TypeTagVector,p as aptosCoinStructTag,s as objectStructTag,r as optionStructTag,q as stringStructTag};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{a,b,c}from"../../chunk-NWOMSL6K.mjs";import"../../chunk-SUJLWCRN.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-WRRQ7L5K.mjs";import"../../chunk-HEZ2ZYZA.mjs";import"../../chunk-45IUUCAV.mjs";import"../../chunk-HHGJXVAE.mjs";import"../../chunk-GMBSQDPO.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-GDO6Q2FI.mjs";import"../../chunk-BA4RBST6.mjs";import"../../chunk-G5XLMQ5E.mjs";import"../../chunk-SRPI2FFA.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-F63E4CR7.mjs";import"../../chunk-GWSDIX6C.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-Q4XR6QOZ.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-G5MGSV7Y.mjs";import"../../chunk-OHRL766V.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-YU3IYJRL.mjs";import"../../chunk-CRA2MFJC.mjs";import"../../chunk-XMW65WCQ.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-BSUYPXRD.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-LNEZEYYE.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-44GYWUSH.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-TDGQGILY.mjs";import"../../chunk-EXP5STXZ.mjs";import"../../chunk-UAL27G6B.mjs";import"../../chunk-KEYAPEAX.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-UAEODDZS.mjs";import"../../chunk-FVA2OPG4.mjs";export{b as TypeTagParserError,a as TypeTagParserErrorType,c as parseTypeTag};
1
+ import{a,b,c}from"../../chunk-PKXEB7XP.mjs";import"../../chunk-QDIKOQRK.mjs";import"../../chunk-E37YRKWK.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-WP7WF54Q.mjs";import"../../chunk-HEZ2ZYZA.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-BD6BJETG.mjs";import"../../chunk-GGR3P2TG.mjs";import"../../chunk-U67PFBTL.mjs";import"../../chunk-LGD5KU56.mjs";import"../../chunk-PNXUYOYI.mjs";import"../../chunk-LG3DAAPD.mjs";import"../../chunk-SRPI2FFA.mjs";import"../../chunk-M2QV232A.mjs";import"../../chunk-3MCYLML2.mjs";import"../../chunk-DAJOX4PL.mjs";import"../../chunk-IMGLHDIA.mjs";import"../../chunk-BF4ZE37Q.mjs";import"../../chunk-Q4XR6QOZ.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-KA6FZNWP.mjs";import"../../chunk-QPP6BX53.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-EV2USF7B.mjs";import"../../chunk-7V6DEA7G.mjs";import"../../chunk-PUZ25PTD.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-BSUYPXRD.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-CCMHWJ3Q.mjs";import"../../chunk-6QGVRNV6.mjs";import"../../chunk-YJCZU6PR.mjs";import"../../chunk-MS4MRLGA.mjs";import"../../chunk-KEYAPEAX.mjs";import"../../chunk-TDGQGILY.mjs";import"../../chunk-44GYWUSH.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-HPZ2S4FE.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-UAL27G6B.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-EXP5STXZ.mjs";import"../../chunk-555I4YHP.mjs";import"../../chunk-FVA2OPG4.mjs";export{b as TypeTagParserError,a as TypeTagParserErrorType,c as parseTypeTag};
2
2
  //# sourceMappingURL=parser.mjs.map
@@ -1,2 +1,2 @@
1
- import"../chunk-HGLO5LDS.mjs";import{a as r}from"../chunk-BSUYPXRD.mjs";import{a as j,b as k,c as l,d as m,e as n,f as o,g as p,h as q}from"../chunk-SCHZ67F3.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-LNEZEYYE.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-44GYWUSH.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import{a,b,c,d,e,f,g,h,i}from"../chunk-EXP5STXZ.mjs";import{a as s,b as t,c as u,d as v,e as w,f as x,g as y,h as z}from"../chunk-UAL27G6B.mjs";import"../chunk-KEYAPEAX.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{e as APTOS_COIN,f as APTOS_FA,a as AptosApiType,b as DEFAULT_MAX_GAS_AMOUNT,c as DEFAULT_TXN_EXP_SEC_FROM_NOW,d as DEFAULT_TXN_TIMEOUT_SEC,o as Network,p as NetworkToChainId,l as NetworkToFaucetAPI,j as NetworkToIndexerAPI,q as NetworkToNetworkName,k as NetworkToNodeAPI,m as NetworkToPepperAPI,n as NetworkToProverAPI,i as ProcessorType,g as RAW_TRANSACTION_SALT,h as RAW_TRANSACTION_WITH_DATA_SALT,v as base64UrlDecode,w as convertAmountFromHumanReadableToOnChain,x as convertAmountFromOnChainToHumanReadable,u as floorToWholeHour,z as isEncodedStruct,r as normalizeBundle,t as nowInSeconds,y as parseEncodedStruct,s as sleep};
1
+ import"../chunk-HGLO5LDS.mjs";import{a as r}from"../chunk-BSUYPXRD.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-CCMHWJ3Q.mjs";import"../chunk-6QGVRNV6.mjs";import"../chunk-YJCZU6PR.mjs";import"../chunk-MS4MRLGA.mjs";import"../chunk-KEYAPEAX.mjs";import"../chunk-44GYWUSH.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-HPZ2S4FE.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import{a as s,b as t,c as u,d as v,e as w,f as x,g as y,h as z}from"../chunk-UAL27G6B.mjs";import{a as j,b as k,c as l,d as m,e as n,f as o,g as p,h as q}from"../chunk-SCHZ67F3.mjs";import{a,b,c,d,e,f,g,h,i}from"../chunk-EXP5STXZ.mjs";import"../chunk-FVA2OPG4.mjs";export{e as APTOS_COIN,f as APTOS_FA,a as AptosApiType,b as DEFAULT_MAX_GAS_AMOUNT,c as DEFAULT_TXN_EXP_SEC_FROM_NOW,d as DEFAULT_TXN_TIMEOUT_SEC,o as Network,p as NetworkToChainId,l as NetworkToFaucetAPI,j as NetworkToIndexerAPI,q as NetworkToNetworkName,k as NetworkToNodeAPI,m as NetworkToPepperAPI,n as NetworkToProverAPI,i as ProcessorType,g as RAW_TRANSACTION_SALT,h as RAW_TRANSACTION_WITH_DATA_SALT,v as base64UrlDecode,w as convertAmountFromHumanReadableToOnChain,x as convertAmountFromOnChainToHumanReadable,u as floorToWholeHour,z as isEncodedStruct,r as normalizeBundle,t as nowInSeconds,y as parseEncodedStruct,s as sleep};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-BSUYPXRD.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-LNEZEYYE.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-44GYWUSH.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-KEYAPEAX.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{a as normalizeBundle};
1
+ import{a}from"../chunk-BSUYPXRD.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-CCMHWJ3Q.mjs";import"../chunk-6QGVRNV6.mjs";import"../chunk-YJCZU6PR.mjs";import"../chunk-MS4MRLGA.mjs";import"../chunk-KEYAPEAX.mjs";import"../chunk-44GYWUSH.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-HPZ2S4FE.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-FVA2OPG4.mjs";export{a as normalizeBundle};
2
2
  //# sourceMappingURL=normalizeBundle.mjs.map
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * hardcoded for now, we would want to have it injected dynamically
5
5
  */
6
- declare const VERSION = "1.29.0";
6
+ declare const VERSION = "1.29.1";
7
7
 
8
8
  export { VERSION };
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-UAEODDZS.mjs";import"./chunk-FVA2OPG4.mjs";export{a as VERSION};
1
+ import{a}from"./chunk-555I4YHP.mjs";import"./chunk-FVA2OPG4.mjs";export{a as VERSION};
2
2
  //# sourceMappingURL=version.mjs.map
package/package.json CHANGED
@@ -63,37 +63,37 @@
63
63
  "poseidon-lite": "^0.2.0"
64
64
  },
65
65
  "devDependencies": {
66
- "@babel/traverse": "^7.23.6",
67
- "@cucumber/cucumber": "^10.8.0",
68
- "@graphql-codegen/cli": "^5.0.0",
66
+ "@babel/traverse": "^7.25.7",
67
+ "@cucumber/cucumber": "^11.0.1",
68
+ "@graphql-codegen/cli": "^5.0.2",
69
69
  "@graphql-codegen/import-types-preset": "^3.0.0",
70
- "@graphql-codegen/typescript": "^4.0.1",
71
- "@graphql-codegen/typescript-graphql-request": "^6.0.1",
72
- "@graphql-codegen/typescript-operations": "^4.0.1",
70
+ "@graphql-codegen/typescript": "^4.0.9",
71
+ "@graphql-codegen/typescript-graphql-request": "^6.2.0",
72
+ "@graphql-codegen/typescript-operations": "^4.2.3",
73
73
  "@types/base-64": "^1.0.2",
74
- "@types/jest": "^29.5.11",
75
- "@types/jsonwebtoken": "^9.0.6",
76
- "@types/node": "^20.10.4",
77
- "@typescript-eslint/eslint-plugin": "^6.14.0",
78
- "@typescript-eslint/parser": "^6.14.0",
79
- "dotenv": "^16.3.1",
80
- "eslint": "^8.55.0",
74
+ "@types/jest": "^29.5.13",
75
+ "@types/jsonwebtoken": "^9.0.7",
76
+ "@types/node": "^20.16.10",
77
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
78
+ "@typescript-eslint/parser": "^6.21.0",
79
+ "dotenv": "^16.4.5",
80
+ "eslint": "^8.57.1",
81
81
  "eslint-config-airbnb-base": "^15.0.0",
82
82
  "eslint-config-airbnb-typescript": "^17.1.0",
83
83
  "eslint-config-prettier": "^9.1.0",
84
- "eslint-plugin-import": "^2.29.0",
85
- "graphql": "^16.8.1",
84
+ "eslint-plugin-import": "^2.31.0",
85
+ "graphql": "^16.9.0",
86
86
  "graphql-request": "^6.1.0",
87
87
  "jest": "^29.7.0",
88
88
  "jsonwebtoken": "^9.0.2",
89
- "prettier": "^3.1.1",
89
+ "prettier": "^3.3.3",
90
90
  "tree-kill": "^1.2.2",
91
- "ts-jest": "^29.1.1",
91
+ "ts-jest": "^29.2.5",
92
92
  "ts-loader": "^9.5.1",
93
93
  "ts-node": "^10.9.2",
94
- "tsup": "^8.0.1",
95
- "typedoc": "^0.25.4",
96
- "typescript": "^5.3.3"
94
+ "tsup": "^8.3.0",
95
+ "typedoc": "^0.26.8",
96
+ "typescript": "^5.6.2"
97
97
  },
98
- "version": "1.29.0"
98
+ "version": "1.29.1"
99
99
  }
@@ -96,6 +96,7 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
96
96
  // Use the static constructor 'create' instead.
97
97
  protected constructor(args: {
98
98
  address?: AccountAddress;
99
+ publicKey: KeylessPublicKey | FederatedKeylessPublicKey;
99
100
  ephemeralKeyPair: EphemeralKeyPair;
100
101
  iss: string;
101
102
  uidKey: string;
@@ -107,9 +108,9 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
107
108
  jwt: string;
108
109
  }) {
109
110
  super();
110
- const { address, ephemeralKeyPair, uidKey, uidVal, aud, pepper, proof, proofFetchCallback, jwt } = args;
111
+ const { address, ephemeralKeyPair, publicKey, uidKey, uidVal, aud, pepper, proof, proofFetchCallback, jwt } = args;
111
112
  this.ephemeralKeyPair = ephemeralKeyPair;
112
- this.publicKey = KeylessPublicKey.create(args);
113
+ this.publicKey = publicKey;
113
114
  this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();
114
115
  this.uidKey = uidKey;
115
116
  this.uidVal = uidVal;
@@ -42,8 +42,9 @@ export class FederatedKeylessAccount extends AbstractKeylessAccount {
42
42
  proofFetchCallback?: ProofFetchCallback;
43
43
  jwt: string;
44
44
  }) {
45
- super(args);
46
- this.publicKey = FederatedKeylessPublicKey.create(args);
45
+ const publicKey = FederatedKeylessPublicKey.create(args);
46
+ super({ publicKey, ...args });
47
+ this.publicKey = publicKey;
47
48
  }
48
49
 
49
50
  serialize(serializer: Serializer): void {
@@ -4,7 +4,7 @@
4
4
  import { JwtPayload, jwtDecode } from "jwt-decode";
5
5
  import { HexInput } from "../types";
6
6
  import { AccountAddress } from "../core/accountAddress";
7
- import { ZeroKnowledgeSig } from "../core/crypto";
7
+ import { KeylessPublicKey, ZeroKnowledgeSig } from "../core/crypto";
8
8
 
9
9
  import { EphemeralKeyPair } from "./EphemeralKeyPair";
10
10
  import { Deserializer, Serializer } from "../bcs";
@@ -21,6 +21,11 @@ import { AbstractKeylessAccount, ProofFetchCallback } from "./AbstractKeylessAcc
21
21
  * EphemeralKeyPair, and corresponding proof.
22
22
  */
23
23
  export class KeylessAccount extends AbstractKeylessAccount {
24
+ /**
25
+ * The KeylessPublicKey associated with the account
26
+ */
27
+ readonly publicKey: KeylessPublicKey;
28
+
24
29
  // Use the static constructor 'create' instead.
25
30
  private constructor(args: {
26
31
  address?: AccountAddress;
@@ -34,7 +39,9 @@ export class KeylessAccount extends AbstractKeylessAccount {
34
39
  proofFetchCallback?: ProofFetchCallback;
35
40
  jwt: string;
36
41
  }) {
37
- super(args);
42
+ const publicKey = KeylessPublicKey.create(args);
43
+ super({ publicKey, ...args });
44
+ this.publicKey = publicKey;
38
45
  }
39
46
 
40
47
  serialize(serializer: Serializer): void {
@@ -59,7 +59,7 @@ export async function aptosRequest<Req extends {}, Res extends {}>(
59
59
 
60
60
  const aptosResponse: AptosResponse<Req, Res> = {
61
61
  status: clientResponse.status,
62
- statusText: clientResponse.statusText!,
62
+ statusText: clientResponse.statusText ?? "No status text provided",
63
63
  data: clientResponse.data,
64
64
  headers: clientResponse.headers,
65
65
  config: clientResponse.config,
@@ -400,7 +400,12 @@ export function generateSignedTransactionForSimulation(args: InputSimulateTransa
400
400
  getAuthenticatorForSimulation(publicKey),
401
401
  );
402
402
  }
403
- const feePayerAuthenticator = getAuthenticatorForSimulation(feePayerPublicKey!);
403
+ if (!feePayerPublicKey) {
404
+ throw new Error(
405
+ "Must provide a feePayerPublicKey argument to generate a signed fee payer transaction for simulation",
406
+ );
407
+ }
408
+ const feePayerAuthenticator = getAuthenticatorForSimulation(feePayerPublicKey);
404
409
 
405
410
  const transactionAuthenticator = new TransactionAuthenticatorFeePayer(
406
411
  accountAuthenticator,
@@ -423,7 +428,13 @@ export function generateSignedTransactionForSimulation(args: InputSimulateTransa
423
428
 
424
429
  let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];
425
430
 
426
- secondaryAccountAuthenticators = secondarySignersPublicKeys!.map((publicKey) =>
431
+ if (!secondarySignersPublicKeys) {
432
+ throw new Error(
433
+ "Must provide a secondarySignersPublicKeys argument to generate a signed multi agent transaction for simulation",
434
+ );
435
+ }
436
+
437
+ secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>
427
438
  getAuthenticatorForSimulation(publicKey),
428
439
  );
429
440
 
package/src/version.ts CHANGED
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * hardcoded for now, we would want to have it injected dynamically
8
8
  */
9
- export const VERSION = "1.29.0";
9
+ export const VERSION = "1.29.1";
@@ -1,2 +0,0 @@
1
- import{a as w}from"./chunk-Y3BATGHX.mjs";import{a as f}from"./chunk-ADE6MVXC.mjs";import{a as y}from"./chunk-BA4RBST6.mjs";import{n as u}from"./chunk-G5XLMQ5E.mjs";import{b as c}from"./chunk-OHRL766V.mjs";import{a as l}from"./chunk-KEYAPEAX.mjs";import{jwtDecode as A}from"jwt-decode";var m=class s extends w{constructor(e){super(e),this.publicKey=y.create(e)}serialize(e){if(this.proof===void 0)throw new Error("Cannot serialize - proof undefined");e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.publicKey.jwkAddress.serialize(e),this.ephemeralKeyPair.serialize(e),this.proof.serialize(e)}static deserialize(e){let o=e.deserializeStr(),i=e.deserializeStr(),t=e.deserializeFixedBytes(31),a=c.deserialize(e),d=f.deserialize(e),n=u.deserialize(e);return s.create({proof:n,pepper:t,jwkAddress:a,uidKey:i,jwt:o,ephemeralKeyPair:d})}static fromBytes(e){return s.deserialize(new l(e))}static create(e){let{address:o,proof:i,jwt:t,ephemeralKeyPair:a,pepper:d,jwkAddress:n,uidKey:p="sub",proofFetchCallback:K}=e,r=A(t);if(typeof r.iss!="string")throw new Error("iss was not found");if(typeof r.aud!="string")throw new Error("aud was not found or an array of values");let h=r[p];return new s({address:o,proof:i,ephemeralKeyPair:a,iss:r.iss,uidKey:p,uidVal:h,aud:r.aud,pepper:d,jwkAddress:c.from(n),jwt:t,proofFetchCallback:K})}};export{m as a};
2
- //# sourceMappingURL=chunk-CB6H4VMZ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/account/FederatedKeylessAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { JwtPayload, jwtDecode } from \"jwt-decode\";\nimport { HexInput } from \"../types\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { ZeroKnowledgeSig } from \"../core/crypto\";\n\nimport { EphemeralKeyPair } from \"./EphemeralKeyPair\";\nimport { Deserializer, Serializer } from \"../bcs\";\nimport { FederatedKeylessPublicKey } from \"../core/crypto/federatedKeyless\";\nimport { AbstractKeylessAccount, ProofFetchCallback } from \"./AbstractKeylessAccount\";\n\n/**\n * Account implementation for the FederatedKeyless authentication scheme.\n *\n * Used to represent a FederatedKeyless based account and sign transactions with it.\n *\n * Use FederatedKeylessAccount.create to instantiate a KeylessAccount with a JWT, proof, EphemeralKeyPair and the\n * address the JWKs are installed that will be used to verify the JWT.\n *\n * When the proof expires or the JWT becomes invalid, the KeylessAccount must be instantiated again with a new JWT,\n * EphemeralKeyPair, and corresponding proof.\n */\nexport class FederatedKeylessAccount extends AbstractKeylessAccount {\n /**\n * The FederatedKeylessPublicKey associated with the account\n */\n readonly publicKey: FederatedKeylessPublicKey;\n\n // Use the static constructor 'create' instead.\n private constructor(args: {\n address?: AccountAddress;\n ephemeralKeyPair: EphemeralKeyPair;\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n jwkAddress: AccountAddress;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n proofFetchCallback?: ProofFetchCallback;\n jwt: string;\n }) {\n super(args);\n this.publicKey = FederatedKeylessPublicKey.create(args);\n }\n\n serialize(serializer: Serializer): void {\n if (this.proof === undefined) {\n throw new Error(\"Cannot serialize - proof undefined\");\n }\n serializer.serializeStr(this.jwt);\n serializer.serializeStr(this.uidKey);\n serializer.serializeFixedBytes(this.pepper);\n this.publicKey.jwkAddress.serialize(serializer);\n this.ephemeralKeyPair.serialize(serializer);\n this.proof.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): FederatedKeylessAccount {\n const jwt = deserializer.deserializeStr();\n const uidKey = deserializer.deserializeStr();\n const pepper = deserializer.deserializeFixedBytes(31);\n const jwkAddress = AccountAddress.deserialize(deserializer);\n const ephemeralKeyPair = EphemeralKeyPair.deserialize(deserializer);\n const proof = ZeroKnowledgeSig.deserialize(deserializer);\n return FederatedKeylessAccount.create({\n proof,\n pepper,\n jwkAddress,\n uidKey,\n jwt,\n ephemeralKeyPair,\n });\n }\n\n static fromBytes(bytes: Uint8Array): FederatedKeylessAccount {\n return FederatedKeylessAccount.deserialize(new Deserializer(bytes));\n }\n\n static create(args: {\n address?: AccountAddress;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper: HexInput;\n jwkAddress: AccountAddressInput;\n uidKey?: string;\n proofFetchCallback?: ProofFetchCallback;\n }): FederatedKeylessAccount {\n const { address, proof, jwt, ephemeralKeyPair, pepper, jwkAddress, uidKey = \"sub\", proofFetchCallback } = args;\n\n const jwtPayload = jwtDecode<JwtPayload & { [key: string]: string }>(jwt);\n if (typeof jwtPayload.iss !== \"string\") {\n throw new Error(\"iss was not found\");\n }\n if (typeof jwtPayload.aud !== \"string\") {\n throw new Error(\"aud was not found or an array of values\");\n }\n const uidVal = jwtPayload[uidKey];\n return new FederatedKeylessAccount({\n address,\n proof,\n ephemeralKeyPair,\n iss: jwtPayload.iss,\n uidKey,\n uidVal,\n aud: jwtPayload.aud,\n pepper,\n jwkAddress: AccountAddress.from(jwkAddress),\n jwt,\n proofFetchCallback,\n });\n }\n}\n"],"mappings":"sPAGA,OAAqB,aAAAA,MAAiB,aAqB/B,IAAMC,EAAN,MAAMC,UAAgCC,CAAuB,CAO1D,YAAYC,EAYjB,CACD,MAAMA,CAAI,EACV,KAAK,UAAYC,EAA0B,OAAOD,CAAI,CACxD,CAEA,UAAUE,EAA8B,CACtC,GAAI,KAAK,QAAU,OACjB,MAAM,IAAI,MAAM,oCAAoC,EAEtDA,EAAW,aAAa,KAAK,GAAG,EAChCA,EAAW,aAAa,KAAK,MAAM,EACnCA,EAAW,oBAAoB,KAAK,MAAM,EAC1C,KAAK,UAAU,WAAW,UAAUA,CAAU,EAC9C,KAAK,iBAAiB,UAAUA,CAAU,EAC1C,KAAK,MAAM,UAAUA,CAAU,CACjC,CAEA,OAAO,YAAYC,EAAqD,CACtE,IAAMC,EAAMD,EAAa,eAAe,EAClCE,EAASF,EAAa,eAAe,EACrCG,EAASH,EAAa,sBAAsB,EAAE,EAC9CI,EAAaC,EAAe,YAAYL,CAAY,EACpDM,EAAmBC,EAAiB,YAAYP,CAAY,EAC5DQ,EAAQC,EAAiB,YAAYT,CAAY,EACvD,OAAOL,EAAwB,OAAO,CACpC,MAAAa,EACA,OAAAL,EACA,WAAAC,EACA,OAAAF,EACA,IAAAD,EACA,iBAAAK,CACF,CAAC,CACH,CAEA,OAAO,UAAUI,EAA4C,CAC3D,OAAOf,EAAwB,YAAY,IAAIgB,EAAaD,CAAK,CAAC,CACpE,CAEA,OAAO,OAAOb,EASc,CAC1B,GAAM,CAAE,QAAAe,EAAS,MAAAJ,EAAO,IAAAP,EAAK,iBAAAK,EAAkB,OAAAH,EAAQ,WAAAC,EAAY,OAAAF,EAAS,MAAO,mBAAAW,CAAmB,EAAIhB,EAEpGiB,EAAaC,EAAkDd,CAAG,EACxE,GAAI,OAAOa,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,mBAAmB,EAErC,GAAI,OAAOA,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,yCAAyC,EAE3D,IAAME,EAASF,EAAWZ,CAAM,EAChC,OAAO,IAAIP,EAAwB,CACjC,QAAAiB,EACA,MAAAJ,EACA,iBAAAF,EACA,IAAKQ,EAAW,IAChB,OAAAZ,EACA,OAAAc,EACA,IAAKF,EAAW,IAChB,OAAAX,EACA,WAAYE,EAAe,KAAKD,CAAU,EAC1C,IAAAH,EACA,mBAAAY,CACF,CAAC,CACH,CACF","names":["jwtDecode","FederatedKeylessAccount","_FederatedKeylessAccount","AbstractKeylessAccount","args","FederatedKeylessPublicKey","serializer","deserializer","jwt","uidKey","pepper","jwkAddress","AccountAddress","ephemeralKeyPair","EphemeralKeyPair","proof","ZeroKnowledgeSig","bytes","Deserializer","address","proofFetchCallback","jwtPayload","jwtDecode","uidVal"]}
@@ -1,2 +0,0 @@
1
- import{a as u}from"./chunk-Y3BATGHX.mjs";import{a as c}from"./chunk-ADE6MVXC.mjs";import{n as l}from"./chunk-G5XLMQ5E.mjs";import{a as d}from"./chunk-KEYAPEAX.mjs";import{jwtDecode as w}from"jwt-decode";var f=class t extends u{constructor(e){super(e)}serialize(e){if(e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof===void 0)throw new Error("Cannot serialize - proof undefined");this.proof.serialize(e)}static deserialize(e){let i=e.deserializeStr(),s=e.deserializeStr(),o=e.deserializeFixedBytes(31),a=c.deserialize(e),n=l.deserialize(e);return t.create({proof:n,pepper:o,uidKey:s,jwt:i,ephemeralKeyPair:a})}static fromBytes(e){return t.deserialize(new d(e))}static create(e){let{address:i,proof:s,jwt:o,ephemeralKeyPair:a,pepper:n,uidKey:p="sub",proofFetchCallback:y}=e,r=w(o);if(typeof r.iss!="string")throw new Error("iss was not found");if(typeof r.aud!="string")throw new Error("aud was not found or an array of values");let m=r[p];return new t({address:i,proof:s,ephemeralKeyPair:a,iss:r.iss,uidKey:p,uidVal:m,aud:r.aud,pepper:n,jwt:o,proofFetchCallback:y})}};export{f as a};
2
- //# sourceMappingURL=chunk-E4O26ZJB.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/account/KeylessAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { JwtPayload, jwtDecode } from \"jwt-decode\";\nimport { HexInput } from \"../types\";\nimport { AccountAddress } from \"../core/accountAddress\";\nimport { ZeroKnowledgeSig } from \"../core/crypto\";\n\nimport { EphemeralKeyPair } from \"./EphemeralKeyPair\";\nimport { Deserializer, Serializer } from \"../bcs\";\nimport { AbstractKeylessAccount, ProofFetchCallback } from \"./AbstractKeylessAccount\";\n\n/**\n * Account implementation for the Keyless authentication scheme.\n *\n * Used to represent a Keyless based account and sign transactions with it.\n *\n * Use KeylessAccount.create to instantiate a KeylessAccount with a JWT, proof and EphemeralKeyPair.\n *\n * When the proof expires or the JWT becomes invalid, the KeylessAccount must be instantiated again with a new JWT,\n * EphemeralKeyPair, and corresponding proof.\n */\nexport class KeylessAccount extends AbstractKeylessAccount {\n // Use the static constructor 'create' instead.\n private constructor(args: {\n address?: AccountAddress;\n ephemeralKeyPair: EphemeralKeyPair;\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n proofFetchCallback?: ProofFetchCallback;\n jwt: string;\n }) {\n super(args);\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeStr(this.jwt);\n serializer.serializeStr(this.uidKey);\n serializer.serializeFixedBytes(this.pepper);\n this.ephemeralKeyPair.serialize(serializer);\n if (this.proof === undefined) {\n throw new Error(\"Cannot serialize - proof undefined\");\n }\n this.proof.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): KeylessAccount {\n const jwt = deserializer.deserializeStr();\n const uidKey = deserializer.deserializeStr();\n const pepper = deserializer.deserializeFixedBytes(31);\n const ephemeralKeyPair = EphemeralKeyPair.deserialize(deserializer);\n const proof = ZeroKnowledgeSig.deserialize(deserializer);\n return KeylessAccount.create({\n proof,\n pepper,\n uidKey,\n jwt,\n ephemeralKeyPair,\n });\n }\n\n static fromBytes(bytes: Uint8Array): KeylessAccount {\n return KeylessAccount.deserialize(new Deserializer(bytes));\n }\n\n static create(args: {\n address?: AccountAddress;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper: HexInput;\n uidKey?: string;\n proofFetchCallback?: ProofFetchCallback;\n }): KeylessAccount {\n const { address, proof, jwt, ephemeralKeyPair, pepper, uidKey = \"sub\", proofFetchCallback } = args;\n\n const jwtPayload = jwtDecode<JwtPayload & { [key: string]: string }>(jwt);\n if (typeof jwtPayload.iss !== \"string\") {\n throw new Error(\"iss was not found\");\n }\n if (typeof jwtPayload.aud !== \"string\") {\n throw new Error(\"aud was not found or an array of values\");\n }\n const uidVal = jwtPayload[uidKey];\n return new KeylessAccount({\n address,\n proof,\n ephemeralKeyPair,\n iss: jwtPayload.iss,\n uidKey,\n uidVal,\n aud: jwtPayload.aud,\n pepper,\n jwt,\n proofFetchCallback,\n });\n }\n}\n"],"mappings":"oKAGA,OAAqB,aAAAA,MAAiB,aAmB/B,IAAMC,EAAN,MAAMC,UAAuBC,CAAuB,CAEjD,YAAYC,EAWjB,CACD,MAAMA,CAAI,CACZ,CAEA,UAAUC,EAA8B,CAKtC,GAJAA,EAAW,aAAa,KAAK,GAAG,EAChCA,EAAW,aAAa,KAAK,MAAM,EACnCA,EAAW,oBAAoB,KAAK,MAAM,EAC1C,KAAK,iBAAiB,UAAUA,CAAU,EACtC,KAAK,QAAU,OACjB,MAAM,IAAI,MAAM,oCAAoC,EAEtD,KAAK,MAAM,UAAUA,CAAU,CACjC,CAEA,OAAO,YAAYC,EAA4C,CAC7D,IAAMC,EAAMD,EAAa,eAAe,EAClCE,EAASF,EAAa,eAAe,EACrCG,EAASH,EAAa,sBAAsB,EAAE,EAC9CI,EAAmBC,EAAiB,YAAYL,CAAY,EAC5DM,EAAQC,EAAiB,YAAYP,CAAY,EACvD,OAAOJ,EAAe,OAAO,CAC3B,MAAAU,EACA,OAAAH,EACA,OAAAD,EACA,IAAAD,EACA,iBAAAG,CACF,CAAC,CACH,CAEA,OAAO,UAAUI,EAAmC,CAClD,OAAOZ,EAAe,YAAY,IAAIa,EAAaD,CAAK,CAAC,CAC3D,CAEA,OAAO,OAAOV,EAQK,CACjB,GAAM,CAAE,QAAAY,EAAS,MAAAJ,EAAO,IAAAL,EAAK,iBAAAG,EAAkB,OAAAD,EAAQ,OAAAD,EAAS,MAAO,mBAAAS,CAAmB,EAAIb,EAExFc,EAAaC,EAAkDZ,CAAG,EACxE,GAAI,OAAOW,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,mBAAmB,EAErC,GAAI,OAAOA,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,yCAAyC,EAE3D,IAAME,EAASF,EAAWV,CAAM,EAChC,OAAO,IAAIN,EAAe,CACxB,QAAAc,EACA,MAAAJ,EACA,iBAAAF,EACA,IAAKQ,EAAW,IAChB,OAAAV,EACA,OAAAY,EACA,IAAKF,EAAW,IAChB,OAAAT,EACA,IAAAF,EACA,mBAAAU,CACF,CAAC,CACH,CACF","names":["jwtDecode","KeylessAccount","_KeylessAccount","AbstractKeylessAccount","args","serializer","deserializer","jwt","uidKey","pepper","ephemeralKeyPair","EphemeralKeyPair","proof","ZeroKnowledgeSig","bytes","Deserializer","address","proofFetchCallback","jwtPayload","jwtDecode","uidVal"]}
@@ -1,2 +0,0 @@
1
- import{a as l,c as an,d as rn,e as R}from"./chunk-TQWGQLM6.mjs";import{r as en,u as y}from"./chunk-53RB2PRH.mjs";import{a as nn}from"./chunk-STUXKQVZ.mjs";import{b as tn}from"./chunk-FZ5EYP3D.mjs";import{a as Y}from"./chunk-2BTTX2KO.mjs";import{a as Q}from"./chunk-MAMPMCO7.mjs";import{a as A}from"./chunk-5PCNWXRN.mjs";import{a as J}from"./chunk-L2QXU6F4.mjs";import{a as L,c as Z,d as j}from"./chunk-QBSU3L5Q.mjs";import{c as O,d as V,e as q,f as x,g as H,h as X,i as z}from"./chunk-7VKFXX5Q.mjs";import{b as E,d as B,e as F,f as D}from"./chunk-A42BPAD4.mjs";import{a as k,b as p,d as g}from"./chunk-KUZ2YTJH.mjs";import{a as v}from"./chunk-BOYYQAB4.mjs";import{a as S,b}from"./chunk-GMBSQDPO.mjs";import{a as N}from"./chunk-GDO6Q2FI.mjs";import{a as K}from"./chunk-BA4RBST6.mjs";import{i as P,j as _}from"./chunk-G5XLMQ5E.mjs";import{b as $,d as M}from"./chunk-GWSDIX6C.mjs";import{b as u}from"./chunk-OHRL766V.mjs";import{a as C}from"./chunk-AH44UPM4.mjs";import{a as U}from"./chunk-BSUYPXRD.mjs";import{g as I}from"./chunk-SCHZ67F3.mjs";import{b as w}from"./chunk-BCUSI3N6.mjs";import{b as W,c as G}from"./chunk-EXP5STXZ.mjs";import{sha3_256 as mn}from"@noble/hashes/sha3";async function vn(n){if(en(n))return fn(n);let{moduleAddress:t,moduleName:e,functionName:i}=y(n.function),a=await sn({key:"entry-function",moduleAddress:t,moduleName:e,functionName:i,aptosConfig:n.aptosConfig,abi:n.abi,fetch:an});return An({...n,abi:a})}function An(n){let t=n.abi,{moduleAddress:e,moduleName:i,functionName:a}=y(n.function),r=l(n.typeArguments);if(r.length!==t.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${t.typeParameters.length}, received ${r.length}`);let o=n.functionArguments.map((s,d)=>R(n.function,t,s,d,r));if(o.length!==t.parameters.length)throw new Error(`Too few arguments for '${e}::${i}::${a}', expected ${t.parameters.length} but got ${o.length}`);let c=x.build(`${e}::${i}`,a,r,o);if("multisigAddress"in n){let s=u.from(n.multisigAddress);return new q(new X(s,new z(c)))}return new V(c)}async function On(n){let{moduleAddress:t,moduleName:e,functionName:i}=y(n.function),a=await sn({key:"view-function",moduleAddress:t,moduleName:e,functionName:i,aptosConfig:n.aptosConfig,abi:n.abi,fetch:rn});return yn({abi:a,...n})}function yn(n){let t=n.abi,{moduleAddress:e,moduleName:i,functionName:a}=y(n.function),r=l(n.typeArguments);if(r.length!==t.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${t.typeParameters.length}, received ${r.length}`);let o=n?.functionArguments?.map((c,s)=>R(n.function,t,c,s,r))??[];if(o.length!==t.parameters.length)throw new Error(`Too few arguments for '${e}::${i}::${a}', expected ${t.parameters.length} but got ${o.length}`);return x.build(`${e}::${i}`,a,r,o)}function fn(n){return new O(new H(w.fromHexInput(n.bytecode).toUint8Array(),l(n.typeArguments),n.functionArguments))}async function pn(n){let{aptosConfig:t,sender:e,payload:i,options:a,feePayerAddress:r}=n,o=async()=>I[t.network]?{chainId:I[t.network]}:{chainId:(await Y({aptosConfig:t})).chain_id},c=async()=>a?.gasUnitPrice?{gasEstimate:a.gasUnitPrice}:{gasEstimate:(await tn({aptosConfig:t})).gas_estimate},s=async()=>{let f=async()=>a?.accountSequenceNumber!==void 0?a.accountSequenceNumber:(await nn({aptosConfig:t,accountAddress:e})).sequence_number;if(r&&u.from(r).equals(u.ZERO))try{return await f()}catch{return 0}else return f()},[{chainId:d},{gasEstimate:m},h]=await Promise.all([o(),c(),s()]),{maxGasAmount:cn,gasUnitPrice:un,expireTimestamp:dn}={maxGasAmount:a?.maxGasAmount?BigInt(a.maxGasAmount):BigInt(2e5),gasUnitPrice:a?.gasUnitPrice??BigInt(m),expireTimestamp:a?.expireTimestamp??BigInt(Math.floor(Date.now()/1e3)+20)};return new L(u.from(e),BigInt(h),i,BigInt(cn),BigInt(un),BigInt(dn),new v(d))}async function Vn(n){let{aptosConfig:t,sender:e,payload:i,options:a,feePayerAddress:r}=n,o=await pn({aptosConfig:t,sender:e,payload:i,options:a,feePayerAddress:r});if("secondarySignerAddresses"in n){let c=n.secondarySignerAddresses?.map(s=>u.from(s))??[];return new Q(o,c,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}return new J(o,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}function qn(n){let{signerPublicKey:t,transaction:e,secondarySignersPublicKeys:i,feePayerPublicKey:a}=n,r=T(t);if(e.feePayerAddress){let c=new j(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress),s=[];i&&(s=i.map(h=>T(h)));let d=T(a),m=new F(r,e.secondarySignerAddresses??[],s,{address:e.feePayerAddress,authenticator:d});return new A(c.raw_txn,m).bcsToBytes()}if(e.secondarySignerAddresses){let c=new Z(e.rawTransaction,e.secondarySignerAddresses),s=[];s=i.map(m=>T(m));let d=new B(r,e.secondarySignerAddresses,s);return new A(c.raw_txn,d).bcsToBytes()}let o;if(r instanceof p)o=new E(r.public_key,r.signature);else if(r instanceof g)o=new D(r);else throw new Error("Invalid public key");return new A(e.rawTransaction,o).bcsToBytes()}function T(n){let e=P.isInstance(n)||K.isInstance(n)||N.isInstance(n)?new S(n):n,i=new M(new Uint8Array(64));if($.isInstance(e))return new p(e,i);if(S.isInstance(e))return P.isInstance(e.publicKey)?new g(e,new b(_.getSimulationSignature())):new g(e,new b(i));throw new Error("Unsupported public key")}function gn(n){let{transaction:t,feePayerAuthenticator:e,additionalSignersAuthenticators:i}=n,a=U(k,n.senderAuthenticator),r;if(t.feePayerAddress){if(!e)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");r=new F(a,t.secondarySignerAddresses??[],i??[],{address:t.feePayerAddress,authenticator:e})}else if(t.secondarySignerAddresses){if(!i)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");r=new B(a,t.secondarySignerAddresses,i)}else a instanceof p?r=new E(a.public_key,a.signature):r=new D(a);return new A(t.rawTransaction,r).bcsToBytes()}function on(n){let t=mn.create();for(let e of n)t.update(e);return t.digest()}var ln=on(["APTOS::Transaction"]);function Hn(n){let t=gn(n);return new w(on([ln,new Uint8Array([0]),t])).toString()}async function sn({key:n,moduleAddress:t,moduleName:e,functionName:i,aptosConfig:a,abi:r,fetch:o}){return r!==void 0?r:C(async()=>o(t,e,i,a),`${n}-${a.network}-${t}-${e}-${i}`,1e3*60*5)()}export{vn as a,An as b,On as c,yn as d,pn as e,Vn as f,qn as g,T as h,gn as i,on as j,Hn as k};
2
- //# sourceMappingURL=chunk-MDJ66AA3.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/transactions/transactionBuilder/transactionBuilder.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file handles the transaction creation lifecycle.\n * It holds different operations to generate a transaction payload, a raw transaction,\n * and a signed transaction that can be simulated, signed and submitted to chain.\n */\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { AccountAddress, AccountAddressInput, Hex, PublicKey } from \"../../core\";\nimport {\n AnyPublicKey,\n AnySignature,\n KeylessPublicKey,\n KeylessSignature,\n Secp256k1PublicKey,\n FederatedKeylessPublicKey,\n} from \"../../core/crypto\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"../../core/crypto/ed25519\";\nimport { getInfo } from \"../../internal/account\";\nimport { getLedgerInfo } from \"../../internal/general\";\nimport { getGasPriceEstimation } from \"../../internal/transaction\";\nimport { NetworkToChainId } from \"../../utils/apiEndpoints\";\nimport { DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW } from \"../../utils/const\";\nimport { normalizeBundle } from \"../../utils/normalizeBundle\";\nimport {\n AccountAuthenticator,\n AccountAuthenticatorEd25519,\n AccountAuthenticatorSingleKey,\n} from \"../authenticator/account\";\nimport {\n TransactionAuthenticator,\n TransactionAuthenticatorEd25519,\n TransactionAuthenticatorFeePayer,\n TransactionAuthenticatorMultiAgent,\n TransactionAuthenticatorSingleSender,\n} from \"../authenticator/transaction\";\nimport {\n ChainId,\n EntryFunction,\n FeePayerRawTransaction,\n MultiAgentRawTransaction,\n MultiSig,\n MultiSigTransactionPayload,\n RawTransaction,\n Script,\n TransactionPayloadEntryFunction,\n TransactionPayloadMultiSig,\n TransactionPayloadScript,\n} from \"../instances\";\nimport { SignedTransaction } from \"../instances/signedTransaction\";\nimport {\n AnyRawTransaction,\n AnyTransactionPayloadInstance,\n EntryFunctionArgumentTypes,\n InputGenerateMultiAgentRawTransactionArgs,\n InputGenerateRawTransactionArgs,\n InputGenerateSingleSignerRawTransactionArgs,\n InputGenerateTransactionOptions,\n InputScriptData,\n InputSimulateTransactionData,\n InputMultiSigDataWithRemoteABI,\n InputEntryFunctionDataWithRemoteABI,\n InputGenerateTransactionPayloadDataWithRemoteABI,\n InputSubmitTransactionData,\n InputGenerateTransactionPayloadDataWithABI,\n InputEntryFunctionDataWithABI,\n InputMultiSigDataWithABI,\n InputViewFunctionDataWithRemoteABI,\n InputViewFunctionDataWithABI,\n FunctionABI,\n} from \"../types\";\nimport { convertArgument, fetchEntryFunctionAbi, fetchViewFunctionAbi, standardizeTypeTags } from \"./remoteAbi\";\nimport { memoizeAsync } from \"../../utils/memoize\";\nimport { getFunctionParts, isScriptDataInput } from \"./helpers\";\nimport { SimpleTransaction } from \"../instances/simpleTransaction\";\nimport { MultiAgentTransaction } from \"../instances/multiAgentTransaction\";\n\n/**\n * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for our `generateTransactionPayload` function.\n * When we call our `generateTransactionPayload` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n */\nexport async function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;\nexport async function generateTransactionPayload(\n args: InputEntryFunctionDataWithRemoteABI,\n): Promise<TransactionPayloadEntryFunction>;\nexport async function generateTransactionPayload(\n args: InputMultiSigDataWithRemoteABI,\n): Promise<TransactionPayloadMultiSig>;\n\n/**\n * Builds a transaction payload based on the data argument and returns\n * a transaction payload - TransactionPayloadScript | TransactionPayloadMultiSig | TransactionPayloadEntryFunction\n *\n * This uses the RemoteABI by default, and the remote ABI can be skipped by using generateTransactionPayloadWithABI\n *\n * @param args.data GenerateTransactionPayloadData\n *\n * @return TransactionPayload\n */\nexport async function generateTransactionPayload(\n args: InputGenerateTransactionPayloadDataWithRemoteABI,\n): Promise<AnyTransactionPayloadInstance> {\n if (isScriptDataInput(args)) {\n return generateTransactionPayloadScript(args);\n }\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n const functionAbi = await fetchAbi({\n key: \"entry-function\",\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig: args.aptosConfig,\n abi: args.abi,\n fetch: fetchEntryFunctionAbi,\n });\n\n // Fill in the ABI\n return generateTransactionPayloadWithABI({ ...args, abi: functionAbi });\n}\n\nexport function generateTransactionPayloadWithABI(args: InputEntryFunctionDataWithABI): TransactionPayloadEntryFunction;\nexport function generateTransactionPayloadWithABI(args: InputMultiSigDataWithABI): TransactionPayloadMultiSig;\nexport function generateTransactionPayloadWithABI(\n args: InputGenerateTransactionPayloadDataWithABI,\n): AnyTransactionPayloadInstance {\n const functionAbi = args.abi;\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n // Ensure that all type arguments are typed properly\n const typeArguments = standardizeTypeTags(args.typeArguments);\n\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n // Check all BCS types, and convert any non-BCS types\n const functionArguments: Array<EntryFunctionArgumentTypes> = args.functionArguments.map((arg, i) =>\n convertArgument(args.function, functionAbi, arg, i, typeArguments),\n );\n\n // Check that all arguments are accounted for\n if (functionArguments.length !== functionAbi.parameters.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,\n );\n }\n\n // Generate entry function payload\n const entryFunctionPayload = EntryFunction.build(\n `${moduleAddress}::${moduleName}`,\n functionName,\n typeArguments,\n functionArguments,\n );\n\n // Send it as multi sig if it's a multisig payload\n if (\"multisigAddress\" in args) {\n const multisigAddress = AccountAddress.from(args.multisigAddress);\n return new TransactionPayloadMultiSig(\n new MultiSig(multisigAddress, new MultiSigTransactionPayload(entryFunctionPayload)),\n );\n }\n\n // Otherwise send as an entry function\n return new TransactionPayloadEntryFunction(entryFunctionPayload);\n}\n\nexport async function generateViewFunctionPayload(args: InputViewFunctionDataWithRemoteABI): Promise<EntryFunction> {\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n const functionAbi = await fetchAbi({\n key: \"view-function\",\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig: args.aptosConfig,\n abi: args.abi,\n fetch: fetchViewFunctionAbi,\n });\n\n // Fill in the ABI\n return generateViewFunctionPayloadWithABI({ abi: functionAbi, ...args });\n}\n\nexport function generateViewFunctionPayloadWithABI(args: InputViewFunctionDataWithABI): EntryFunction {\n const functionAbi = args.abi;\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n // Ensure that all type arguments are typed properly\n const typeArguments = standardizeTypeTags(args.typeArguments);\n\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n // Check all BCS types, and convert any non-BCS types\n const functionArguments: Array<EntryFunctionArgumentTypes> =\n args?.functionArguments?.map((arg, i) => convertArgument(args.function, functionAbi, arg, i, typeArguments)) ?? [];\n\n // Check that all arguments are accounted for\n if (functionArguments.length !== functionAbi.parameters.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,\n );\n }\n\n // Generate entry function payload\n return EntryFunction.build(`${moduleAddress}::${moduleName}`, functionName, typeArguments, functionArguments);\n}\n\nfunction generateTransactionPayloadScript(args: InputScriptData) {\n return new TransactionPayloadScript(\n new Script(\n Hex.fromHexInput(args.bytecode).toUint8Array(),\n standardizeTypeTags(args.typeArguments),\n args.functionArguments,\n ),\n );\n}\n\n/**\n * Generates a raw transaction\n *\n * @param args.aptosConfig AptosConfig\n * @param args.sender The transaction's sender account address as a hex input\n * @param args.payload The transaction payload - can create by using generateTransactionPayload()\n *\n * @returns RawTransaction\n */\nexport async function generateRawTransaction(args: {\n aptosConfig: AptosConfig;\n sender: AccountAddressInput;\n payload: AnyTransactionPayloadInstance;\n options?: InputGenerateTransactionOptions;\n feePayerAddress?: AccountAddressInput;\n}): Promise<RawTransaction> {\n const { aptosConfig, sender, payload, options, feePayerAddress } = args;\n\n const getChainId = async () => {\n if (NetworkToChainId[aptosConfig.network]) {\n return { chainId: NetworkToChainId[aptosConfig.network] };\n }\n const info = await getLedgerInfo({ aptosConfig });\n return { chainId: info.chain_id };\n };\n\n const getGasUnitPrice = async () => {\n if (options?.gasUnitPrice) {\n return { gasEstimate: options.gasUnitPrice };\n }\n const estimation = await getGasPriceEstimation({ aptosConfig });\n return { gasEstimate: estimation.gas_estimate };\n };\n\n const getSequenceNumberForAny = async () => {\n const getSequenceNumber = async () => {\n if (options?.accountSequenceNumber !== undefined) {\n return options.accountSequenceNumber;\n }\n\n return (await getInfo({ aptosConfig, accountAddress: sender })).sequence_number;\n };\n\n /**\n * Check if is sponsored transaction to honor AIP-52\n * {@link https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-52.md}\n */\n if (feePayerAddress && AccountAddress.from(feePayerAddress).equals(AccountAddress.ZERO)) {\n // Handle sponsored transaction generation with the option that\n // the main signer has not been created on chain\n try {\n // Check if main signer has been created on chain, if not assign sequence number 0\n return await getSequenceNumber();\n } catch (e: any) {\n return 0;\n }\n } else {\n return getSequenceNumber();\n }\n };\n const [{ chainId }, { gasEstimate }, sequenceNumber] = await Promise.all([\n getChainId(),\n getGasUnitPrice(),\n getSequenceNumberForAny(),\n ]);\n\n const { maxGasAmount, gasUnitPrice, expireTimestamp } = {\n maxGasAmount: options?.maxGasAmount ? BigInt(options.maxGasAmount) : BigInt(DEFAULT_MAX_GAS_AMOUNT),\n gasUnitPrice: options?.gasUnitPrice ?? BigInt(gasEstimate),\n expireTimestamp: options?.expireTimestamp ?? BigInt(Math.floor(Date.now() / 1000) + DEFAULT_TXN_EXP_SEC_FROM_NOW),\n };\n\n return new RawTransaction(\n AccountAddress.from(sender),\n BigInt(sequenceNumber),\n payload,\n BigInt(maxGasAmount),\n BigInt(gasUnitPrice),\n BigInt(expireTimestamp),\n new ChainId(chainId),\n );\n}\n\n/**\n * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for our `generateTransaction` function.\n * When we call our `generateTransaction` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n */\nexport async function buildTransaction(args: InputGenerateSingleSignerRawTransactionArgs): Promise<SimpleTransaction>;\nexport async function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<MultiAgentTransaction>;\n\n/**\n * Generates a transaction based on the provided arguments\n *\n * Note: we can start with one function to support all different payload/transaction types,\n * and if to complex to use, we could have function for each type\n *\n * @param args.aptosConfig AptosConfig\n * @param args.sender The transaction's sender account address as a hex input\n * @param args.payload The transaction payload - can create by using generateTransactionPayload()\n * @param args.options optional. Transaction options object\n * @param args.secondarySignerAddresses optional. For when want to create a multi signers transaction\n * @param args.feePayerAddress optional. For when want to create a fee payer (aka sponsored) transaction\n *\n * @return An instance of a RawTransaction, plus optional secondary/fee payer addresses\n * ```\n * {\n * rawTransaction: RawTransaction,\n * secondarySignerAddresses? : Array<AccountAddress>,\n * feePayerAddress?: AccountAddress\n * }\n * ```\n */\nexport async function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction> {\n const { aptosConfig, sender, payload, options, feePayerAddress } = args;\n // generate raw transaction\n const rawTxn = await generateRawTransaction({\n aptosConfig,\n sender,\n payload,\n options,\n feePayerAddress,\n });\n\n // if multi agent transaction\n if (\"secondarySignerAddresses\" in args) {\n const signers: Array<AccountAddress> =\n args.secondarySignerAddresses?.map((signer) => AccountAddress.from(signer)) ?? [];\n\n return new MultiAgentTransaction(\n rawTxn,\n signers,\n args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined,\n );\n }\n // return the raw transaction\n return new SimpleTransaction(rawTxn, args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined);\n}\n\n/**\n * Simulate a transaction before signing and submit to chain\n *\n * @param args.transaction A aptos transaction type to sign\n * @param args.signerPublicKey The signer public key\n * @param args.secondarySignersPublicKeys optional. The secondary signers public keys if multi signers transaction\n * @param args.feePayerPublicKey optional. The fee payer public key is a fee payer (aka sponsored) transaction\n * @param args.options optional. SimulateTransactionOptions\n *\n * @returns A signed serialized transaction that can be simulated\n */\nexport function generateSignedTransactionForSimulation(args: InputSimulateTransactionData): Uint8Array {\n const { signerPublicKey, transaction, secondarySignersPublicKeys, feePayerPublicKey } = args;\n\n const accountAuthenticator = getAuthenticatorForSimulation(signerPublicKey);\n\n // fee payer transaction\n if (transaction.feePayerAddress) {\n const transactionToSign = new FeePayerRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses ?? [],\n transaction.feePayerAddress,\n );\n let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];\n if (secondarySignersPublicKeys) {\n secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n }\n const feePayerAuthenticator = getAuthenticatorForSimulation(feePayerPublicKey!);\n\n const transactionAuthenticator = new TransactionAuthenticatorFeePayer(\n accountAuthenticator,\n transaction.secondarySignerAddresses ?? [],\n secondaryAccountAuthenticators,\n {\n address: transaction.feePayerAddress,\n authenticator: feePayerAuthenticator,\n },\n );\n return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();\n }\n\n // multi agent transaction\n if (transaction.secondarySignerAddresses) {\n const transactionToSign = new MultiAgentRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses,\n );\n\n let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];\n\n secondaryAccountAuthenticators = secondarySignersPublicKeys!.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n\n const transactionAuthenticator = new TransactionAuthenticatorMultiAgent(\n accountAuthenticator,\n transaction.secondarySignerAddresses,\n secondaryAccountAuthenticators,\n );\n\n return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();\n }\n\n // single signer raw transaction\n let transactionAuthenticator;\n if (accountAuthenticator instanceof AccountAuthenticatorEd25519) {\n transactionAuthenticator = new TransactionAuthenticatorEd25519(\n accountAuthenticator.public_key,\n accountAuthenticator.signature,\n );\n } else if (accountAuthenticator instanceof AccountAuthenticatorSingleKey) {\n transactionAuthenticator = new TransactionAuthenticatorSingleSender(accountAuthenticator);\n } else {\n throw new Error(\"Invalid public key\");\n }\n return new SignedTransaction(transaction.rawTransaction, transactionAuthenticator).bcsToBytes();\n}\n\nexport function getAuthenticatorForSimulation(publicKey: PublicKey) {\n // Wrap the public key types below with AnyPublicKey as they are only support through single sender.\n // Learn more about AnyPublicKey here - https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-55.md\n const convertToAnyPublicKey =\n KeylessPublicKey.isInstance(publicKey) ||\n FederatedKeylessPublicKey.isInstance(publicKey) ||\n Secp256k1PublicKey.isInstance(publicKey);\n const accountPublicKey = convertToAnyPublicKey ? new AnyPublicKey(publicKey) : publicKey;\n\n // No need to for the signature to be matching in scheme. All that matters for simulations is that it's not valid\n const invalidSignature = new Ed25519Signature(new Uint8Array(64));\n\n if (Ed25519PublicKey.isInstance(accountPublicKey)) {\n return new AccountAuthenticatorEd25519(accountPublicKey, invalidSignature);\n }\n\n if (AnyPublicKey.isInstance(accountPublicKey)) {\n if (KeylessPublicKey.isInstance(accountPublicKey.publicKey)) {\n return new AccountAuthenticatorSingleKey(\n accountPublicKey,\n new AnySignature(KeylessSignature.getSimulationSignature()),\n );\n }\n return new AccountAuthenticatorSingleKey(accountPublicKey, new AnySignature(invalidSignature));\n }\n\n // TODO add support for AnyMultiKey\n throw new Error(\"Unsupported public key\");\n}\n\n/**\n * Prepare a transaction to be submitted to chain\n *\n * @param args.transaction A aptos transaction type\n * @param args.senderAuthenticator The account authenticator of the transaction sender\n * @param args.secondarySignerAuthenticators optional. For when the transaction is a multi signers transaction\n *\n * @returns A SignedTransaction\n */\nexport function generateSignedTransaction(args: InputSubmitTransactionData): Uint8Array {\n const { transaction, feePayerAuthenticator, additionalSignersAuthenticators } = args;\n const senderAuthenticator = normalizeBundle(AccountAuthenticator, args.senderAuthenticator);\n\n let txnAuthenticator: TransactionAuthenticator;\n if (transaction.feePayerAddress) {\n if (!feePayerAuthenticator) {\n throw new Error(\"Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction\");\n }\n txnAuthenticator = new TransactionAuthenticatorFeePayer(\n senderAuthenticator,\n transaction.secondarySignerAddresses ?? [],\n additionalSignersAuthenticators ?? [],\n {\n address: transaction.feePayerAddress,\n authenticator: feePayerAuthenticator,\n },\n );\n } else if (transaction.secondarySignerAddresses) {\n if (!additionalSignersAuthenticators) {\n throw new Error(\n \"Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction\",\n );\n }\n txnAuthenticator = new TransactionAuthenticatorMultiAgent(\n senderAuthenticator,\n transaction.secondarySignerAddresses,\n additionalSignersAuthenticators,\n );\n } else if (senderAuthenticator instanceof AccountAuthenticatorEd25519) {\n txnAuthenticator = new TransactionAuthenticatorEd25519(\n senderAuthenticator.public_key,\n senderAuthenticator.signature,\n );\n } else {\n txnAuthenticator = new TransactionAuthenticatorSingleSender(senderAuthenticator);\n }\n\n return new SignedTransaction(transaction.rawTransaction, txnAuthenticator).bcsToBytes();\n}\n\n/**\n * Hashes the set of values with a SHA-3 256 hash\n * @param input array of UTF-8 strings or Uint8array byte arrays\n */\nexport function hashValues(input: (Uint8Array | string)[]): Uint8Array {\n const hash = sha3Hash.create();\n for (const item of input) {\n hash.update(item);\n }\n return hash.digest();\n}\n\n/**\n * The domain separated prefix for hashing transacitons\n */\nconst TRANSACTION_PREFIX = hashValues([\"APTOS::Transaction\"]);\n\n/**\n * Generates a user transaction hash for the given transaction payload. It must already have an authenticator\n * @param args InputSubmitTransactionData\n */\nexport function generateUserTransactionHash(args: InputSubmitTransactionData): string {\n const signedTransaction = generateSignedTransaction(args);\n\n // Transaction signature is defined as, the domain separated prefix based on struct (Transaction)\n // Then followed by the type of the transaction for the enum, UserTransaction is 0\n // Then followed by BCS encoded bytes of the signed transaction\n return new Hex(hashValues([TRANSACTION_PREFIX, new Uint8Array([0]), signedTransaction])).toString();\n}\n\n/**\n * Fetches and caches ABIs with allowing for pass-through on provided ABIs\n * @param key\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n * @param abi\n * @param fetch\n */\nasync function fetchAbi<T extends FunctionABI>({\n key,\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig,\n abi,\n fetch,\n}: {\n key: string;\n moduleAddress: string;\n moduleName: string;\n functionName: string;\n aptosConfig: AptosConfig;\n abi?: T;\n fetch: (moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig) => Promise<T>;\n}): Promise<T> {\n if (abi !== undefined) {\n return abi;\n }\n\n // We fetch the entry function ABI, and then pretend that we already had the ABI\n return memoizeAsync(\n async () => fetch(moduleAddress, moduleName, functionName, aptosConfig),\n `${key}-${aptosConfig.network}-${moduleAddress}-${moduleName}-${functionName}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n"],"mappings":"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","names":["sha3Hash","generateTransactionPayload","args","isScriptDataInput","generateTransactionPayloadScript","moduleAddress","moduleName","functionName","getFunctionParts","functionAbi","fetchAbi","fetchEntryFunctionAbi","generateTransactionPayloadWithABI","typeArguments","standardizeTypeTags","functionArguments","arg","i","convertArgument","entryFunctionPayload","EntryFunction","multisigAddress","AccountAddress","TransactionPayloadMultiSig","MultiSig","MultiSigTransactionPayload","TransactionPayloadEntryFunction","generateViewFunctionPayload","fetchViewFunctionAbi","generateViewFunctionPayloadWithABI","TransactionPayloadScript","Script","Hex","generateRawTransaction","aptosConfig","sender","payload","options","feePayerAddress","getChainId","NetworkToChainId","getLedgerInfo","getGasUnitPrice","getGasPriceEstimation","getSequenceNumberForAny","getSequenceNumber","getInfo","chainId","gasEstimate","sequenceNumber","maxGasAmount","gasUnitPrice","expireTimestamp","RawTransaction","ChainId","buildTransaction","rawTxn","signers","signer","MultiAgentTransaction","SimpleTransaction","generateSignedTransactionForSimulation","signerPublicKey","transaction","secondarySignersPublicKeys","feePayerPublicKey","accountAuthenticator","getAuthenticatorForSimulation","transactionToSign","FeePayerRawTransaction","secondaryAccountAuthenticators","publicKey","feePayerAuthenticator","transactionAuthenticator","TransactionAuthenticatorFeePayer","SignedTransaction","MultiAgentRawTransaction","TransactionAuthenticatorMultiAgent","AccountAuthenticatorEd25519","TransactionAuthenticatorEd25519","AccountAuthenticatorSingleKey","TransactionAuthenticatorSingleSender","accountPublicKey","KeylessPublicKey","FederatedKeylessPublicKey","Secp256k1PublicKey","AnyPublicKey","invalidSignature","Ed25519Signature","Ed25519PublicKey","AnySignature","KeylessSignature","generateSignedTransaction","additionalSignersAuthenticators","senderAuthenticator","normalizeBundle","AccountAuthenticator","txnAuthenticator","hashValues","input","hash","sha3Hash","item","TRANSACTION_PREFIX","generateUserTransactionHash","signedTransaction","key","abi","fetch","memoizeAsync"]}
@@ -1,2 +0,0 @@
1
- var o="1.29.0";export{o as a};
2
- //# sourceMappingURL=chunk-UAEODDZS.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as r}from"./chunk-TDGQGILY.mjs";import{a as d}from"./chunk-UAEODDZS.mjs";async function A(s,u){let{url:t,method:n,body:i,contentType:a,params:o,overrides:e,originMethod:R}=s,p={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${d}`,"content-type":a??"application/json","x-aptos-typescript-sdk-origin-method":R};return e?.AUTH_TOKEN&&(p.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(p.Authorization=`Bearer ${e?.API_KEY}`),u.provider({url:t,method:n,body:i,params:o,headers:p,overrides:e})}async function y(s,u,t){let{url:n,path:i}=s,a=i?`${n}/${i}`:n,o=await A({...s,url:a},u.client),e={status:o.status,statusText:o.statusText,data:o.data,headers:o.headers,config:o.config,request:o.request,url:a};if(e.status===401)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(t==="Indexer"){let R=e.data;if(R.errors)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});e.data=R.data}else if((t==="Pepper"||t==="Prover")&&e.status>=400)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(e.status>=200&&e.status<300)return e;throw new r({apiType:t,aptosRequest:s,aptosResponse:e})}export{A as a,y as b};
2
- //# sourceMappingURL=chunk-XMW65WCQ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/client/core.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AptosApiError, AptosResponse } from \"./types\";\nimport { VERSION } from \"../version\";\nimport { AnyNumber, AptosRequest, Client, ClientRequest, ClientResponse, MimeType } from \"../types\";\nimport { AptosApiType } from \"../utils\";\n\n/**\n * Given a url and method, sends the request with axios and\n * returns the response.\n */\nexport async function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>> {\n const { url, method, body, contentType, params, overrides, originMethod } = options;\n const headers: Record<string, string | AnyNumber | boolean | undefined> = {\n ...overrides?.HEADERS,\n \"x-aptos-client\": `aptos-typescript-sdk/${VERSION}`,\n \"content-type\": contentType ?? MimeType.JSON,\n \"x-aptos-typescript-sdk-origin-method\": originMethod,\n };\n\n if (overrides?.AUTH_TOKEN) {\n headers.Authorization = `Bearer ${overrides?.AUTH_TOKEN}`;\n }\n if (overrides?.API_KEY) {\n headers.Authorization = `Bearer ${overrides?.API_KEY}`;\n }\n\n /*\n * make a call using the @aptos-labs/aptos-client package\n * {@link https://www.npmjs.com/package/@aptos-labs/aptos-client}\n */\n return client.provider<Req, Res>({\n url,\n method,\n body,\n params,\n headers,\n overrides,\n });\n}\n\n/**\n * The main function to use when doing an API request.\n *\n * @param aptosRequestOpts AptosRequest\n * @param aptosConfig The config information for the SDK client instance\n * @returns the response or AptosApiError\n */\nexport async function aptosRequest<Req extends {}, Res extends {}>(\n aptosRequestOpts: AptosRequest,\n aptosConfig: AptosConfig,\n apiType: AptosApiType,\n): Promise<AptosResponse<Req, Res>> {\n const { url, path } = aptosRequestOpts;\n const fullUrl = path ? `${url}/${path}` : url;\n const clientResponse = await request<Req, Res>({ ...aptosRequestOpts, url: fullUrl }, aptosConfig.client);\n\n const aptosResponse: AptosResponse<Req, Res> = {\n status: clientResponse.status,\n statusText: clientResponse.statusText!,\n data: clientResponse.data,\n headers: clientResponse.headers,\n config: clientResponse.config,\n request: clientResponse.request,\n url: fullUrl,\n };\n\n // Handle case for `Unauthorized` error (i.e API_KEY error)\n if (aptosResponse.status === 401) {\n throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });\n }\n\n // to support both fullnode and indexer responses,\n // check if it is an indexer query, and adjust response.data\n if (apiType === AptosApiType.INDEXER) {\n const indexerResponse = aptosResponse.data as any;\n // Handle Indexer general errors\n if (indexerResponse.errors) {\n throw new AptosApiError({\n apiType,\n aptosRequest: aptosRequestOpts,\n aptosResponse,\n });\n }\n aptosResponse.data = indexerResponse.data as Res;\n } else if (apiType === AptosApiType.PEPPER || apiType === AptosApiType.PROVER) {\n if (aptosResponse.status >= 400) {\n throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });\n }\n }\n\n if (aptosResponse.status >= 200 && aptosResponse.status < 300) {\n return aptosResponse;\n }\n\n // We have to explicitly check for all request types, because if the error is a non-indexer error, but\n // comes from an indexer request (e.g. 404), we'll need to mention it appropriately\n throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });\n}\n"],"mappings":"kFAaA,eAAsBA,EAAkBC,EAA6BC,EAA8C,CACjH,GAAM,CAAE,IAAAC,EAAK,OAAAC,EAAQ,KAAAC,EAAM,YAAAC,EAAa,OAAAC,EAAQ,UAAAC,EAAW,aAAAC,CAAa,EAAIR,EACtES,EAAoE,CACxE,GAAGF,GAAW,QACd,iBAAkB,wBAAwBG,CAAO,GACjD,eAAgBL,sBAChB,uCAAwCG,CAC1C,EAEA,OAAID,GAAW,aACbE,EAAQ,cAAgB,UAAUF,GAAW,UAAU,IAErDA,GAAW,UACbE,EAAQ,cAAgB,UAAUF,GAAW,OAAO,IAO/CN,EAAO,SAAmB,CAC/B,IAAAC,EACA,OAAAC,EACA,KAAAC,EACA,OAAAE,EACA,QAAAG,EACA,UAAAF,CACF,CAAC,CACH,CASA,eAAsBI,EACpBC,EACAC,EACAC,EACkC,CAClC,GAAM,CAAE,IAAAZ,EAAK,KAAAa,CAAK,EAAIH,EAChBI,EAAUD,EAAO,GAAGb,CAAG,IAAIa,CAAI,GAAKb,EACpCe,EAAiB,MAAMlB,EAAkB,CAAE,GAAGa,EAAkB,IAAKI,CAAQ,EAAGH,EAAY,MAAM,EAElGK,EAAyC,CAC7C,OAAQD,EAAe,OACvB,WAAYA,EAAe,WAC3B,KAAMA,EAAe,KACrB,QAASA,EAAe,QACxB,OAAQA,EAAe,OACvB,QAASA,EAAe,QACxB,IAAKD,CACP,EAGA,GAAIE,EAAc,SAAW,IAC3B,MAAM,IAAIC,EAAc,CAAE,QAAAL,EAAS,aAAcF,EAAkB,cAAAM,CAAc,CAAC,EAKpF,GAAIJ,cAAkC,CACpC,IAAMM,EAAkBF,EAAc,KAEtC,GAAIE,EAAgB,OAClB,MAAM,IAAID,EAAc,CACtB,QAAAL,EACA,aAAcF,EACd,cAAAM,CACF,CAAC,EAEHA,EAAc,KAAOE,EAAgB,IACvC,UAAWN,cAAmCA,eACxCI,EAAc,QAAU,IAC1B,MAAM,IAAIC,EAAc,CAAE,QAAAL,EAAS,aAAcF,EAAkB,cAAAM,CAAc,CAAC,EAItF,GAAIA,EAAc,QAAU,KAAOA,EAAc,OAAS,IACxD,OAAOA,EAKT,MAAM,IAAIC,EAAc,CAAE,QAAAL,EAAS,aAAcF,EAAkB,cAAAM,CAAc,CAAC,CACpF","names":["request","options","client","url","method","body","contentType","params","overrides","originMethod","headers","VERSION","aptosRequest","aptosRequestOpts","aptosConfig","apiType","path","fullUrl","clientResponse","aptosResponse","AptosApiError","indexerResponse"]}
@@ -1,2 +0,0 @@
1
- import{a as K,b as S}from"./chunk-O2BPA6TS.mjs";import{d as h}from"./chunk-KUZ2YTJH.mjs";import{a,b as c}from"./chunk-GMBSQDPO.mjs";import{i as m,j as g,k as P,n as w}from"./chunk-G5XLMQ5E.mjs";import{b as d}from"./chunk-OHRL766V.mjs";import{a as s}from"./chunk-A63SMUOU.mjs";import{b as f}from"./chunk-BCUSI3N6.mjs";import{d as y}from"./chunk-UAL27G6B.mjs";import v from"eventemitter3";var o=class o extends s{constructor(e){super();let{address:r,ephemeralKeyPair:t,uidKey:i,uidVal:E,aud:b,pepper:A,proof:n,proofFetchCallback:l,jwt:x}=e;if(this.ephemeralKeyPair=t,this.publicKey=m.create(e),this.accountAddress=r?d.from(r):this.publicKey.authKey().derivedAddress(),this.uidKey=i,this.uidVal=E,this.aud=b,this.jwt=x,this.emitter=new v,this.proofOrPromise=n,n instanceof w)this.proof=n;else{if(l===void 0)throw new Error("Must provide callback for async proof fetch");this.emitter.on("proofFetchFinish",async T=>{await l(T),this.emitter.removeAllListeners()}),this.init(n)}this.signingScheme=2;let u=f.fromHexInput(A).toUint8Array();if(u.length!==o.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${o.PEPPER_LENGTH}`);this.pepper=u}async init(e){try{this.proof=await e,this.emitter.emit("proofFetchFinish",{status:"Success"})}catch(r){r instanceof Error?this.emitter.emit("proofFetchFinish",{status:"Failed",error:r.toString()}):this.emitter.emit("proofFetchFinish",{status:"Failed",error:"Unknown"})}}serialize(e){if(e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof===void 0)throw new Error("Cannot serialize - proof undefined");this.proof.serialize(e)}isExpired(){return this.ephemeralKeyPair.isExpired()}signWithAuthenticator(e){let r=new c(this.sign(e)),t=new a(this.publicKey);return new h(t,r)}signTransactionWithAuthenticator(e){let r=new c(this.signTransaction(e)),t=new a(this.publicKey);return new h(t,r)}async waitForProofFetch(){this.proofOrPromise instanceof Promise&&await this.proofOrPromise}sign(e){let{expiryDateSecs:r}=this.ephemeralKeyPair;if(this.isExpired())throw new Error("EphemeralKeyPair is expired");if(this.proof===void 0)throw new Error("Proof not found - make sure to call `await account.waitForProofFetch()` before signing.");let t=this.ephemeralKeyPair.getPublicKey(),i=this.ephemeralKeyPair.sign(e);return new g({jwtHeader:y(this.jwt.split(".")[0]),ephemeralCertificate:new P(this.proof,0),expiryDateSecs:r,ephemeralPublicKey:t,ephemeralSignature:i})}signTransaction(e){if(this.proof===void 0)throw new Error("Proof not found - make sure to call `await account.waitForProofFetch()` before signing.");let r=K(e),i=new p(r,this.proof.proof).hash();return this.sign(i)}verifySignature(e){let{message:r,signature:t}=e;return!(this.isExpired()||!this.ephemeralKeyPair.getPublicKey().verifySignature({message:r,signature:t.ephemeralSignature}))}};o.PEPPER_LENGTH=31;var F=o,p=class extends s{constructor(r,t){super();this.domainSeparator="APTOS::TransactionAndProof";this.transaction=r,this.proof=t}serialize(r){r.serializeFixedBytes(this.transaction.bcsToBytes()),r.serializeOption(this.proof)}hash(){return S(this.bcsToBytes(),this.domainSeparator)}};export{F as a,p as b};
2
- //# sourceMappingURL=chunk-Y3BATGHX.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/account/AbstractKeylessAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport EventEmitter from \"eventemitter3\";\nimport { EphemeralCertificateVariant, HexInput, SigningScheme } from \"../types\";\nimport { AccountAddress } from \"../core/accountAddress\";\nimport {\n AnyPublicKey,\n AnySignature,\n KeylessPublicKey,\n KeylessSignature,\n EphemeralCertificate,\n ZeroKnowledgeSig,\n ZkProof,\n} from \"../core/crypto\";\n\nimport { Account } from \"./Account\";\nimport { EphemeralKeyPair } from \"./EphemeralKeyPair\";\nimport { Hex } from \"../core/hex\";\nimport { AccountAuthenticatorSingleKey } from \"../transactions/authenticator/account\";\nimport { Serializable, Serializer } from \"../bcs\";\nimport { deriveTransactionType, generateSigningMessage } from \"../transactions/transactionBuilder/signingMessage\";\nimport { AnyRawTransaction, AnyRawTransactionInstance } from \"../transactions/types\";\nimport { base64UrlDecode } from \"../utils/helpers\";\nimport { FederatedKeylessPublicKey } from \"../core/crypto/federatedKeyless\";\n\n/**\n * Account implementation for the Keyless authentication scheme. This abstract class is used for standard Keyless Accounts\n * and Federated Keyless Accounts.\n */\nexport abstract class AbstractKeylessAccount extends Serializable implements Account {\n static readonly PEPPER_LENGTH: number = 31;\n\n /**\n * The KeylessPublicKey associated with the account\n */\n readonly publicKey: KeylessPublicKey | FederatedKeylessPublicKey;\n\n /**\n * The EphemeralKeyPair used to generate sign.\n */\n readonly ephemeralKeyPair: EphemeralKeyPair;\n\n /**\n * The claim on the JWT to identify a user. This is typically 'sub' or 'email'.\n */\n readonly uidKey: string;\n\n /**\n * The value of the uidKey claim on the JWT. This intended to be a stable user identifier.\n */\n readonly uidVal: string;\n\n /**\n * The value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's\n * OIDC registration with the identity provider.\n */\n readonly aud: string;\n\n /**\n * A value contains 31 bytes of entropy that preserves privacy of the account. Typically fetched from a pepper provider.\n */\n readonly pepper: Uint8Array;\n\n /**\n * Account address associated with the account\n */\n readonly accountAddress: AccountAddress;\n\n /**\n * The zero knowledge signature (if ready) which contains the proof used to validate the EphemeralKeyPair.\n */\n proof: ZeroKnowledgeSig | undefined;\n\n /**\n * The proof of the EphemeralKeyPair or a promise that provides the proof. This is used to allow for awaiting on\n * fetching the proof.\n */\n readonly proofOrPromise: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n\n /**\n * Signing scheme used to sign transactions\n */\n readonly signingScheme: SigningScheme;\n\n /**\n * The JWT token used to derive the account\n */\n readonly jwt: string;\n\n /**\n * An event emitter used to assist in handling asynchronous proof fetching.\n */\n private readonly emitter: EventEmitter<ProofFetchEvents>;\n\n // Use the static constructor 'create' instead.\n protected constructor(args: {\n address?: AccountAddress;\n ephemeralKeyPair: EphemeralKeyPair;\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n proofFetchCallback?: ProofFetchCallback;\n jwt: string;\n }) {\n super();\n const { address, ephemeralKeyPair, uidKey, uidVal, aud, pepper, proof, proofFetchCallback, jwt } = args;\n this.ephemeralKeyPair = ephemeralKeyPair;\n this.publicKey = KeylessPublicKey.create(args);\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n this.uidKey = uidKey;\n this.uidVal = uidVal;\n this.aud = aud;\n this.jwt = jwt;\n this.emitter = new EventEmitter<ProofFetchEvents>();\n this.proofOrPromise = proof;\n if (proof instanceof ZeroKnowledgeSig) {\n this.proof = proof;\n } else {\n if (proofFetchCallback === undefined) {\n throw new Error(\"Must provide callback for async proof fetch\");\n }\n this.emitter.on(\"proofFetchFinish\", async (status) => {\n await proofFetchCallback(status);\n this.emitter.removeAllListeners();\n });\n this.init(proof);\n }\n this.signingScheme = SigningScheme.SingleKey;\n const pepperBytes = Hex.fromHexInput(pepper).toUint8Array();\n if (pepperBytes.length !== AbstractKeylessAccount.PEPPER_LENGTH) {\n throw new Error(`Pepper length in bytes should be ${AbstractKeylessAccount.PEPPER_LENGTH}`);\n }\n this.pepper = pepperBytes;\n }\n\n /**\n * This initializes the asyncronous proof fetch\n * @return\n */\n async init(promise: Promise<ZeroKnowledgeSig>) {\n try {\n this.proof = await promise;\n this.emitter.emit(\"proofFetchFinish\", { status: \"Success\" });\n } catch (error) {\n if (error instanceof Error) {\n this.emitter.emit(\"proofFetchFinish\", { status: \"Failed\", error: error.toString() });\n } else {\n this.emitter.emit(\"proofFetchFinish\", { status: \"Failed\", error: \"Unknown\" });\n }\n }\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeStr(this.jwt);\n serializer.serializeStr(this.uidKey);\n serializer.serializeFixedBytes(this.pepper);\n this.ephemeralKeyPair.serialize(serializer);\n if (this.proof === undefined) {\n throw new Error(\"Cannot serialize - proof undefined\");\n }\n this.proof.serialize(serializer);\n }\n\n /**\n * Checks if the proof is expired. If so the account must be rederived with a new EphemeralKeyPair\n * and JWT token.\n * @return boolean\n */\n isExpired(): boolean {\n return this.ephemeralKeyPair.isExpired();\n }\n\n /**\n * Sign a message using Keyless.\n * @param message the message to sign, as binary input\n * @return the AccountAuthenticator containing the signature, together with the account's public key\n */\n signWithAuthenticator(message: HexInput): AccountAuthenticatorSingleKey {\n const signature = new AnySignature(this.sign(message));\n const publicKey = new AnyPublicKey(this.publicKey);\n return new AccountAuthenticatorSingleKey(publicKey, signature);\n }\n\n /**\n * Sign a transaction using Keyless.\n * @param transaction the raw transaction\n * @return the AccountAuthenticator containing the signature of the transaction, together with the account's public key\n */\n signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorSingleKey {\n const signature = new AnySignature(this.signTransaction(transaction));\n const publicKey = new AnyPublicKey(this.publicKey);\n return new AccountAuthenticatorSingleKey(publicKey, signature);\n }\n\n /**\n * Waits for asyncronous proof fetching to finish.\n * @return\n */\n async waitForProofFetch() {\n if (this.proofOrPromise instanceof Promise) {\n await this.proofOrPromise;\n }\n }\n\n /**\n * Sign the given message using Keyless.\n * @param message in HexInput format\n * @returns Signature\n */\n sign(message: HexInput): KeylessSignature {\n const { expiryDateSecs } = this.ephemeralKeyPair;\n if (this.isExpired()) {\n throw new Error(\"EphemeralKeyPair is expired\");\n }\n if (this.proof === undefined) {\n throw new Error(\"Proof not found - make sure to call `await account.waitForProofFetch()` before signing.\");\n }\n const ephemeralPublicKey = this.ephemeralKeyPair.getPublicKey();\n const ephemeralSignature = this.ephemeralKeyPair.sign(message);\n\n return new KeylessSignature({\n jwtHeader: base64UrlDecode(this.jwt.split(\".\")[0]),\n ephemeralCertificate: new EphemeralCertificate(this.proof, EphemeralCertificateVariant.ZkProof),\n expiryDateSecs,\n ephemeralPublicKey,\n ephemeralSignature,\n });\n }\n\n /**\n * Sign the given transaction with Keyless.\n * Signs the transaction and proof to guard against proof malleability.\n * @param transaction the transaction to be signed\n * @returns KeylessSignature\n */\n signTransaction(transaction: AnyRawTransaction): KeylessSignature {\n if (this.proof === undefined) {\n throw new Error(\"Proof not found - make sure to call `await account.waitForProofFetch()` before signing.\");\n }\n const raw = deriveTransactionType(transaction);\n const txnAndProof = new TransactionAndProof(raw, this.proof.proof);\n const signMess = txnAndProof.hash();\n return this.sign(signMess);\n }\n\n /**\n * Note - This function is currently incomplete and should only be used to verify ownership of the KeylessAccount\n *\n * Verifies a signature given the message.\n *\n * TODO: Groth16 proof verification\n *\n * @param args.message the message that was signed.\n * @param args.signature the KeylessSignature to verify\n * @returns boolean\n */\n verifySignature(args: { message: HexInput; signature: KeylessSignature }): boolean {\n const { message, signature } = args;\n if (this.isExpired()) {\n return false;\n }\n if (!this.ephemeralKeyPair.getPublicKey().verifySignature({ message, signature: signature.ephemeralSignature })) {\n return false;\n }\n return true;\n }\n}\n\n/**\n * A container class to hold a transaction and a proof. It implements CryptoHashable which is used to create\n * the signing message for Keyless transactions. We sign over the proof to ensure non-malleability.\n */\nexport class TransactionAndProof extends Serializable {\n /**\n * The transaction to sign.\n */\n transaction: AnyRawTransactionInstance;\n\n /**\n * The zero knowledge proof used in signing the transaction.\n */\n proof?: ZkProof;\n\n /**\n * The domain separator prefix used when hashing.\n */\n readonly domainSeparator = \"APTOS::TransactionAndProof\";\n\n constructor(transaction: AnyRawTransactionInstance, proof?: ZkProof) {\n super();\n this.transaction = transaction;\n this.proof = proof;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.transaction.bcsToBytes());\n serializer.serializeOption(this.proof);\n }\n\n /**\n * Hashes the bcs serialized from of the class. This is the typescript corollary to the BCSCryptoHash macro in aptos-core.\n *\n * @returns Uint8Array\n */\n hash(): Uint8Array {\n return generateSigningMessage(this.bcsToBytes(), this.domainSeparator);\n }\n}\n\nexport type ProofFetchSuccess = {\n status: \"Success\";\n};\n\nexport type ProofFetchFailure = {\n status: \"Failed\";\n error: string;\n};\n\nexport type ProofFetchStatus = ProofFetchSuccess | ProofFetchFailure;\n\nexport type ProofFetchCallback = (status: ProofFetchStatus) => Promise<void>;\n\nexport interface ProofFetchEvents {\n proofFetchFinish: (status: ProofFetchStatus) => void;\n}\n"],"mappings":"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","names":["EventEmitter","_AbstractKeylessAccount","Serializable","args","address","ephemeralKeyPair","uidKey","uidVal","aud","pepper","proof","proofFetchCallback","jwt","KeylessPublicKey","AccountAddress","EventEmitter","ZeroKnowledgeSig","status","pepperBytes","Hex","promise","error","serializer","message","signature","AnySignature","publicKey","AnyPublicKey","AccountAuthenticatorSingleKey","transaction","expiryDateSecs","ephemeralPublicKey","ephemeralSignature","KeylessSignature","base64UrlDecode","EphemeralCertificate","raw","deriveTransactionType","signMess","TransactionAndProof","AbstractKeylessAccount","generateSigningMessage"]}