@aptos-labs/ts-sdk 1.14.0-zeta.5 → 1.14.0-zeta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/common/{accountAddress-u9wEan9p.d.ts → accountAddress-vnqhK2RI.d.ts} +1 -1
  2. package/dist/common/cli/index.d.ts +1 -1
  3. package/dist/common/index.d.ts +61 -47
  4. package/dist/common/index.js +10 -10
  5. package/dist/common/index.js.map +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.d.mts +2 -0
  9. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  10. package/dist/esm/account/KeylessAccount.d.mts +14 -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.d.mts +2 -1
  15. package/dist/esm/account/index.mjs +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.d.mts +1 -0
  19. package/dist/esm/api/aptos.mjs +1 -1
  20. package/dist/esm/api/coin.mjs +1 -1
  21. package/dist/esm/api/digitalAsset.mjs +1 -1
  22. package/dist/esm/api/event.mjs +1 -1
  23. package/dist/esm/api/faucet.mjs +1 -1
  24. package/dist/esm/api/fungibleAsset.mjs +1 -1
  25. package/dist/esm/api/general.mjs +1 -1
  26. package/dist/esm/api/index.d.mts +1 -0
  27. package/dist/esm/api/index.mjs +1 -1
  28. package/dist/esm/api/keyless.d.mts +1 -0
  29. package/dist/esm/api/keyless.mjs +1 -1
  30. package/dist/esm/api/staking.mjs +1 -1
  31. package/dist/esm/api/transaction.mjs +1 -1
  32. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  33. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  34. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  35. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  36. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  37. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  38. package/dist/esm/api/utils.mjs +1 -1
  39. package/dist/esm/bcs/index.mjs +1 -1
  40. package/dist/esm/{chunk-5L5R6AOV.mjs → chunk-2DIO35OD.mjs} +2 -2
  41. package/dist/esm/chunk-2LCP7PAJ.mjs +2 -0
  42. package/dist/esm/chunk-2LCP7PAJ.mjs.map +1 -0
  43. package/dist/esm/{chunk-4M24RKAT.mjs → chunk-2OMAM2OW.mjs} +2 -2
  44. package/dist/esm/{chunk-3V2VDFQY.mjs → chunk-3KRYVZNP.mjs} +2 -2
  45. package/dist/esm/{chunk-X6SKLES2.mjs → chunk-4OSXWFTW.mjs} +2 -2
  46. package/dist/esm/{chunk-73IEQPK5.mjs → chunk-4SSWQOHR.mjs} +2 -2
  47. package/dist/esm/{chunk-W637YAND.mjs → chunk-52ECIIIH.mjs} +2 -2
  48. package/dist/esm/{chunk-ONIVXO76.mjs → chunk-56NB52W6.mjs} +2 -2
  49. package/dist/esm/{chunk-ZUIKWQJD.mjs → chunk-57VQMRBX.mjs} +2 -2
  50. package/dist/esm/{chunk-6NMKNQQN.mjs → chunk-5JGWZSNG.mjs} +2 -2
  51. package/dist/esm/chunk-65QG6O26.mjs +2 -0
  52. package/dist/esm/{chunk-RKTM5GBP.mjs.map → chunk-65QG6O26.mjs.map} +1 -1
  53. package/dist/esm/{chunk-Z2ZR4PTF.mjs → chunk-7WJTKYRG.mjs} +2 -2
  54. package/dist/esm/{chunk-JMAGEEML.mjs → chunk-ARV2BH5D.mjs} +2 -2
  55. package/dist/esm/{chunk-LEJFBNCK.mjs → chunk-BVBPBQK5.mjs} +2 -2
  56. package/dist/esm/{chunk-742ID33B.mjs → chunk-CK272GUS.mjs} +2 -2
  57. package/dist/esm/chunk-CPBGL37X.mjs +2 -0
  58. package/dist/esm/{chunk-LYWYWSNY.mjs.map → chunk-CPBGL37X.mjs.map} +1 -1
  59. package/dist/esm/chunk-DYUF5UID.mjs +2 -0
  60. package/dist/esm/chunk-DYUF5UID.mjs.map +1 -0
  61. package/dist/esm/{chunk-4IX52YGU.mjs → chunk-EM2TYSMT.mjs} +2 -2
  62. package/dist/esm/{chunk-NAHTRLXC.mjs → chunk-EOVIHU3S.mjs} +2 -2
  63. package/dist/esm/{chunk-S7JBGEYI.mjs → chunk-FUWIJEE6.mjs} +2 -2
  64. package/dist/esm/{chunk-GMJ5FBKJ.mjs → chunk-H7NNUC3D.mjs} +2 -2
  65. package/dist/esm/{chunk-DZRH4BNK.mjs → chunk-HLN6GUIY.mjs} +2 -2
  66. package/dist/esm/{chunk-VHL524RK.mjs → chunk-HXQADNOJ.mjs} +2 -2
  67. package/dist/esm/{chunk-RFCXZ4TC.mjs → chunk-KDXECPCS.mjs} +2 -2
  68. package/dist/esm/{chunk-LHENGFB5.mjs → chunk-KL3HNMT5.mjs} +2 -2
  69. package/dist/esm/{chunk-5VTCFHSF.mjs → chunk-KYZCH7IK.mjs} +2 -2
  70. package/dist/esm/chunk-LEMNHXB6.mjs +2 -0
  71. package/dist/esm/chunk-LEMNHXB6.mjs.map +1 -0
  72. package/dist/esm/{chunk-2KMTDWGQ.mjs → chunk-MATOKW5G.mjs} +2 -2
  73. package/dist/esm/{chunk-R2753ECO.mjs → chunk-MTL6MT2Z.mjs} +2 -2
  74. package/dist/esm/{chunk-MKUAW7KW.mjs → chunk-NNIHTVLA.mjs} +2 -2
  75. package/dist/esm/{chunk-WW4IQL47.mjs → chunk-NX6YYFXD.mjs} +2 -2
  76. package/dist/esm/{chunk-DLVGWOTI.mjs → chunk-OWIDLQOG.mjs} +2 -2
  77. package/dist/esm/{chunk-DSD6JNJS.mjs → chunk-QEZJZOEX.mjs} +2 -2
  78. package/dist/esm/{chunk-IEZO4PIG.mjs → chunk-RJ4PSGZ4.mjs} +2 -2
  79. package/dist/esm/{chunk-ASZENFAS.mjs → chunk-ROAJCETX.mjs} +2 -2
  80. package/dist/esm/{chunk-XI2JDNAL.mjs → chunk-T5CGXM6S.mjs} +2 -2
  81. package/dist/esm/{chunk-CARMPAYA.mjs → chunk-TGXWKN2U.mjs} +2 -2
  82. package/dist/esm/{chunk-7H3HRFVM.mjs → chunk-TICM455H.mjs} +2 -2
  83. package/dist/esm/{chunk-PHHKQFSH.mjs → chunk-TNJDICBE.mjs} +2 -2
  84. package/dist/esm/{chunk-L5BE26SQ.mjs → chunk-TZ2MX7WB.mjs} +2 -2
  85. package/dist/esm/{chunk-5DF6PRJH.mjs → chunk-U7SJ3I5G.mjs} +2 -2
  86. package/dist/esm/{chunk-3Q5YC6SI.mjs → chunk-VDTM2LUI.mjs} +2 -2
  87. package/dist/esm/{chunk-2HESYTXD.mjs → chunk-VY2DCR3F.mjs} +2 -2
  88. package/dist/esm/{chunk-5MKK3ANJ.mjs → chunk-W4UPOKDH.mjs} +2 -2
  89. package/dist/esm/{chunk-XJEPRW6G.mjs → chunk-WOPMZAWX.mjs} +2 -2
  90. package/dist/esm/{chunk-FQVVTJ4Y.mjs → chunk-XTO3FQND.mjs} +2 -2
  91. package/dist/esm/{chunk-UNPC5XTJ.mjs → chunk-XVK3XHDK.mjs} +2 -2
  92. package/dist/esm/{chunk-YPCJCALA.mjs → chunk-XX3J6NRH.mjs} +2 -2
  93. package/dist/esm/{chunk-NK42HVLJ.mjs → chunk-XXBIY3E4.mjs} +2 -2
  94. package/dist/esm/{chunk-KEYTRAFA.mjs → chunk-YQF2NZNF.mjs} +2 -2
  95. package/dist/esm/{chunk-4X7IX2NK.mjs → chunk-YUONW2LQ.mjs} +2 -2
  96. package/dist/esm/client/core.mjs +1 -1
  97. package/dist/esm/client/get.mjs +1 -1
  98. package/dist/esm/client/index.mjs +1 -1
  99. package/dist/esm/client/post.mjs +1 -1
  100. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  101. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  102. package/dist/esm/core/crypto/index.mjs +1 -1
  103. package/dist/esm/core/crypto/keyless.mjs +1 -1
  104. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  105. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  106. package/dist/esm/core/crypto/proof.mjs +1 -1
  107. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  108. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  109. package/dist/esm/core/crypto/signature.mjs +1 -1
  110. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  111. package/dist/esm/core/index.mjs +1 -1
  112. package/dist/esm/index.d.mts +1 -1
  113. package/dist/esm/index.mjs +1 -1
  114. package/dist/esm/internal/account.mjs +1 -1
  115. package/dist/esm/internal/ans.mjs +1 -1
  116. package/dist/esm/internal/coin.mjs +1 -1
  117. package/dist/esm/internal/digitalAsset.mjs +1 -1
  118. package/dist/esm/internal/event.mjs +1 -1
  119. package/dist/esm/internal/faucet.mjs +1 -1
  120. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  121. package/dist/esm/internal/general.mjs +1 -1
  122. package/dist/esm/internal/keyless.d.mts +1 -0
  123. package/dist/esm/internal/keyless.mjs +1 -1
  124. package/dist/esm/internal/staking.mjs +1 -1
  125. package/dist/esm/internal/transaction.mjs +1 -1
  126. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  127. package/dist/esm/internal/view.mjs +1 -1
  128. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  129. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  130. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  131. package/dist/esm/transactions/index.mjs +1 -1
  132. package/dist/esm/transactions/instances/index.mjs +1 -1
  133. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  134. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  135. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  136. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  137. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  138. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  139. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  140. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  141. package/dist/esm/transactions/management/index.mjs +1 -1
  142. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  143. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  144. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  145. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  146. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  147. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
  148. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  149. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  150. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  151. package/dist/esm/types/keyless.d.mts +1 -54
  152. package/dist/esm/types/keyless.mjs +0 -1
  153. package/dist/esm/utils/index.mjs +1 -1
  154. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  155. package/dist/esm/version.d.mts +1 -1
  156. package/dist/esm/version.mjs +1 -1
  157. package/package.json +2 -2
  158. package/src/account/EphemeralKeyPair.ts +3 -2
  159. package/src/account/KeylessAccount.ts +34 -5
  160. package/src/internal/transactionSubmission.ts +6 -14
  161. package/src/transactions/transactionBuilder/transactionBuilder.ts +16 -2
  162. package/src/types/keyless.ts +0 -31
  163. package/src/version.ts +1 -1
  164. package/dist/esm/chunk-36OFXBUQ.mjs +0 -2
  165. package/dist/esm/chunk-36OFXBUQ.mjs.map +0 -1
  166. package/dist/esm/chunk-3COVJN6Z.mjs +0 -2
  167. package/dist/esm/chunk-3COVJN6Z.mjs.map +0 -1
  168. package/dist/esm/chunk-3LAGGRLJ.mjs +0 -2
  169. package/dist/esm/chunk-3LAGGRLJ.mjs.map +0 -1
  170. package/dist/esm/chunk-6S4QCJMU.mjs +0 -2
  171. package/dist/esm/chunk-6S4QCJMU.mjs.map +0 -1
  172. package/dist/esm/chunk-LYWYWSNY.mjs +0 -2
  173. package/dist/esm/chunk-RKTM5GBP.mjs +0 -2
  174. /package/dist/esm/{chunk-5L5R6AOV.mjs.map → chunk-2DIO35OD.mjs.map} +0 -0
  175. /package/dist/esm/{chunk-4M24RKAT.mjs.map → chunk-2OMAM2OW.mjs.map} +0 -0
  176. /package/dist/esm/{chunk-3V2VDFQY.mjs.map → chunk-3KRYVZNP.mjs.map} +0 -0
  177. /package/dist/esm/{chunk-X6SKLES2.mjs.map → chunk-4OSXWFTW.mjs.map} +0 -0
  178. /package/dist/esm/{chunk-73IEQPK5.mjs.map → chunk-4SSWQOHR.mjs.map} +0 -0
  179. /package/dist/esm/{chunk-W637YAND.mjs.map → chunk-52ECIIIH.mjs.map} +0 -0
  180. /package/dist/esm/{chunk-ONIVXO76.mjs.map → chunk-56NB52W6.mjs.map} +0 -0
  181. /package/dist/esm/{chunk-ZUIKWQJD.mjs.map → chunk-57VQMRBX.mjs.map} +0 -0
  182. /package/dist/esm/{chunk-6NMKNQQN.mjs.map → chunk-5JGWZSNG.mjs.map} +0 -0
  183. /package/dist/esm/{chunk-Z2ZR4PTF.mjs.map → chunk-7WJTKYRG.mjs.map} +0 -0
  184. /package/dist/esm/{chunk-JMAGEEML.mjs.map → chunk-ARV2BH5D.mjs.map} +0 -0
  185. /package/dist/esm/{chunk-LEJFBNCK.mjs.map → chunk-BVBPBQK5.mjs.map} +0 -0
  186. /package/dist/esm/{chunk-742ID33B.mjs.map → chunk-CK272GUS.mjs.map} +0 -0
  187. /package/dist/esm/{chunk-4IX52YGU.mjs.map → chunk-EM2TYSMT.mjs.map} +0 -0
  188. /package/dist/esm/{chunk-NAHTRLXC.mjs.map → chunk-EOVIHU3S.mjs.map} +0 -0
  189. /package/dist/esm/{chunk-S7JBGEYI.mjs.map → chunk-FUWIJEE6.mjs.map} +0 -0
  190. /package/dist/esm/{chunk-GMJ5FBKJ.mjs.map → chunk-H7NNUC3D.mjs.map} +0 -0
  191. /package/dist/esm/{chunk-DZRH4BNK.mjs.map → chunk-HLN6GUIY.mjs.map} +0 -0
  192. /package/dist/esm/{chunk-VHL524RK.mjs.map → chunk-HXQADNOJ.mjs.map} +0 -0
  193. /package/dist/esm/{chunk-RFCXZ4TC.mjs.map → chunk-KDXECPCS.mjs.map} +0 -0
  194. /package/dist/esm/{chunk-LHENGFB5.mjs.map → chunk-KL3HNMT5.mjs.map} +0 -0
  195. /package/dist/esm/{chunk-5VTCFHSF.mjs.map → chunk-KYZCH7IK.mjs.map} +0 -0
  196. /package/dist/esm/{chunk-2KMTDWGQ.mjs.map → chunk-MATOKW5G.mjs.map} +0 -0
  197. /package/dist/esm/{chunk-R2753ECO.mjs.map → chunk-MTL6MT2Z.mjs.map} +0 -0
  198. /package/dist/esm/{chunk-MKUAW7KW.mjs.map → chunk-NNIHTVLA.mjs.map} +0 -0
  199. /package/dist/esm/{chunk-WW4IQL47.mjs.map → chunk-NX6YYFXD.mjs.map} +0 -0
  200. /package/dist/esm/{chunk-DLVGWOTI.mjs.map → chunk-OWIDLQOG.mjs.map} +0 -0
  201. /package/dist/esm/{chunk-DSD6JNJS.mjs.map → chunk-QEZJZOEX.mjs.map} +0 -0
  202. /package/dist/esm/{chunk-IEZO4PIG.mjs.map → chunk-RJ4PSGZ4.mjs.map} +0 -0
  203. /package/dist/esm/{chunk-ASZENFAS.mjs.map → chunk-ROAJCETX.mjs.map} +0 -0
  204. /package/dist/esm/{chunk-XI2JDNAL.mjs.map → chunk-T5CGXM6S.mjs.map} +0 -0
  205. /package/dist/esm/{chunk-CARMPAYA.mjs.map → chunk-TGXWKN2U.mjs.map} +0 -0
  206. /package/dist/esm/{chunk-7H3HRFVM.mjs.map → chunk-TICM455H.mjs.map} +0 -0
  207. /package/dist/esm/{chunk-PHHKQFSH.mjs.map → chunk-TNJDICBE.mjs.map} +0 -0
  208. /package/dist/esm/{chunk-L5BE26SQ.mjs.map → chunk-TZ2MX7WB.mjs.map} +0 -0
  209. /package/dist/esm/{chunk-5DF6PRJH.mjs.map → chunk-U7SJ3I5G.mjs.map} +0 -0
  210. /package/dist/esm/{chunk-3Q5YC6SI.mjs.map → chunk-VDTM2LUI.mjs.map} +0 -0
  211. /package/dist/esm/{chunk-2HESYTXD.mjs.map → chunk-VY2DCR3F.mjs.map} +0 -0
  212. /package/dist/esm/{chunk-5MKK3ANJ.mjs.map → chunk-W4UPOKDH.mjs.map} +0 -0
  213. /package/dist/esm/{chunk-XJEPRW6G.mjs.map → chunk-WOPMZAWX.mjs.map} +0 -0
  214. /package/dist/esm/{chunk-FQVVTJ4Y.mjs.map → chunk-XTO3FQND.mjs.map} +0 -0
  215. /package/dist/esm/{chunk-UNPC5XTJ.mjs.map → chunk-XVK3XHDK.mjs.map} +0 -0
  216. /package/dist/esm/{chunk-YPCJCALA.mjs.map → chunk-XX3J6NRH.mjs.map} +0 -0
  217. /package/dist/esm/{chunk-NK42HVLJ.mjs.map → chunk-XXBIY3E4.mjs.map} +0 -0
  218. /package/dist/esm/{chunk-KEYTRAFA.mjs.map → chunk-YQF2NZNF.mjs.map} +0 -0
  219. /package/dist/esm/{chunk-4X7IX2NK.mjs.map → chunk-YUONW2LQ.mjs.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{e as o}from"../../chunk-6S4QCJMU.mjs";import"../../chunk-3COVJN6Z.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-36OFXBUQ.mjs";import"../../chunk-ZUIKWQJD.mjs";import"../../chunk-PFFAQZHT.mjs";import"../../chunk-7H3HRFVM.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-4X7IX2NK.mjs";import"../../chunk-742ID33B.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-KEYTRAFA.mjs";import"../../chunk-S4SEFF4K.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-6NMKNQQN.mjs";import"../../chunk-5VTCFHSF.mjs";import"../../chunk-XJEPRW6G.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-UTXJOB3O.mjs";import"../../chunk-RKHPXZM6.mjs";import"../../chunk-JM544NRW.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-3JPVQHOR.mjs";import"../../chunk-LYWYWSNY.mjs";import"../../chunk-5L5R6AOV.mjs";import"../../chunk-JMAGEEML.mjs";import"../../chunk-PHHKQFSH.mjs";import"../../chunk-3LAGGRLJ.mjs";import"../../chunk-RKTM5GBP.mjs";import"../../chunk-X6SKLES2.mjs";import"../../chunk-ONIVXO76.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-W637YAND.mjs";import"../../chunk-NC5HHEEM.mjs";import"../../chunk-RFCXZ4TC.mjs";import"../../chunk-MKUAW7KW.mjs";import"../../chunk-Z2ZR4PTF.mjs";import"../../chunk-IEZO4PIG.mjs";import"../../chunk-3VGX3TXH.mjs";import"../../chunk-ZNEBMSNC.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-3S3GIUQY.mjs";import"../../chunk-HYDDIAJ6.mjs";import"../../chunk-MWUJCP27.mjs";import"../../chunk-MGOHPDX4.mjs";import"../../chunk-RFSO3JRG.mjs";import"../../chunk-YE5B2S5L.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-HHVAU5HU.mjs";import"../../chunk-JLWKIYHV.mjs";import"../../chunk-YV7OBLK2.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-3CUVYW32.mjs";import"../../chunk-PGCBIU33.mjs";import"../../chunk-FLYEALDB.mjs";import"../../chunk-N466X3S6.mjs";import"../../chunk-25H3DXTL.mjs";import"../../chunk-SI7MPP6G.mjs";import"../../chunk-TJDC5PWD.mjs";import"../../chunk-COW5IGYC.mjs";import"../../chunk-STYDBDYL.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-7STYQ5ZE.mjs";import"../../chunk-T23OVRNF.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-C3L4ETUF.mjs";import"../../chunk-3FVRXELT.mjs";import"../../chunk-EB7AI4B4.mjs";import"../../chunk-6RBUXB5I.mjs";import"../../chunk-JM2B5E2I.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-VT6XJSRO.mjs";import"../../chunk-TVRJ3M7B.mjs";import"../../chunk-AOCNYMMX.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-FVA2OPG4.mjs";var a=class{constructor(n){this.config=n}transaction(n){return o({...n})}transactionAsFeePayer(n){let{signer:r,transaction:t}=n;if(!t.feePayerAddress)throw new Error(`Transaction ${t} is not a Fee Payer transaction`);return t.feePayerAddress=r.accountAddress,o({signer:r,transaction:t})}};export{a as Sign};
1
+ import{e as o}from"../../chunk-LEMNHXB6.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-DYUF5UID.mjs";import"../../chunk-57VQMRBX.mjs";import"../../chunk-PFFAQZHT.mjs";import"../../chunk-TICM455H.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-YUONW2LQ.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-2DIO35OD.mjs";import"../../chunk-ARV2BH5D.mjs";import"../../chunk-TNJDICBE.mjs";import"../../chunk-2LCP7PAJ.mjs";import"../../chunk-65QG6O26.mjs";import"../../chunk-4OSXWFTW.mjs";import"../../chunk-56NB52W6.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-52ECIIIH.mjs";import"../../chunk-NC5HHEEM.mjs";import"../../chunk-KDXECPCS.mjs";import"../../chunk-NNIHTVLA.mjs";import"../../chunk-7WJTKYRG.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-RJ4PSGZ4.mjs";import"../../chunk-3VGX3TXH.mjs";import"../../chunk-ZNEBMSNC.mjs";import"../../chunk-3S3GIUQY.mjs";import"../../chunk-HYDDIAJ6.mjs";import"../../chunk-MWUJCP27.mjs";import"../../chunk-MGOHPDX4.mjs";import"../../chunk-CK272GUS.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-YQF2NZNF.mjs";import"../../chunk-S4SEFF4K.mjs";import"../../chunk-3JPVQHOR.mjs";import"../../chunk-RFSO3JRG.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-HHVAU5HU.mjs";import"../../chunk-JLWKIYHV.mjs";import"../../chunk-YV7OBLK2.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-3CUVYW32.mjs";import"../../chunk-PGCBIU33.mjs";import"../../chunk-FLYEALDB.mjs";import"../../chunk-N466X3S6.mjs";import"../../chunk-25H3DXTL.mjs";import"../../chunk-SI7MPP6G.mjs";import"../../chunk-TJDC5PWD.mjs";import"../../chunk-COW5IGYC.mjs";import"../../chunk-STYDBDYL.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-7STYQ5ZE.mjs";import"../../chunk-T23OVRNF.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-KYZCH7IK.mjs";import"../../chunk-5JGWZSNG.mjs";import"../../chunk-WOPMZAWX.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-UTXJOB3O.mjs";import"../../chunk-RKHPXZM6.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-EB7AI4B4.mjs";import"../../chunk-6RBUXB5I.mjs";import"../../chunk-C3L4ETUF.mjs";import"../../chunk-3FVRXELT.mjs";import"../../chunk-JM2B5E2I.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-VT6XJSRO.mjs";import"../../chunk-TVRJ3M7B.mjs";import"../../chunk-AOCNYMMX.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-CPBGL37X.mjs";import"../../chunk-JM544NRW.mjs";import"../../chunk-YE5B2S5L.mjs";import"../../chunk-FVA2OPG4.mjs";var a=class{constructor(n){this.config=n}transaction(n){return o({...n})}transactionAsFeePayer(n){let{signer:r,transaction:t}=n;if(!t.feePayerAddress)throw new Error(`Transaction ${t} is not a Fee Payer transaction`);return t.feePayerAddress=r.accountAddress,o({signer:r,transaction:t})}};export{a as Sign};
2
2
  //# sourceMappingURL=sign.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/api/transactionSubmission/sign.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"../../account\";\nimport { signTransaction } from \"../../internal/transactionSubmission\";\nimport { AccountAuthenticator, AnyRawTransaction } from \"../../transactions\";\nimport { AptosConfig } from \"../aptosConfig\";\n\n/**\n * A class to handle all `Sign` transaction operations\n */\nexport class Sign {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n // eslint-disable-next-line class-methods-use-this\n transaction(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n return signTransaction({\n ...args,\n });\n }\n\n // eslint-disable-next-line class-methods-use-this\n transactionAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n const { signer, transaction } = args;\n\n // if transaction doesnt hold a \"feePayerAddress\" prop it means\n // this is not a fee payer transaction\n if (!transaction.feePayerAddress) {\n throw new Error(`Transaction ${transaction} is not a Fee Payer transaction`);\n }\n\n // Set the feePayerAddress to the signer account address\n transaction.feePayerAddress = signer.accountAddress;\n\n return signTransaction({\n signer,\n transaction,\n });\n }\n}\n"],"mappings":"2jFAWO,IAAMA,EAAN,KAAW,CAGhB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAGA,YAAYC,EAAiF,CAC3F,OAAOC,EAAgB,CACrB,GAAGD,CACL,CAAC,CACH,CAGA,sBAAsBA,EAAiF,CACrG,GAAM,CAAE,OAAAE,EAAQ,YAAAC,CAAY,EAAIH,EAIhC,GAAI,CAACG,EAAY,gBACf,MAAM,IAAI,MAAM,eAAeA,CAAW,iCAAiC,EAI7E,OAAAA,EAAY,gBAAkBD,EAAO,eAE9BD,EAAgB,CACrB,OAAAC,EACA,YAAAC,CACF,CAAC,CACH,CACF","names":["Sign","config","args","signTransaction","signer","transaction"]}
1
+ {"version":3,"sources":["../../../../src/api/transactionSubmission/sign.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"../../account\";\nimport { signTransaction } from \"../../internal/transactionSubmission\";\nimport { AccountAuthenticator, AnyRawTransaction } from \"../../transactions\";\nimport { AptosConfig } from \"../aptosConfig\";\n\n/**\n * A class to handle all `Sign` transaction operations\n */\nexport class Sign {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n // eslint-disable-next-line class-methods-use-this\n transaction(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n return signTransaction({\n ...args,\n });\n }\n\n // eslint-disable-next-line class-methods-use-this\n transactionAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n const { signer, transaction } = args;\n\n // if transaction doesnt hold a \"feePayerAddress\" prop it means\n // this is not a fee payer transaction\n if (!transaction.feePayerAddress) {\n throw new Error(`Transaction ${transaction} is not a Fee Payer transaction`);\n }\n\n // Set the feePayerAddress to the signer account address\n transaction.feePayerAddress = signer.accountAddress;\n\n return signTransaction({\n signer,\n transaction,\n });\n }\n}\n"],"mappings":"0hFAWO,IAAMA,EAAN,KAAW,CAGhB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAGA,YAAYC,EAAiF,CAC3F,OAAOC,EAAgB,CACrB,GAAGD,CACL,CAAC,CACH,CAGA,sBAAsBA,EAAiF,CACrG,GAAM,CAAE,OAAAE,EAAQ,YAAAC,CAAY,EAAIH,EAIhC,GAAI,CAACG,EAAY,gBACf,MAAM,IAAI,MAAM,eAAeA,CAAW,iCAAiC,EAI7E,OAAAA,EAAY,gBAAkBD,EAAO,eAE9BD,EAAgB,CACrB,OAAAC,EACA,YAAAC,CACF,CAAC,CACH,CACF","names":["Sign","config","args","signTransaction","signer","transaction"]}
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-GMJ5FBKJ.mjs";import"../../chunk-6EMN3BOV.mjs";import"../../chunk-6S4QCJMU.mjs";import"../../chunk-3COVJN6Z.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-36OFXBUQ.mjs";import"../../chunk-ZUIKWQJD.mjs";import"../../chunk-PFFAQZHT.mjs";import"../../chunk-7H3HRFVM.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-4X7IX2NK.mjs";import"../../chunk-742ID33B.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-KEYTRAFA.mjs";import"../../chunk-S4SEFF4K.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-6NMKNQQN.mjs";import"../../chunk-5VTCFHSF.mjs";import"../../chunk-XJEPRW6G.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-UTXJOB3O.mjs";import"../../chunk-RKHPXZM6.mjs";import"../../chunk-JM544NRW.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-3JPVQHOR.mjs";import"../../chunk-LYWYWSNY.mjs";import"../../chunk-5L5R6AOV.mjs";import"../../chunk-JMAGEEML.mjs";import"../../chunk-PHHKQFSH.mjs";import"../../chunk-3LAGGRLJ.mjs";import"../../chunk-RKTM5GBP.mjs";import"../../chunk-X6SKLES2.mjs";import"../../chunk-ONIVXO76.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-W637YAND.mjs";import"../../chunk-NC5HHEEM.mjs";import"../../chunk-RFCXZ4TC.mjs";import"../../chunk-MKUAW7KW.mjs";import"../../chunk-Z2ZR4PTF.mjs";import"../../chunk-IEZO4PIG.mjs";import"../../chunk-3VGX3TXH.mjs";import"../../chunk-ZNEBMSNC.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-3S3GIUQY.mjs";import"../../chunk-HYDDIAJ6.mjs";import"../../chunk-MWUJCP27.mjs";import"../../chunk-MGOHPDX4.mjs";import"../../chunk-RFSO3JRG.mjs";import"../../chunk-YE5B2S5L.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-HHVAU5HU.mjs";import"../../chunk-JLWKIYHV.mjs";import"../../chunk-YV7OBLK2.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-3CUVYW32.mjs";import"../../chunk-PGCBIU33.mjs";import"../../chunk-FLYEALDB.mjs";import"../../chunk-N466X3S6.mjs";import"../../chunk-25H3DXTL.mjs";import"../../chunk-SI7MPP6G.mjs";import"../../chunk-TJDC5PWD.mjs";import"../../chunk-COW5IGYC.mjs";import"../../chunk-STYDBDYL.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-7STYQ5ZE.mjs";import"../../chunk-T23OVRNF.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-C3L4ETUF.mjs";import"../../chunk-3FVRXELT.mjs";import"../../chunk-EB7AI4B4.mjs";import"../../chunk-6RBUXB5I.mjs";import"../../chunk-JM2B5E2I.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-VT6XJSRO.mjs";import"../../chunk-TVRJ3M7B.mjs";import"../../chunk-AOCNYMMX.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as Simulate};
1
+ import{a}from"../../chunk-H7NNUC3D.mjs";import"../../chunk-6EMN3BOV.mjs";import"../../chunk-LEMNHXB6.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-DYUF5UID.mjs";import"../../chunk-57VQMRBX.mjs";import"../../chunk-PFFAQZHT.mjs";import"../../chunk-TICM455H.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-YUONW2LQ.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-2DIO35OD.mjs";import"../../chunk-ARV2BH5D.mjs";import"../../chunk-TNJDICBE.mjs";import"../../chunk-2LCP7PAJ.mjs";import"../../chunk-65QG6O26.mjs";import"../../chunk-4OSXWFTW.mjs";import"../../chunk-56NB52W6.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-52ECIIIH.mjs";import"../../chunk-NC5HHEEM.mjs";import"../../chunk-KDXECPCS.mjs";import"../../chunk-NNIHTVLA.mjs";import"../../chunk-7WJTKYRG.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-RJ4PSGZ4.mjs";import"../../chunk-3VGX3TXH.mjs";import"../../chunk-ZNEBMSNC.mjs";import"../../chunk-3S3GIUQY.mjs";import"../../chunk-HYDDIAJ6.mjs";import"../../chunk-MWUJCP27.mjs";import"../../chunk-MGOHPDX4.mjs";import"../../chunk-CK272GUS.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-YQF2NZNF.mjs";import"../../chunk-S4SEFF4K.mjs";import"../../chunk-3JPVQHOR.mjs";import"../../chunk-RFSO3JRG.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-HHVAU5HU.mjs";import"../../chunk-JLWKIYHV.mjs";import"../../chunk-YV7OBLK2.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-3CUVYW32.mjs";import"../../chunk-PGCBIU33.mjs";import"../../chunk-FLYEALDB.mjs";import"../../chunk-N466X3S6.mjs";import"../../chunk-25H3DXTL.mjs";import"../../chunk-SI7MPP6G.mjs";import"../../chunk-TJDC5PWD.mjs";import"../../chunk-COW5IGYC.mjs";import"../../chunk-STYDBDYL.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-7STYQ5ZE.mjs";import"../../chunk-T23OVRNF.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-KYZCH7IK.mjs";import"../../chunk-5JGWZSNG.mjs";import"../../chunk-WOPMZAWX.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-UTXJOB3O.mjs";import"../../chunk-RKHPXZM6.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-EB7AI4B4.mjs";import"../../chunk-6RBUXB5I.mjs";import"../../chunk-C3L4ETUF.mjs";import"../../chunk-3FVRXELT.mjs";import"../../chunk-JM2B5E2I.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-VT6XJSRO.mjs";import"../../chunk-TVRJ3M7B.mjs";import"../../chunk-AOCNYMMX.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-CPBGL37X.mjs";import"../../chunk-JM544NRW.mjs";import"../../chunk-YE5B2S5L.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as Simulate};
2
2
  //# sourceMappingURL=simulate.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-LEJFBNCK.mjs";import"../../chunk-6EMN3BOV.mjs";import"../../chunk-6S4QCJMU.mjs";import"../../chunk-3COVJN6Z.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-36OFXBUQ.mjs";import"../../chunk-ZUIKWQJD.mjs";import"../../chunk-PFFAQZHT.mjs";import"../../chunk-7H3HRFVM.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-4X7IX2NK.mjs";import"../../chunk-742ID33B.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-KEYTRAFA.mjs";import"../../chunk-S4SEFF4K.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-6NMKNQQN.mjs";import"../../chunk-5VTCFHSF.mjs";import"../../chunk-XJEPRW6G.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-UTXJOB3O.mjs";import"../../chunk-RKHPXZM6.mjs";import"../../chunk-JM544NRW.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-3JPVQHOR.mjs";import"../../chunk-LYWYWSNY.mjs";import"../../chunk-5L5R6AOV.mjs";import"../../chunk-JMAGEEML.mjs";import"../../chunk-PHHKQFSH.mjs";import"../../chunk-3LAGGRLJ.mjs";import"../../chunk-RKTM5GBP.mjs";import"../../chunk-X6SKLES2.mjs";import"../../chunk-ONIVXO76.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-W637YAND.mjs";import"../../chunk-NC5HHEEM.mjs";import"../../chunk-RFCXZ4TC.mjs";import"../../chunk-MKUAW7KW.mjs";import"../../chunk-Z2ZR4PTF.mjs";import"../../chunk-IEZO4PIG.mjs";import"../../chunk-3VGX3TXH.mjs";import"../../chunk-ZNEBMSNC.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-3S3GIUQY.mjs";import"../../chunk-HYDDIAJ6.mjs";import"../../chunk-MWUJCP27.mjs";import"../../chunk-MGOHPDX4.mjs";import"../../chunk-RFSO3JRG.mjs";import"../../chunk-YE5B2S5L.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-HHVAU5HU.mjs";import"../../chunk-JLWKIYHV.mjs";import"../../chunk-YV7OBLK2.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-3CUVYW32.mjs";import"../../chunk-PGCBIU33.mjs";import"../../chunk-FLYEALDB.mjs";import"../../chunk-N466X3S6.mjs";import"../../chunk-25H3DXTL.mjs";import"../../chunk-SI7MPP6G.mjs";import"../../chunk-TJDC5PWD.mjs";import"../../chunk-COW5IGYC.mjs";import"../../chunk-STYDBDYL.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-7STYQ5ZE.mjs";import"../../chunk-T23OVRNF.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-C3L4ETUF.mjs";import"../../chunk-3FVRXELT.mjs";import"../../chunk-EB7AI4B4.mjs";import"../../chunk-6RBUXB5I.mjs";import"../../chunk-JM2B5E2I.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-VT6XJSRO.mjs";import"../../chunk-TVRJ3M7B.mjs";import"../../chunk-AOCNYMMX.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as Submit};
1
+ import{a}from"../../chunk-BVBPBQK5.mjs";import"../../chunk-6EMN3BOV.mjs";import"../../chunk-LEMNHXB6.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-DYUF5UID.mjs";import"../../chunk-57VQMRBX.mjs";import"../../chunk-PFFAQZHT.mjs";import"../../chunk-TICM455H.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-YUONW2LQ.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-2DIO35OD.mjs";import"../../chunk-ARV2BH5D.mjs";import"../../chunk-TNJDICBE.mjs";import"../../chunk-2LCP7PAJ.mjs";import"../../chunk-65QG6O26.mjs";import"../../chunk-4OSXWFTW.mjs";import"../../chunk-56NB52W6.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-52ECIIIH.mjs";import"../../chunk-NC5HHEEM.mjs";import"../../chunk-KDXECPCS.mjs";import"../../chunk-NNIHTVLA.mjs";import"../../chunk-7WJTKYRG.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-RJ4PSGZ4.mjs";import"../../chunk-3VGX3TXH.mjs";import"../../chunk-ZNEBMSNC.mjs";import"../../chunk-3S3GIUQY.mjs";import"../../chunk-HYDDIAJ6.mjs";import"../../chunk-MWUJCP27.mjs";import"../../chunk-MGOHPDX4.mjs";import"../../chunk-CK272GUS.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-YQF2NZNF.mjs";import"../../chunk-S4SEFF4K.mjs";import"../../chunk-3JPVQHOR.mjs";import"../../chunk-RFSO3JRG.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-HHVAU5HU.mjs";import"../../chunk-JLWKIYHV.mjs";import"../../chunk-YV7OBLK2.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-3CUVYW32.mjs";import"../../chunk-PGCBIU33.mjs";import"../../chunk-FLYEALDB.mjs";import"../../chunk-N466X3S6.mjs";import"../../chunk-25H3DXTL.mjs";import"../../chunk-SI7MPP6G.mjs";import"../../chunk-TJDC5PWD.mjs";import"../../chunk-COW5IGYC.mjs";import"../../chunk-STYDBDYL.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-7STYQ5ZE.mjs";import"../../chunk-T23OVRNF.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-KYZCH7IK.mjs";import"../../chunk-5JGWZSNG.mjs";import"../../chunk-WOPMZAWX.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-UTXJOB3O.mjs";import"../../chunk-RKHPXZM6.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-EB7AI4B4.mjs";import"../../chunk-6RBUXB5I.mjs";import"../../chunk-C3L4ETUF.mjs";import"../../chunk-3FVRXELT.mjs";import"../../chunk-JM2B5E2I.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-VT6XJSRO.mjs";import"../../chunk-TVRJ3M7B.mjs";import"../../chunk-AOCNYMMX.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-CPBGL37X.mjs";import"../../chunk-JM544NRW.mjs";import"../../chunk-YE5B2S5L.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as Submit};
2
2
  //# sourceMappingURL=submit.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-WW4IQL47.mjs";import"../chunk-742ID33B.mjs";import"../chunk-AH44UPM4.mjs";import"../chunk-KEYTRAFA.mjs";import"../chunk-S4SEFF4K.mjs";import"../chunk-N2FKVZ4D.mjs";import"../chunk-6NMKNQQN.mjs";import"../chunk-5VTCFHSF.mjs";import"../chunk-XJEPRW6G.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-UTXJOB3O.mjs";import"../chunk-RKHPXZM6.mjs";import"../chunk-JM544NRW.mjs";import"../chunk-3JPVQHOR.mjs";import"../chunk-LYWYWSNY.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{a as waitForIndexerOnVersion};
1
+ import{a}from"../chunk-NX6YYFXD.mjs";import"../chunk-CK272GUS.mjs";import"../chunk-AH44UPM4.mjs";import"../chunk-YQF2NZNF.mjs";import"../chunk-S4SEFF4K.mjs";import"../chunk-3JPVQHOR.mjs";import"../chunk-N2FKVZ4D.mjs";import"../chunk-KYZCH7IK.mjs";import"../chunk-5JGWZSNG.mjs";import"../chunk-WOPMZAWX.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-UTXJOB3O.mjs";import"../chunk-RKHPXZM6.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-CPBGL37X.mjs";import"../chunk-JM544NRW.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-FVA2OPG4.mjs";export{a as waitForIndexerOnVersion};
2
2
  //# sourceMappingURL=utils.mjs.map
@@ -1,2 +1,2 @@
1
- import"../chunk-FZY4PMEE.mjs";import{a as h}from"../chunk-C3L4ETUF.mjs";import{a as g}from"../chunk-3FVRXELT.mjs";import{a as p,b as q,c as r}from"../chunk-EB7AI4B4.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o}from"../chunk-6RBUXB5I.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import{a}from"../chunk-VT6XJSRO.mjs";import{a as b,b as c,c as d,d as e,e as f}from"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{i as Bool,a as Deserializer,h as EntryFunctionBytes,g as FixedBytes,r as MoveOption,q as MoveString,p as MoveVector,b as Serializable,c as Serializer,n as U128,k as U16,o as U256,l as U32,m as U64,j as U8,d as ensureBoolean,e as outOfRangeErrorMessage,f as validateNumberInRange};
1
+ import"../chunk-FZY4PMEE.mjs";import{a as p,b as q,c as r}from"../chunk-EB7AI4B4.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o}from"../chunk-6RBUXB5I.mjs";import{a as h}from"../chunk-C3L4ETUF.mjs";import{a as g}from"../chunk-3FVRXELT.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import{a}from"../chunk-VT6XJSRO.mjs";import{a as b,b as c,c as d,d as e,e as f}from"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{i as Bool,a as Deserializer,h as EntryFunctionBytes,g as FixedBytes,r as MoveOption,q as MoveString,p as MoveVector,b as Serializable,c as Serializer,n as U128,k as U16,o as U256,l as U32,m as U64,j as U8,d as ensureBoolean,e as outOfRangeErrorMessage,f as validateNumberInRange};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-JMAGEEML.mjs";import{a as c}from"./chunk-X6SKLES2.mjs";import{b as i}from"./chunk-SI7MPP6G.mjs";var o=class{static generate(e={}){let{scheme:t=0,legacy:r=!0}=e;return t===0&&r?n.generate():c.generate({scheme:t})}static fromPrivateKey(e){let{privateKey:t,address:r,legacy:a=!0}=e;return t instanceof i&&a?new n({privateKey:t,address:r}):new c({privateKey:t,address:r})}static fromPrivateKeyAndAddress(e){return this.fromPrivateKey(e)}static fromDerivationPath(e){let{scheme:t=0,mnemonic:r,path:a,legacy:s=!0}=e;return t===0&&s?n.fromDerivationPath({mnemonic:r,path:a}):c.fromDerivationPath({scheme:t,mnemonic:r,path:a})}static authKey(e){let{publicKey:t}=e;return t.authKey()}verifySignature(e){return this.publicKey.verifySignature(e)}};export{o as a};
2
- //# sourceMappingURL=chunk-5L5R6AOV.mjs.map
1
+ import{a as n}from"./chunk-ARV2BH5D.mjs";import{a as c}from"./chunk-4OSXWFTW.mjs";import{b as i}from"./chunk-SI7MPP6G.mjs";var o=class{static generate(e={}){let{scheme:t=0,legacy:r=!0}=e;return t===0&&r?n.generate():c.generate({scheme:t})}static fromPrivateKey(e){let{privateKey:t,address:r,legacy:a=!0}=e;return t instanceof i&&a?new n({privateKey:t,address:r}):new c({privateKey:t,address:r})}static fromPrivateKeyAndAddress(e){return this.fromPrivateKey(e)}static fromDerivationPath(e){let{scheme:t=0,mnemonic:r,path:a,legacy:s=!0}=e;return t===0&&s?n.fromDerivationPath({mnemonic:r,path:a}):c.fromDerivationPath({scheme:t,mnemonic:r,path:a})}static authKey(e){let{publicKey:t}=e;return t.authKey()}verifySignature(e){return this.publicKey.verifySignature(e)}};export{o as a};
2
+ //# sourceMappingURL=chunk-2DIO35OD.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as k}from"./chunk-65QG6O26.mjs";import{a as I,c as N}from"./chunk-56NB52W6.mjs";import{d as P}from"./chunk-HYDDIAJ6.mjs";import{a as g,b as w}from"./chunk-YV7OBLK2.mjs";import{i as F,j as b,k as x,n as m}from"./chunk-PGCBIU33.mjs";import{b as A}from"./chunk-T23OVRNF.mjs";import{a as E}from"./chunk-VT6XJSRO.mjs";import{a as y}from"./chunk-TVRJ3M7B.mjs";import{b as S}from"./chunk-AOCNYMMX.mjs";import{jwtDecode as R}from"jwt-decode";import{JwksClient as v}from"jwks-rsa";import{decode as D}from"js-base64";import J from"eventemitter3";var V={"https://accounts.google.com":"https://www.googleapis.com/oauth2/v3/certs"},j=(r=>(r[r.JWK_EXPIRED=0]="JWK_EXPIRED",r[r.EPK_EXPIRED=1]="EPK_EXPIRED",r[r.PROOF_NOT_FOUND=2]="PROOF_NOT_FOUND",r[r.UNKNOWN_INVALID_SIGNATURE=3]="UNKNOWN_INVALID_SIGNATURE",r[r.UNKNOWN=4]="UNKNOWN",r))(j||{}),l=class n extends Error{constructor(e){super();this.type=e}static async fromAptosApiError(e,t){return e.data.message.includes("INVALID_SIGNATURE")?t.isExpired()?new n(1):await t.checkJwkValidity()?new n(3):new n(0):new n(4)}},s=class s extends y{constructor(e){super();let{address:t,ephemeralKeyPair:i,uidKey:r,uidVal:c,aud:p,pepper:h,proofOrFetcher:o,proofFetchCallback:d,jwt:f}=e;if(this.ephemeralKeyPair=i,this.publicKey=F.create(e),this.accountAddress=t?A.from(t):this.publicKey.authKey().derivedAddress(),this.uidKey=r,this.uidVal=c,this.aud=p,this.jwt=f,this.emitter=new J,this.proofOrPromise=o,o instanceof m)this.proof=o;else{if(d===void 0)throw new Error("Must provide callback for async proof fetch");this.emitter.on("proofFetchFinish",async O=>{await d(O),this.emitter.removeAllListeners()}),this.init(o)}this.signingScheme=2;let u=S.fromHexInput(h).toUint8Array();if(u.length!==s.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${s.PEPPER_LENGTH}`);this.pepper=u,this.isJwtValid=!0}async init(e){try{this.proof=await e,this.emitter.emit("proofFetchFinish",{status:"Success"})}catch(t){t instanceof Error?this.emitter.emit("proofFetchFinish",{status:"Failed",error:t.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("Connot serialize - proof undefined");this.proof.serialize(e)}static deserialize(e){let t=e.deserializeStr(),i=e.deserializeStr(),r=e.deserializeFixedBytes(31),c=k.deserialize(e),p=m.deserialize(e);return s.fromJWTAndProof({proof:p,pepper:r,uidKey:i,jwt:t,ephemeralKeyPair:c})}isExpired(){return this.ephemeralKeyPair.isExpired()}async checkJwkValidity(){if(!this.isJwtValid)return!1;let e=R(this.jwt,{header:!0}),t=new v({jwksUri:V[this.publicKey.iss]});try{return await t.getSigningKey(e.kid),!0}catch{return this.isJwtValid=!1,!1}}signWithAuthenticator(e){let t=new w(this.sign(e)),i=new g(this.publicKey);return new P(i,t)}signTransactionWithAuthenticator(e){let t=new w(this.signTransaction(e)),i=new g(this.publicKey);return new P(i,t)}async waitForProofFetch(){this.proofOrPromise instanceof Promise&&await this.proofOrPromise}sign(e){let{expiryDateSecs:t}=this.ephemeralKeyPair;if(this.isExpired())throw new l(1);if(this.proof===void 0)throw new l(2);if(!this.isJwtValid)throw new l(0);let i=this.ephemeralKeyPair.getPublicKey(),r=this.ephemeralKeyPair.sign(e);return new b({jwtHeader:z(this.jwt.split(".")[0]),ephemeralCertificate:new x(this.proof,0),expiryDateSecs:t,ephemeralPublicKey:i,ephemeralSignature:r})}signTransaction(e){if(this.proof===void 0)throw new Error("Proof not found");let t=I(e),i=new K(t,this.proof.proof),r=N(i);return this.sign(r)}verifySignature(e){throw new Error("Not implemented")}static fromBytes(e){return s.deserialize(new E(e))}static fromJWTAndProof(e){let{proof:t,jwt:i,ephemeralKeyPair:r,pepper:c,proofFetchCallback:p}=e,h=e.uidKey??"sub",o=R(i),d=o.iss;if(typeof o.aud!="string")throw new Error("aud was not found or an array of values");let f=o.aud,u=o[h];return new s({proofOrFetcher:t,ephemeralKeyPair:r,iss:d,uidKey:h,uidVal:u,aud:f,pepper:c,jwt:i,proofFetchCallback:p})}};s.PEPPER_LENGTH=31;var T=s,K=class extends y{constructor(e,t){super();this.transaction=e,this.proof=t}serialize(e){e.serializeFixedBytes(this.transaction.bcsToBytes()),e.serializeOption(this.proof)}};function z(n){let a=n.replace(/-/g,"+").replace(/_/g,"/"),e=a+"==".substring(0,(3-a.length%3)%3);return D(e)}export{V as a,j as b,l as c,T as d};
2
+ //# sourceMappingURL=chunk-2LCP7PAJ.mjs.map
@@ -0,0 +1 @@
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 { JwksClient } from \"jwks-rsa\";\nimport { decode } from \"js-base64\";\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 Signature,\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 { Deserializer, Serializable, Serializer } from \"../bcs\";\nimport {\n deriveTransactionType,\n generateSigningMessageForSerializable,\n} from \"../transactions/transactionBuilder/signingMessage\";\nimport { AnyRawTransaction, AnyRawTransactionInstance } from \"../transactions/types\";\nimport { AptosApiError } from \"../client/types\";\n\nexport const IssuerToJwkEndpoint: Record<string, string> = {\n \"https://accounts.google.com\": \"https://www.googleapis.com/oauth2/v3/certs\",\n};\n\nexport enum KeylessErrorType {\n JWK_EXPIRED,\n EPK_EXPIRED,\n PROOF_NOT_FOUND,\n UNKNOWN_INVALID_SIGNATURE,\n UNKNOWN,\n}\nexport class KeylessError extends Error {\n readonly type: KeylessErrorType;\n\n constructor(type: KeylessErrorType) {\n super();\n this.type = type;\n }\n\n static async fromAptosApiError(error: AptosApiError, signer: KeylessAccount): Promise<KeylessError> {\n if (!error.data.message.includes(\"INVALID_SIGNATURE\")) {\n return new KeylessError(KeylessErrorType.UNKNOWN);\n }\n if (signer.isExpired()) {\n return new KeylessError(KeylessErrorType.EPK_EXPIRED);\n }\n if (!(await signer.checkJwkValidity())) {\n return new KeylessError(KeylessErrorType.JWK_EXPIRED);\n }\n return new KeylessError(KeylessErrorType.UNKNOWN_INVALID_SIGNATURE);\n }\n}\n\nexport class KeylessAccount extends Serializable implements Account {\n static readonly PEPPER_LENGTH: number = 31;\n\n readonly publicKey: KeylessPublicKey;\n\n readonly ephemeralKeyPair: EphemeralKeyPair;\n\n readonly uidKey: string;\n\n readonly uidVal: string;\n\n readonly aud: string;\n\n readonly pepper: Uint8Array;\n\n readonly accountAddress: AccountAddress;\n\n proof: ZeroKnowledgeSig | undefined;\n\n readonly proofOrPromise: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n\n readonly signingScheme: SigningScheme;\n\n private jwt: string;\n\n private isJwtValid: boolean;\n\n readonly emitter: EventEmitter<ProofFetchEvents>;\n\n constructor(args: {\n address?: AccountAddress;\n ephemeralKeyPair: EphemeralKeyPair;\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n proofOrFetcher: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n proofFetchCallback?: ProofFetchCallback;\n jwt: string;\n }) {\n super();\n const { address, ephemeralKeyPair, uidKey, uidVal, aud, pepper, proofOrFetcher, 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 = proofOrFetcher;\n if (proofOrFetcher instanceof ZeroKnowledgeSig) {\n this.proof = proofOrFetcher;\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(proofOrFetcher);\n }\n this.signingScheme = SigningScheme.SingleKey;\n const pepperBytes = Hex.fromHexInput(pepper).toUint8Array();\n if (pepperBytes.length !== KeylessAccount.PEPPER_LENGTH) {\n throw new Error(`Pepper length in bytes should be ${KeylessAccount.PEPPER_LENGTH}`);\n }\n this.pepper = pepperBytes;\n this.isJwtValid = true;\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(\"Connot 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.fromJWTAndProof({\n proof,\n pepper,\n uidKey,\n jwt,\n ephemeralKeyPair,\n });\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 * Checks if the the JWK used to verify the token still exists on the issuer's JWK uri.\n * Caches the result.\n * @return boolean\n */\n async checkJwkValidity(): Promise<boolean> {\n if (!this.isJwtValid) {\n return false;\n }\n const jwtHeader = jwtDecode(this.jwt, { header: true });\n const client = new JwksClient({\n jwksUri: IssuerToJwkEndpoint[this.publicKey.iss],\n });\n try {\n await client.getSigningKey(jwtHeader.kid);\n return true;\n } catch (error) {\n this.isJwtValid = false;\n return false;\n }\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(data: HexInput): KeylessSignature {\n const { expiryDateSecs } = this.ephemeralKeyPair;\n if (this.isExpired()) {\n throw new KeylessError(KeylessErrorType.EPK_EXPIRED);\n }\n if (this.proof === undefined) {\n throw new KeylessError(KeylessErrorType.PROOF_NOT_FOUND);\n }\n if (!this.isJwtValid) {\n throw new KeylessError(KeylessErrorType.JWK_EXPIRED);\n }\n const ephemeralPublicKey = this.ephemeralKeyPair.getPublicKey();\n const ephemeralSignature = this.ephemeralKeyPair.sign(data);\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\");\n }\n const raw = deriveTransactionType(transaction);\n const txnAndProof = new TransactionAndProof(raw, this.proof.proof);\n const signMess = generateSigningMessageForSerializable(txnAndProof);\n return this.sign(signMess);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this\n verifySignature(args: { message: HexInput; signature: Signature }): boolean {\n throw new Error(\"Not implemented\");\n }\n\n static fromBytes(bytes: Uint8Array): KeylessAccount {\n return KeylessAccount.deserialize(new Deserializer(bytes));\n }\n\n static fromJWTAndProof(args: {\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper: HexInput;\n uidKey?: string;\n proofFetchCallback?: ProofFetchCallback;\n }): KeylessAccount {\n const { proof, jwt, ephemeralKeyPair, pepper, proofFetchCallback } = args;\n const uidKey = args.uidKey ?? \"sub\";\n\n const jwtPayload = jwtDecode<JwtPayload & { [key: string]: string }>(jwt);\n const iss = jwtPayload.iss!;\n if (typeof jwtPayload.aud !== \"string\") {\n throw new Error(\"aud was not found or an array of values\");\n }\n const aud = jwtPayload.aud!;\n const uidVal = jwtPayload[uidKey];\n return new KeylessAccount({\n proofOrFetcher: proof,\n ephemeralKeyPair,\n iss,\n uidKey,\n uidVal,\n aud,\n pepper,\n jwt,\n proofFetchCallback,\n });\n }\n}\n\nclass TransactionAndProof extends Serializable {\n transaction: AnyRawTransactionInstance;\n\n proof?: ZkProof;\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\nfunction base64UrlDecode(base64Url: string): string {\n // Replace base64url-specific characters\n const base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Pad the string with '=' characters if needed\n const paddedBase64 = base64 + \"==\".substring(0, (3 - (base64.length % 3)) % 3);\n const decodedString = decode(paddedBase64);\n return decodedString;\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":"oZAGA,OAAqB,aAAAA,MAAiB,aACtC,OAAS,cAAAC,MAAkB,WAC3B,OAAS,UAAAC,MAAc,YACvB,OAAOC,MAAkB,gBA0BlB,IAAMC,EAA8C,CACzD,8BAA+B,4CACjC,EAEYC,OACVA,IAAA,6BACAA,IAAA,6BACAA,IAAA,qCACAA,IAAA,yDACAA,IAAA,qBALUA,OAAA,IAOCC,EAAN,MAAMC,UAAqB,KAAM,CAGtC,YAAYC,EAAwB,CAClC,MAAM,EACN,KAAK,KAAOA,CACd,CAEA,aAAa,kBAAkBC,EAAsBC,EAA+C,CAClG,OAAKD,EAAM,KAAK,QAAQ,SAAS,mBAAmB,EAGhDC,EAAO,UAAU,EACZ,IAAIH,EAAa,CAA4B,EAEhD,MAAMG,EAAO,iBAAiB,EAG7B,IAAIH,EAAa,CAA0C,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,EAAazB,EAAkDd,CAAG,EAClEwC,EAAMD,EAAW,IACvB,GAAI,OAAOA,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,yCAAyC,EAE3D,IAAM3C,EAAM2C,EAAW,IACjB5C,EAAS4C,EAAW7C,CAAM,EAChC,OAAO,IAAIL,EAAe,CACxB,eAAgBuB,EAChB,iBAAAnB,EACA,IAAA+C,EACA,OAAA9C,EACA,OAAAC,EACA,IAAAC,EACA,OAAAC,EACA,IAAAG,EACA,mBAAAD,CACF,CAAC,CACH,CACF,EAtQaV,EACK,cAAwB,GADnC,IAAMoD,EAANpD,EAwQD6C,EAAN,cAAkC5C,CAAa,CAK7C,YAAYiC,EAAwCX,EAAiB,CACnE,MAAM,EACN,KAAK,YAAcW,EACnB,KAAK,MAAQX,CACf,CAEA,UAAUH,EAA8B,CACtCA,EAAW,oBAAoB,KAAK,YAAY,WAAW,CAAC,EAC5DA,EAAW,gBAAgB,KAAK,KAAK,CACvC,CACF,EAEA,SAASoB,EAAgBa,EAA2B,CAElD,IAAMC,EAASD,EAAU,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EAEvDE,EAAeD,EAAS,KAAK,UAAU,GAAI,EAAKA,EAAO,OAAS,GAAM,CAAC,EAE7E,OADsBE,EAAOD,CAAY,CAE3C","names":["jwtDecode","JwksClient","decode","EventEmitter","IssuerToJwkEndpoint","KeylessErrorType","KeylessError","_KeylessError","type","error","signer","_KeylessAccount","Serializable","args","address","ephemeralKeyPair","uidKey","uidVal","aud","pepper","proofOrFetcher","proofFetchCallback","jwt","KeylessPublicKey","AccountAddress","EventEmitter","ZeroKnowledgeSig","status","pepperBytes","Hex","promise","serializer","deserializer","EphemeralKeyPair","proof","jwtHeader","jwtDecode","client","JwksClient","message","signature","AnySignature","publicKey","AnyPublicKey","AccountAuthenticatorSingleKey","transaction","data","expiryDateSecs","ephemeralPublicKey","ephemeralSignature","KeylessSignature","base64UrlDecode","EphemeralCertificate","raw","deriveTransactionType","txnAndProof","TransactionAndProof","signMess","generateSigningMessageForSerializable","bytes","Deserializer","jwtPayload","iss","KeylessAccount","base64Url","base64","paddedBase64","decode"]}
@@ -1,2 +1,2 @@
1
- import{a as r,c as o}from"./chunk-XI2JDNAL.mjs";var t=class{constructor(e){this.config=e}async getPepper(e){return r({aptosConfig:this.config,...e})}async deriveKeylessAccount(e){return o({aptosConfig:this.config,...e})}};export{t as a};
2
- //# sourceMappingURL=chunk-4M24RKAT.mjs.map
1
+ import{a as r,c as o}from"./chunk-T5CGXM6S.mjs";var t=class{constructor(e){this.config=e}async getPepper(e){return r({aptosConfig:this.config,...e})}async deriveKeylessAccount(e){return o({aptosConfig:this.config,...e})}};export{t as a};
2
+ //# sourceMappingURL=chunk-2OMAM2OW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-2KMTDWGQ.mjs";import{h as t}from"./chunk-742ID33B.mjs";var r=class{constructor(o){this.config=o}async fundAccount(o){let n=await i({aptosConfig:this.config,...o});return o.options?.waitForIndexer!==!1&&await t({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version)}),n}};export{r as a};
2
- //# sourceMappingURL=chunk-3V2VDFQY.mjs.map
1
+ import{a as i}from"./chunk-MATOKW5G.mjs";import{h as t}from"./chunk-CK272GUS.mjs";var r=class{constructor(o){this.config=o}async fundAccount(o){let n=await i({aptosConfig:this.config,...o});return o.options?.waitForIndexer!==!1&&await t({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version)}),n}};export{r as a};
2
+ //# sourceMappingURL=chunk-3KRYVZNP.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as p}from"./chunk-ONIVXO76.mjs";import{d as s}from"./chunk-HYDDIAJ6.mjs";import{a as u,b as y}from"./chunk-YV7OBLK2.mjs";import{b as a}from"./chunk-3CUVYW32.mjs";import{b as i}from"./chunk-SI7MPP6G.mjs";import{b as g}from"./chunk-T23OVRNF.mjs";var h=class c{constructor(e){this.signingScheme=2;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=new u(r.publicKey()),this.accountAddress=t?g.from(t):this.publicKey.authKey().derivedAddress()}static generate(e={}){let{scheme:r=0}=e,t;switch(r){case 0:t=i.generate();break;case 2:t=a.generate();break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new c({privateKey:t})}static fromDerivationPath(e){let{scheme:r=0,path:t,mnemonic:o}=e,n;switch(r){case 0:n=i.fromDerivationPath(t,o);break;case 2:n=a.fromDerivationPath(t,o);break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new c({privateKey:n})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){return new s(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new s(this.publicKey,this.signTransaction(e))}sign(e){return new y(this.privateKey.sign(e))}signTransaction(e){return this.sign(p(e))}};export{h as a};
2
- //# sourceMappingURL=chunk-X6SKLES2.mjs.map
1
+ import{d as p}from"./chunk-56NB52W6.mjs";import{d as s}from"./chunk-HYDDIAJ6.mjs";import{a as u,b as y}from"./chunk-YV7OBLK2.mjs";import{b as a}from"./chunk-3CUVYW32.mjs";import{b as i}from"./chunk-SI7MPP6G.mjs";import{b as g}from"./chunk-T23OVRNF.mjs";var h=class c{constructor(e){this.signingScheme=2;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=new u(r.publicKey()),this.accountAddress=t?g.from(t):this.publicKey.authKey().derivedAddress()}static generate(e={}){let{scheme:r=0}=e,t;switch(r){case 0:t=i.generate();break;case 2:t=a.generate();break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new c({privateKey:t})}static fromDerivationPath(e){let{scheme:r=0,path:t,mnemonic:o}=e,n;switch(r){case 0:n=i.fromDerivationPath(t,o);break;case 2:n=a.fromDerivationPath(t,o);break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new c({privateKey:n})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){return new s(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new s(this.publicKey,this.signTransaction(e))}sign(e){return new y(this.privateKey.sign(e))}signTransaction(e){return this.sign(p(e))}};export{h as a};
2
+ //# sourceMappingURL=chunk-4OSXWFTW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-DSD6JNJS.mjs";import{a as l}from"./chunk-3Q5YC6SI.mjs";import{a as h}from"./chunk-4M24RKAT.mjs";import{a as y}from"./chunk-UNPC5XTJ.mjs";import{a as u}from"./chunk-2HESYTXD.mjs";import{a as s}from"./chunk-S7JBGEYI.mjs";import{a as p}from"./chunk-DZRH4BNK.mjs";import{a as A}from"./chunk-CO53EOHE.mjs";import{a as r}from"./chunk-CARMPAYA.mjs";import{a}from"./chunk-NK42HVLJ.mjs";import{a as c}from"./chunk-5DF6PRJH.mjs";import{a as f}from"./chunk-3V2VDFQY.mjs";var t=class{constructor(e){this.config=new A(e),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new f(this.config),this.fungibleAsset=new g(this.config),this.general=new l(this.config),this.staking=new y(this.config),this.transaction=new u(this.config),this.keyless=new h(this.config)}};function n(m,e,d){Object.getOwnPropertyNames(e.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&(o.value=function(...w){return this[d][i](...w)},Object.defineProperty(m.prototype,i,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,f,"faucet");n(t,g,"fungibleAsset");n(t,l,"general");n(t,y,"staking");n(t,u,"transaction");n(t,h,"keyless");export{t as a};
2
- //# sourceMappingURL=chunk-73IEQPK5.mjs.map
1
+ import{a as c}from"./chunk-U7SJ3I5G.mjs";import{a as f}from"./chunk-3KRYVZNP.mjs";import{a as g}from"./chunk-QEZJZOEX.mjs";import{a as l}from"./chunk-VDTM2LUI.mjs";import{a as h}from"./chunk-2OMAM2OW.mjs";import{a as y}from"./chunk-XVK3XHDK.mjs";import{a as u}from"./chunk-VY2DCR3F.mjs";import{a as s}from"./chunk-FUWIJEE6.mjs";import{a as p}from"./chunk-HLN6GUIY.mjs";import{a as A}from"./chunk-CO53EOHE.mjs";import{a as r}from"./chunk-TGXWKN2U.mjs";import{a}from"./chunk-XXBIY3E4.mjs";var t=class{constructor(e){this.config=new A(e),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new f(this.config),this.fungibleAsset=new g(this.config),this.general=new l(this.config),this.staking=new y(this.config),this.transaction=new u(this.config),this.keyless=new h(this.config)}};function n(m,e,d){Object.getOwnPropertyNames(e.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&(o.value=function(...w){return this[d][i](...w)},Object.defineProperty(m.prototype,i,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,f,"faucet");n(t,g,"fungibleAsset");n(t,l,"general");n(t,y,"staking");n(t,u,"transaction");n(t,h,"keyless");export{t as a};
2
+ //# sourceMappingURL=chunk-4SSWQOHR.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-Z2ZR4PTF.mjs";import{b as i}from"./chunk-T23OVRNF.mjs";import{a as d}from"./chunk-TVRJ3M7B.mjs";var o=class t extends d{constructor(e,s,r){super();this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=s}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let s=n.deserialize(e),r=e.deserializeVector(i),c=e.deserializeBool(),a;return c&&(a=i.deserialize(e)),new t(s,r,a)}};export{o as a};
2
- //# sourceMappingURL=chunk-W637YAND.mjs.map
1
+ import{a as n}from"./chunk-7WJTKYRG.mjs";import{b as i}from"./chunk-T23OVRNF.mjs";import{a as d}from"./chunk-TVRJ3M7B.mjs";var o=class t extends d{constructor(e,s,r){super();this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=s}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let s=n.deserialize(e),r=e.deserializeVector(i),c=e.deserializeBool(),a;return c&&(a=i.deserialize(e)),new t(s,r,a)}};export{o as a};
2
+ //# sourceMappingURL=chunk-52ECIIIH.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as T,d as c}from"./chunk-Z2ZR4PTF.mjs";import{f as A,g as a}from"./chunk-YE5B2S5L.mjs";import{sha3_256 as y}from"@noble/hashes/sha3";function d(e){return e.feePayerAddress?new c(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress):e.secondarySignerAddresses?new T(e.rawTransaction,e.secondarySignerAddresses):e.rawTransaction}function n(e,r){let i=y.create();if(!r.startsWith("APTOS::"))throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${r}`);i.update(r);let s=i.digest(),o=e,t=new Uint8Array(s.length+o.length);return t.set(s),t.set(o,s.length),t}function u(e){return n(e.bcsToBytes(),`APTOS::${e.constructor.name}`)}function S(e){let r=d(e);return e.feePayerAddress?n(r.bcsToBytes(),a):e.secondarySignerAddresses?n(r.bcsToBytes(),a):n(r.bcsToBytes(),A)}export{d as a,n as b,u as c,S as d};
2
- //# sourceMappingURL=chunk-ONIVXO76.mjs.map
1
+ import{c as T,d as c}from"./chunk-7WJTKYRG.mjs";import{f as A,g as a}from"./chunk-YE5B2S5L.mjs";import{sha3_256 as y}from"@noble/hashes/sha3";function d(e){return e.feePayerAddress?new c(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress):e.secondarySignerAddresses?new T(e.rawTransaction,e.secondarySignerAddresses):e.rawTransaction}function n(e,r){let i=y.create();if(!r.startsWith("APTOS::"))throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${r}`);i.update(r);let s=i.digest(),o=e,t=new Uint8Array(s.length+o.length);return t.set(s),t.set(o,s.length),t}function u(e){return n(e.bcsToBytes(),`APTOS::${e.constructor.name}`)}function S(e){let r=d(e);return e.feePayerAddress?n(r.bcsToBytes(),a):e.secondarySignerAddresses?n(r.bcsToBytes(),a):n(r.bcsToBytes(),A)}export{d as a,n as b,u as c,S as d};
2
+ //# sourceMappingURL=chunk-56NB52W6.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as A}from"./chunk-PFFAQZHT.mjs";import{a as x,b as c,c as w,d as g,e as M,f as C,g as O,h,i as _,k as V,l as G,m as j,n as k,o as z,p as D,r as i,s as L}from"./chunk-7H3HRFVM.mjs";import{c as I}from"./chunk-4X7IX2NK.mjs";import{n as p}from"./chunk-3VGX3TXH.mjs";import{b as U}from"./chunk-T23OVRNF.mjs";import{a as o,b as S,c as T}from"./chunk-EB7AI4B4.mjs";import{a as d,b as E,c as B,d as v,e as $,f as b,g as F}from"./chunk-6RBUXB5I.mjs";var R=new TextEncoder;function Z(n){return n?.map(e=>c(e)?A(e):e)??[]}async function P(n,e,t,u){let r=await I({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(f=>f.name===t)}async function N(n,e,t,u){let r=await P(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let f=L(r),y=[];for(let s=f;s<r.params.length;s+=1)y.push(A(r.params[s],{allowGenerics:!0}));return{signers:f,typeParameters:r.generic_type_params,parameters:y}}async function a(n,e,t,u){let r=await P(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let f=[];for(let s=0;s<r.params.length;s+=1)f.push(A(r.params[s],{allowGenerics:!0}));let y=[];for(let s=0;s<r.return.length;s+=1)y.push(A(r.return[s],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:f,returnTypes:y}}function nn(n,e,t,u,r){if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let f=e.parameters[u];return l(t,f,u,r)}function l(n,e,t,u){return C(n)?(m(e,n,t),n):X(n,e,t,u)}function X(n,e,t,u){if(e.isBool()){if(x(n))return new d(n);i("boolean",t)}if(e.isAddress()){if(c(n))return U.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){if(w(n))return new E(n);i("number",t)}if(e.isU16()){if(w(n))return new B(n);i("number",t)}if(e.isU32()){if(w(n))return new v(n);i("number",t)}if(e.isU64()){if(g(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(g(n))return new b(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(g(n))return new F(BigInt(n));i("bigint | number | string",t)}if(e.isGeneric()){let r=e.value;if(r<0||r>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return l(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(c(n))return o.U8(R.encode(n));if(n instanceof Uint8Array)return o.U8(n);if(n instanceof ArrayBuffer)return o.U8(new Uint8Array(n))}if(Array.isArray(n))return new o(n.map(r=>l(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(c(n))return new S(n);i("string",t)}if(e.isObject()){if(c(n))return U.fromString(n);i("string | AccountAddress",t)}if(e.isOption())return M(n)?new T(null):new T(l(n,e.value.typeArgs[0],t,u));throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function m(n,e,t){if(n.isBool()){if(O(e))return;i("Bool",t)}if(n.isAddress()){if(h(e))return;i("AccountAddress",t)}if(n.isU8()){if(V(e))return;i("U8",t)}if(n.isU16()){if(G(e))return;i("U16",t)}if(n.isU32()){if(j(e))return;i("U32",t)}if(n.isU64()){if(k(e))return;i("U64",t)}if(n.isU128()){if(z(e))return;i("U128",t)}if(n.isU256()){if(D(e))return;i("U256",t)}if(n.isVector()){if(e instanceof o){e.values.length>0&&m(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof p){if(n.isString()){if(_(e))return;i("MoveString",t)}if(n.isObject()){if(h(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof T){e.value!==void 0&&m(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{Z as a,P as b,N as c,a as d,nn as e,l as f};
2
- //# sourceMappingURL=chunk-ZUIKWQJD.mjs.map
1
+ import{c as A}from"./chunk-PFFAQZHT.mjs";import{a as x,b as c,c as w,d as g,e as M,f as C,g as O,h,i as _,k as V,l as G,m as j,n as k,o as z,p as D,r as i,s as L}from"./chunk-TICM455H.mjs";import{c as I}from"./chunk-YUONW2LQ.mjs";import{n as p}from"./chunk-3VGX3TXH.mjs";import{b as U}from"./chunk-T23OVRNF.mjs";import{a as o,b as S,c as T}from"./chunk-EB7AI4B4.mjs";import{a as d,b as E,c as B,d as v,e as $,f as b,g as F}from"./chunk-6RBUXB5I.mjs";var R=new TextEncoder;function Z(n){return n?.map(e=>c(e)?A(e):e)??[]}async function P(n,e,t,u){let r=await I({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(f=>f.name===t)}async function N(n,e,t,u){let r=await P(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let f=L(r),y=[];for(let s=f;s<r.params.length;s+=1)y.push(A(r.params[s],{allowGenerics:!0}));return{signers:f,typeParameters:r.generic_type_params,parameters:y}}async function a(n,e,t,u){let r=await P(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let f=[];for(let s=0;s<r.params.length;s+=1)f.push(A(r.params[s],{allowGenerics:!0}));let y=[];for(let s=0;s<r.return.length;s+=1)y.push(A(r.return[s],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:f,returnTypes:y}}function nn(n,e,t,u,r){if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let f=e.parameters[u];return l(t,f,u,r)}function l(n,e,t,u){return C(n)?(m(e,n,t),n):X(n,e,t,u)}function X(n,e,t,u){if(e.isBool()){if(x(n))return new d(n);i("boolean",t)}if(e.isAddress()){if(c(n))return U.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){if(w(n))return new E(n);i("number",t)}if(e.isU16()){if(w(n))return new B(n);i("number",t)}if(e.isU32()){if(w(n))return new v(n);i("number",t)}if(e.isU64()){if(g(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(g(n))return new b(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(g(n))return new F(BigInt(n));i("bigint | number | string",t)}if(e.isGeneric()){let r=e.value;if(r<0||r>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return l(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(c(n))return o.U8(R.encode(n));if(n instanceof Uint8Array)return o.U8(n);if(n instanceof ArrayBuffer)return o.U8(new Uint8Array(n))}if(Array.isArray(n))return new o(n.map(r=>l(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(c(n))return new S(n);i("string",t)}if(e.isObject()){if(c(n))return U.fromString(n);i("string | AccountAddress",t)}if(e.isOption())return M(n)?new T(null):new T(l(n,e.value.typeArgs[0],t,u));throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function m(n,e,t){if(n.isBool()){if(O(e))return;i("Bool",t)}if(n.isAddress()){if(h(e))return;i("AccountAddress",t)}if(n.isU8()){if(V(e))return;i("U8",t)}if(n.isU16()){if(G(e))return;i("U16",t)}if(n.isU32()){if(j(e))return;i("U32",t)}if(n.isU64()){if(k(e))return;i("U64",t)}if(n.isU128()){if(z(e))return;i("U128",t)}if(n.isU256()){if(D(e))return;i("U256",t)}if(n.isVector()){if(e instanceof o){e.values.length>0&&m(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof p){if(n.isString()){if(_(e))return;i("MoveString",t)}if(n.isObject()){if(h(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof T){e.value!==void 0&&m(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{Z as a,P as b,N as c,a as d,nn as e,l as f};
2
+ //# sourceMappingURL=chunk-57VQMRBX.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-XJEPRW6G.mjs";async function r(e){let{aptosConfig:t,overrides:s,params:n,contentType:o,acceptType:i,path:a,originMethod:R,type:d}=e,u=t.getRequestUrl(d);return p({url:u,method:"GET",originMethod:R,path:a,contentType:o,acceptType:i,params:n,overrides:{...t.clientConfig,...s}},t,e.type)}async function m(e){let{aptosConfig:t}=e;return r({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function y(e){return r({...e,type:"Pepper"})}async function A(e){let t=[],s,n=e.params;do{let o=await r({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:n,overrides:e.overrides});s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),n.start=s}while(s!=null);return t}export{r as a,m as b,y as c,A as d};
2
- //# sourceMappingURL=chunk-6NMKNQQN.mjs.map
1
+ import{b as p}from"./chunk-WOPMZAWX.mjs";async function r(e){let{aptosConfig:t,overrides:s,params:n,contentType:o,acceptType:i,path:a,originMethod:R,type:d}=e,u=t.getRequestUrl(d);return p({url:u,method:"GET",originMethod:R,path:a,contentType:o,acceptType:i,params:n,overrides:{...t.clientConfig,...s}},t,e.type)}async function m(e){let{aptosConfig:t}=e;return r({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function y(e){return r({...e,type:"Pepper"})}async function A(e){let t=[],s,n=e.params;do{let o=await r({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:n,overrides:e.overrides});s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),n.start=s}while(s!=null);return t}export{r as a,m as b,y as c,A as d};
2
+ //# sourceMappingURL=chunk-5JGWZSNG.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as b}from"./chunk-PGCBIU33.mjs";import{b as h,c as d,e as m}from"./chunk-FLYEALDB.mjs";import{a as y,b as u}from"./chunk-25H3DXTL.mjs";import{b as s}from"./chunk-SI7MPP6G.mjs";import{a as c}from"./chunk-VT6XJSRO.mjs";import{a as p}from"./chunk-TVRJ3M7B.mjs";import{b as l}from"./chunk-AOCNYMMX.mjs";import{randomBytes as E}from"@noble/hashes/utils";var i=class i extends p{constructor(e){super();let{privateKey:r,expiryDateSecs:n,blinder:a}=e;this.privateKey=r,this.publicKey=new y(r.publicKey()),this.expiryDateSecs=n||BigInt(v(f()+b)),this.blinder=a!==void 0?l.fromHexInput(a).toUint8Array():S(),this.nonce=this.generateNonce()}getPublicKey(){return this.publicKey}isExpired(){return Math.floor(Date.now()/1e3)>this.expiryDateSecs}serialize(e){e.serializeU32AsUleb128(this.publicKey.variant),e.serializeBytes(this.privateKey.toUint8Array()),e.serializeU64(this.expiryDateSecs),e.serializeFixedBytes(this.blinder)}static deserialize(e){let r=e.deserializeUleb128AsU32(),n;switch(r){case 0:n=s.deserialize(e);break;default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}let a=e.deserializeU64(),x=e.deserializeFixedBytes(31);return new i({privateKey:n,expiryDateSecs:a,blinder:x})}static fromBytes(e){return i.deserialize(new c(e))}static generate(e){let r;switch(e?.scheme){case 0:default:r=s.generate()}return new i({privateKey:r,expiryDateSecs:e?.expiryDateSecs})}generateNonce(){let e=h(this.publicKey.bcsToBytes(),93);return e.push(BigInt(this.expiryDateSecs)),e.push(d(this.blinder)),m(e).toString()}sign(e){if(this.isExpired())throw new Error("EphemeralKeyPair has expired");return new u(this.privateKey.sign(e))}};i.BLINDER_LENGTH=31;var o=i;function S(){return E(o.BLINDER_LENGTH)}function f(){return Math.floor(new Date().getTime()/1e3)}function v(K){let t=new Date(K*1e3);return t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),Math.floor(t.getTime()/1e3)}export{o as a};
2
+ //# sourceMappingURL=chunk-65QG6O26.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/account/EphemeralKeyPair.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { randomBytes } from \"@noble/hashes/utils\";\n\nimport {\n EPK_HORIZON_SECS,\n Ed25519PrivateKey,\n EphemeralPublicKey,\n EphemeralSignature,\n PrivateKey,\n} from \"../core/crypto\";\nimport { Hex } from \"../core/hex\";\nimport { bytesToBigIntLE, padAndPackBytesWithLen, poseidonHash } from \"../core/crypto/poseidon\";\nimport { EphemeralPublicKeyVariant, HexInput } from \"../types\";\nimport { Deserializer, Serializable, Serializer } from \"../bcs\";\n\nexport class EphemeralKeyPair extends Serializable {\n static readonly BLINDER_LENGTH: number = 31;\n\n /**\n * A byte array of length BLINDER_LENGTH used to obfuscate the public key from the IdP.\n * Used in calculating the nonce passed to the IdP and as a secret witness in proof generation.\n */\n readonly blinder: Uint8Array;\n\n /**\n * A timestamp in seconds indicating when the ephemeral key pair is expired. After expiry, a new\n * EphemeralKeyPair must be generated and a new JWT needs to be created.\n */\n readonly expiryDateSecs: bigint | number;\n\n /**\n * The value passed to the IdP when the user authenticates. It comprises of a hash of the\n * ephermeral public key, expiry date, and blinder.\n */\n readonly nonce: string;\n\n /**\n * A private key used to sign transactions. This private key is not tied to any account on the chain as it\n * is ephemeral in nature.\n */\n private privateKey: PrivateKey;\n\n /**\n * A public key used to verify transactions. This public key is not tied to any account on the chain as it\n * is ephemeral in nature.\n */\n private publicKey: EphemeralPublicKey;\n\n constructor(args: { privateKey: PrivateKey; expiryDateSecs?: bigint | number; blinder?: HexInput }) {\n super();\n const { privateKey, expiryDateSecs, blinder } = args;\n this.privateKey = privateKey;\n this.publicKey = new EphemeralPublicKey(privateKey.publicKey());\n // We set the expiry date to be the nearest floored hour\n this.expiryDateSecs = expiryDateSecs || BigInt(floorToWholeHour(currentTimeInSeconds() + EPK_HORIZON_SECS));\n // Generate the blinder if not provided\n this.blinder = blinder !== undefined ? Hex.fromHexInput(blinder).toUint8Array() : generateBlinder();\n // Calculate the nonce\n this.nonce = this.generateNonce();\n }\n\n /**\n * Returns the public key of the key pair.\n * @return EphemeralPublicKey\n */\n getPublicKey(): EphemeralPublicKey {\n return this.publicKey;\n }\n\n /**\n * Returns the public key of the key pair.\n * @return boolean\n */\n isExpired(): boolean {\n const currentTimeSecs: number = Math.floor(Date.now() / 1000);\n return currentTimeSecs > this.expiryDateSecs;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.publicKey.variant);\n serializer.serializeBytes(this.privateKey.toUint8Array());\n serializer.serializeU64(this.expiryDateSecs);\n serializer.serializeFixedBytes(this.blinder);\n }\n\n static deserialize(deserializer: Deserializer): EphemeralKeyPair {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let privateKey: PrivateKey;\n switch (variantIndex) {\n case EphemeralPublicKeyVariant.Ed25519:\n privateKey = Ed25519PrivateKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for EphemeralPublicKey: ${variantIndex}`);\n }\n const expiryDateSecs = deserializer.deserializeU64();\n const blinder = deserializer.deserializeFixedBytes(31);\n return new EphemeralKeyPair({ privateKey, expiryDateSecs, blinder });\n }\n\n static fromBytes(bytes: Uint8Array): EphemeralKeyPair {\n return EphemeralKeyPair.deserialize(new Deserializer(bytes));\n }\n\n /**\n * Returns the public key of the key pair.\n * @param scheme the type of keypair to use for the EphemeralKeyPair. Only Ed25519 supported for now.\n * @return boolean\n */\n static generate(args?: { scheme: EphemeralPublicKeyVariant }): EphemeralKeyPair {\n let privateKey: PrivateKey;\n\n switch (args?.scheme) {\n case EphemeralPublicKeyVariant.Ed25519:\n default:\n privateKey = Ed25519PrivateKey.generate();\n }\n\n return new EphemeralKeyPair({ privateKey });\n }\n\n private generateNonce(): string {\n const fields = padAndPackBytesWithLen(this.publicKey.bcsToBytes(), 93);\n fields.push(BigInt(this.expiryDateSecs));\n fields.push(bytesToBigIntLE(this.blinder));\n const nonceHash = poseidonHash(fields);\n return nonceHash.toString();\n }\n\n /**\n * Sign the given message with the private key.\n *\n * @param data in HexInput format\n * @returns EphemeralSignature\n */\n sign(data: HexInput): EphemeralSignature {\n if (this.isExpired()) {\n throw new Error(\"EphemeralKeyPair has expired\");\n }\n return new EphemeralSignature(this.privateKey.sign(data));\n }\n}\n\nfunction generateBlinder(): Uint8Array {\n return randomBytes(EphemeralKeyPair.BLINDER_LENGTH);\n}\n\nfunction currentTimeInSeconds(): number {\n return Math.floor(new Date().getTime() / 1000);\n}\n\nfunction floorToWholeHour(timestampInSeconds: number): number {\n const date = new Date(timestampInSeconds * 1000);\n // Reset minutes and seconds to zero\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return Math.floor(date.getTime() / 1000);\n}\n"],"mappings":"oTAGA,OAAS,eAAAA,MAAmB,sBAcrB,IAAMC,EAAN,MAAMA,UAAyBC,CAAa,CAiCjD,YAAYC,EAAwF,CAClG,MAAM,EACN,GAAM,CAAE,WAAAC,EAAY,eAAAC,EAAgB,QAAAC,CAAQ,EAAIH,EAChD,KAAK,WAAaC,EAClB,KAAK,UAAY,IAAIG,EAAmBH,EAAW,UAAU,CAA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E,EAAgB,KAAK,OAAO,CAAC,EACvBC,EAAaH,CAAM,EACpB,SAAS,CAC5B,CAQA,KAAKI,EAAoC,CACvC,GAAI,KAAK,UAAU,EACjB,MAAM,IAAI,MAAM,8BAA8B,EAEhD,OAAO,IAAIC,EAAmB,KAAK,WAAW,KAAKD,CAAI,CAAC,CAC1D,CACF,EA9HatB,EACK,eAAyB,GADpC,IAAMwB,EAANxB,EAgIP,SAASW,GAA8B,CACrC,OAAOc,EAAYD,EAAiB,cAAc,CACpD,CAEA,SAAShB,GAA+B,CACtC,OAAO,KAAK,MAAM,IAAI,KAAK,EAAE,QAAQ,EAAI,GAAI,CAC/C,CAEA,SAASD,EAAiBmB,EAAoC,CAC5D,IAAMC,EAAO,IAAI,KAAKD,EAAqB,GAAI,EAE/C,OAAAC,EAAK,WAAW,CAAC,EACjBA,EAAK,WAAW,CAAC,EACjBA,EAAK,gBAAgB,CAAC,EACf,KAAK,MAAMA,EAAK,QAAQ,EAAI,GAAI,CACzC","names":["randomBytes","_EphemeralKeyPair","Serializable","args","privateKey","expiryDateSecs","blinder","EphemeralPublicKey","floorToWholeHour","currentTimeInSeconds","EPK_HORIZON_SECS","Hex","generateBlinder","serializer","deserializer","variantIndex","Ed25519PrivateKey","bytes","Deserializer","fields","padAndPackBytesWithLen","bytesToBigIntLE","poseidonHash","data","EphemeralSignature","EphemeralKeyPair","randomBytes","timestampInSeconds","date"]}
1
+ {"version":3,"sources":["../../src/account/EphemeralKeyPair.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { randomBytes } from \"@noble/hashes/utils\";\n\nimport {\n EPK_HORIZON_SECS,\n Ed25519PrivateKey,\n EphemeralPublicKey,\n EphemeralSignature,\n PrivateKey,\n} from \"../core/crypto\";\nimport { Hex } from \"../core/hex\";\nimport { bytesToBigIntLE, padAndPackBytesWithLen, poseidonHash } from \"../core/crypto/poseidon\";\nimport { EphemeralPublicKeyVariant, HexInput } from \"../types\";\nimport { Deserializer, Serializable, Serializer } from \"../bcs\";\n\nexport class EphemeralKeyPair extends Serializable {\n static readonly BLINDER_LENGTH: number = 31;\n\n /**\n * A byte array of length BLINDER_LENGTH used to obfuscate the public key from the IdP.\n * Used in calculating the nonce passed to the IdP and as a secret witness in proof generation.\n */\n readonly blinder: Uint8Array;\n\n /**\n * A timestamp in seconds indicating when the ephemeral key pair is expired. After expiry, a new\n * EphemeralKeyPair must be generated and a new JWT needs to be created.\n */\n readonly expiryDateSecs: bigint | number;\n\n /**\n * The value passed to the IdP when the user authenticates. It comprises of a hash of the\n * ephermeral public key, expiry date, and blinder.\n */\n readonly nonce: string;\n\n /**\n * A private key used to sign transactions. This private key is not tied to any account on the chain as it\n * is ephemeral in nature.\n */\n private privateKey: PrivateKey;\n\n /**\n * A public key used to verify transactions. This public key is not tied to any account on the chain as it\n * is ephemeral in nature.\n */\n private publicKey: EphemeralPublicKey;\n\n constructor(args: { privateKey: PrivateKey; expiryDateSecs?: bigint | number; blinder?: HexInput }) {\n super();\n const { privateKey, expiryDateSecs, blinder } = args;\n this.privateKey = privateKey;\n this.publicKey = new EphemeralPublicKey(privateKey.publicKey());\n // We set the expiry date to be the nearest floored hour\n this.expiryDateSecs = expiryDateSecs || BigInt(floorToWholeHour(currentTimeInSeconds() + EPK_HORIZON_SECS));\n // Generate the blinder if not provided\n this.blinder = blinder !== undefined ? Hex.fromHexInput(blinder).toUint8Array() : generateBlinder();\n // Calculate the nonce\n this.nonce = this.generateNonce();\n }\n\n /**\n * Returns the public key of the key pair.\n * @return EphemeralPublicKey\n */\n getPublicKey(): EphemeralPublicKey {\n return this.publicKey;\n }\n\n /**\n * Returns the public key of the key pair.\n * @return boolean\n */\n isExpired(): boolean {\n const currentTimeSecs: number = Math.floor(Date.now() / 1000);\n return currentTimeSecs > this.expiryDateSecs;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.publicKey.variant);\n serializer.serializeBytes(this.privateKey.toUint8Array());\n serializer.serializeU64(this.expiryDateSecs);\n serializer.serializeFixedBytes(this.blinder);\n }\n\n static deserialize(deserializer: Deserializer): EphemeralKeyPair {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let privateKey: PrivateKey;\n switch (variantIndex) {\n case EphemeralPublicKeyVariant.Ed25519:\n privateKey = Ed25519PrivateKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for EphemeralPublicKey: ${variantIndex}`);\n }\n const expiryDateSecs = deserializer.deserializeU64();\n const blinder = deserializer.deserializeFixedBytes(31);\n return new EphemeralKeyPair({ privateKey, expiryDateSecs, blinder });\n }\n\n static fromBytes(bytes: Uint8Array): EphemeralKeyPair {\n return EphemeralKeyPair.deserialize(new Deserializer(bytes));\n }\n\n /**\n * Returns the public key of the key pair.\n * @param scheme the type of keypair to use for the EphemeralKeyPair. Only Ed25519 supported for now.\n * @param expiryDateSecs the date of expiry.\n * @return boolean\n */\n static generate(args?: { scheme: EphemeralPublicKeyVariant; expiryDateSecs?: bigint | number }): EphemeralKeyPair {\n let privateKey: PrivateKey;\n\n switch (args?.scheme) {\n case EphemeralPublicKeyVariant.Ed25519:\n default:\n privateKey = Ed25519PrivateKey.generate();\n }\n\n return new EphemeralKeyPair({ privateKey, expiryDateSecs: args?.expiryDateSecs });\n }\n\n private generateNonce(): string {\n const fields = padAndPackBytesWithLen(this.publicKey.bcsToBytes(), 93);\n fields.push(BigInt(this.expiryDateSecs));\n fields.push(bytesToBigIntLE(this.blinder));\n const nonceHash = poseidonHash(fields);\n return nonceHash.toString();\n }\n\n /**\n * Sign the given message with the private key.\n *\n * @param data in HexInput format\n * @returns EphemeralSignature\n */\n sign(data: HexInput): EphemeralSignature {\n if (this.isExpired()) {\n throw new Error(\"EphemeralKeyPair has expired\");\n }\n return new EphemeralSignature(this.privateKey.sign(data));\n }\n}\n\nfunction generateBlinder(): Uint8Array {\n return randomBytes(EphemeralKeyPair.BLINDER_LENGTH);\n}\n\nfunction currentTimeInSeconds(): number {\n return Math.floor(new Date().getTime() / 1000);\n}\n\nfunction floorToWholeHour(timestampInSeconds: number): number {\n const date = new Date(timestampInSeconds * 1000);\n // Reset minutes and seconds to zero\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return Math.floor(date.getTime() / 1000);\n}\n"],"mappings":"oTAGA,OAAS,eAAAA,MAAmB,sBAcrB,IAAMC,EAAN,MAAMA,UAAyBC,CAAa,CAiCjD,YAAYC,EAAwF,CAClG,MAAM,EACN,GAAM,CAAE,WAAAC,EAAY,eAAAC,EAAgB,QAAAC,CAAQ,EAAIH,EAChD,KAAK,WAAaC,EAClB,KAAK,UAAY,IAAIG,EAAmBH,EAAW,UAAU,CAAC,EAE9D,KAAK,eAAiBC,GAAkB,OAAOG,EAAiBC,EAAqB,EAAIC,CAAgB,CAAC,EAE1G,KAAK,QAAUJ,IAAY,OAAYK,EAAI,aAAaL,CAAO,EAAE,aAAa,EAAIM,EAAgB,EAElG,KAAK,MAAQ,KAAK,cAAc,CAClC,CAMA,cAAmC,CACjC,OAAO,KAAK,SACd,CAMA,WAAqB,CAEnB,OADgC,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EACnC,KAAK,cAChC,CAEA,UAAUC,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,UAAU,OAAO,EACvDA,EAAW,eAAe,KAAK,WAAW,aAAa,CAAC,EACxDA,EAAW,aAAa,KAAK,cAAc,EAC3CA,EAAW,oBAAoB,KAAK,OAAO,CAC7C,CAEA,OAAO,YAAYC,EAA8C,CAC/D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDV,EACJ,OAAQW,EAAc,CACpB,OACEX,EAAaY,EAAkB,YAAYF,CAAY,EACvD,MACF,QACE,MAAM,IAAI,MAAM,iDAAiDC,CAAY,EAAE,CACnF,CACA,IAAMV,EAAiBS,EAAa,eAAe,EAC7CR,EAAUQ,EAAa,sBAAsB,EAAE,EACrD,OAAO,IAAIb,EAAiB,CAAE,WAAAG,EAAY,eAAAC,EAAgB,QAAAC,CAAQ,CAAC,CACrE,CAEA,OAAO,UAAUW,EAAqC,CACpD,OAAOhB,EAAiB,YAAY,IAAIiB,EAAaD,CAAK,CAAC,CAC7D,CAQA,OAAO,SAASd,EAAkG,CAChH,IAAIC,EAEJ,OAAQD,GAAM,OAAQ,CACpB,OACA,QACEC,EAAaY,EAAkB,SAAS,CAC5C,CAEA,OAAO,IAAIf,EAAiB,CAAE,WAAAG,EAAY,eAAgBD,GAAM,cAAe,CAAC,CAClF,CAEQ,eAAwB,CAC9B,IAAMgB,EAASC,EAAuB,KAAK,UAAU,WAAW,EAAG,EAAE,EACrE,OAAAD,EAAO,KAAK,OAAO,KAAK,cAAc,CAAC,EACvCA,EAAO,KAAKE,EAAgB,KAAK,OAAO,CAAC,EACvBC,EAAaH,CAAM,EACpB,SAAS,CAC5B,CAQA,KAAKI,EAAoC,CACvC,GAAI,KAAK,UAAU,EACjB,MAAM,IAAI,MAAM,8BAA8B,EAEhD,OAAO,IAAIC,EAAmB,KAAK,WAAW,KAAKD,CAAI,CAAC,CAC1D,CACF,EA/HatB,EACK,eAAyB,GADpC,IAAMwB,EAANxB,EAiIP,SAASW,GAA8B,CACrC,OAAOc,EAAYD,EAAiB,cAAc,CACpD,CAEA,SAAShB,GAA+B,CACtC,OAAO,KAAK,MAAM,IAAI,KAAK,EAAE,QAAQ,EAAI,GAAI,CAC/C,CAEA,SAASD,EAAiBmB,EAAoC,CAC5D,IAAMC,EAAO,IAAI,KAAKD,EAAqB,GAAI,EAE/C,OAAAC,EAAK,WAAW,CAAC,EACjBA,EAAK,WAAW,CAAC,EACjBA,EAAK,gBAAgB,CAAC,EACf,KAAK,MAAMA,EAAK,QAAQ,EAAI,GAAI,CACzC","names":["randomBytes","_EphemeralKeyPair","Serializable","args","privateKey","expiryDateSecs","blinder","EphemeralPublicKey","floorToWholeHour","currentTimeInSeconds","EPK_HORIZON_SECS","Hex","generateBlinder","serializer","deserializer","variantIndex","Ed25519PrivateKey","bytes","Deserializer","fields","padAndPackBytesWithLen","bytesToBigIntLE","poseidonHash","data","EphemeralSignature","EphemeralKeyPair","randomBytes","timestampInSeconds","date"]}
@@ -1,2 +1,2 @@
1
- import{b as m}from"./chunk-IEZO4PIG.mjs";import{a as h}from"./chunk-MWUJCP27.mjs";import{b as t}from"./chunk-T23OVRNF.mjs";import{a as u}from"./chunk-TVRJ3M7B.mjs";var o=class i extends u{constructor(e,s,a,n,d,l,_){super();this.sender=e,this.sequence_number=s,this.payload=a,this.max_gas_amount=n,this.gas_unit_price=d,this.expiration_timestamp_secs=l,this.chain_id=_}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=t.deserialize(e),a=e.deserializeU64(),n=m.deserialize(e),d=e.deserializeU64(),l=e.deserializeU64(),_=e.deserializeU64(),b=h.deserialize(e);return new i(s,a,n,d,l,_,b)}},c=class extends u{static deserialize(r){let e=r.deserializeUleb128AsU32();switch(e){case 0:return p.load(r);case 1:return y.load(r);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},p=class i extends c{constructor(e,s){super();this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=o.deserialize(e),a=e.deserializeVector(t);return new i(s,a)}},y=class i extends c{constructor(e,s,a){super();this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=a}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=o.deserialize(e),a=e.deserializeVector(t),n=t.deserialize(e);return new i(s,a,n)}};export{o as a,c as b,p as c,y as d};
2
- //# sourceMappingURL=chunk-Z2ZR4PTF.mjs.map
1
+ import{b as m}from"./chunk-RJ4PSGZ4.mjs";import{a as h}from"./chunk-MWUJCP27.mjs";import{b as t}from"./chunk-T23OVRNF.mjs";import{a as u}from"./chunk-TVRJ3M7B.mjs";var o=class i extends u{constructor(e,s,a,n,d,l,_){super();this.sender=e,this.sequence_number=s,this.payload=a,this.max_gas_amount=n,this.gas_unit_price=d,this.expiration_timestamp_secs=l,this.chain_id=_}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=t.deserialize(e),a=e.deserializeU64(),n=m.deserialize(e),d=e.deserializeU64(),l=e.deserializeU64(),_=e.deserializeU64(),b=h.deserialize(e);return new i(s,a,n,d,l,_,b)}},c=class extends u{static deserialize(r){let e=r.deserializeUleb128AsU32();switch(e){case 0:return p.load(r);case 1:return y.load(r);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},p=class i extends c{constructor(e,s){super();this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=o.deserialize(e),a=e.deserializeVector(t);return new i(s,a)}},y=class i extends c{constructor(e,s,a){super();this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=a}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=o.deserialize(e),a=e.deserializeVector(t),n=t.deserialize(e);return new i(s,a,n)}};export{o as a,c as b,p as c,y as d};
2
+ //# sourceMappingURL=chunk-7WJTKYRG.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as o}from"./chunk-ONIVXO76.mjs";import{b as i}from"./chunk-HYDDIAJ6.mjs";import{b as n}from"./chunk-SI7MPP6G.mjs";import{b as s}from"./chunk-T23OVRNF.mjs";var c=class a{constructor(t){this.signingScheme=0;let{privateKey:e,address:r}=t;this.privateKey=e,this.publicKey=e.publicKey(),this.accountAddress=r?s.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let t=n.generate();return new a({privateKey:t})}static fromDerivationPath(t){let{path:e,mnemonic:r}=t,u=n.fromDerivationPath(e,r);return new a({privateKey:u})}verifySignature(t){return this.publicKey.verifySignature(t)}signWithAuthenticator(t){return new i(this.publicKey,this.privateKey.sign(t))}signTransactionWithAuthenticator(t){return new i(this.publicKey,this.signTransaction(t))}sign(t){return this.privateKey.sign(t)}signTransaction(t){return this.sign(o(t))}};export{c as a};
2
- //# sourceMappingURL=chunk-JMAGEEML.mjs.map
1
+ import{d as o}from"./chunk-56NB52W6.mjs";import{b as i}from"./chunk-HYDDIAJ6.mjs";import{b as n}from"./chunk-SI7MPP6G.mjs";import{b as s}from"./chunk-T23OVRNF.mjs";var c=class a{constructor(t){this.signingScheme=0;let{privateKey:e,address:r}=t;this.privateKey=e,this.publicKey=e.publicKey(),this.accountAddress=r?s.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let t=n.generate();return new a({privateKey:t})}static fromDerivationPath(t){let{path:e,mnemonic:r}=t,u=n.fromDerivationPath(e,r);return new a({privateKey:u})}verifySignature(t){return this.publicKey.verifySignature(t)}signWithAuthenticator(t){return new i(this.publicKey,this.privateKey.sign(t))}signTransactionWithAuthenticator(t){return new i(this.publicKey,this.signTransaction(t))}sign(t){return this.privateKey.sign(t)}signTransaction(t){return this.sign(o(t))}};export{c as a};
2
+ //# sourceMappingURL=chunk-ARV2BH5D.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-6EMN3BOV.mjs";import{g as a}from"./chunk-6S4QCJMU.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
2
- //# sourceMappingURL=chunk-LEJFBNCK.mjs.map
1
+ import{a as i}from"./chunk-6EMN3BOV.mjs";import{g as a}from"./chunk-LEMNHXB6.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
2
+ //# sourceMappingURL=chunk-BVBPBQK5.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-AH44UPM4.mjs";import{h as x,i as P}from"./chunk-KEYTRAFA.mjs";import{b as c,d as A}from"./chunk-6NMKNQQN.mjs";import{a as C}from"./chunk-RKHPXZM6.mjs";import{a as h}from"./chunk-3JPVQHOR.mjs";import{d as w}from"./chunk-YE5B2S5L.mjs";async function v(s){let{aptosConfig:n,options:t}=s;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(s){let{aptosConfig:n}=s;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(s){let{aptosConfig:n,ledgerVersion:t}=s,{data:o}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return o}async function T(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return o}async function G(s){let{aptosConfig:n,transactionHash:t}=s;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(o){if(o?.status===404)return!0;throw o}}async function b(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return o}async function W(s){let{aptosConfig:n,transactionHash:t,options:o}=s,r=o?.timeoutSecs??20,u=o?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof C)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(s){let{aptosConfig:n,processorType:t}=s,o=BigInt(s.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<o;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=o)break;await h(200)}}var f=class extends Error{constructor(t,o){super(t);this.lastSubmittedTransaction=o}},y=class extends Error{constructor(t,o){super(t);this.transaction=o}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
2
- //# sourceMappingURL=chunk-742ID33B.mjs.map
1
+ import{a as R}from"./chunk-AH44UPM4.mjs";import{h as x,i as P}from"./chunk-YQF2NZNF.mjs";import{a as h}from"./chunk-3JPVQHOR.mjs";import{b as c,d as A}from"./chunk-5JGWZSNG.mjs";import{a as C}from"./chunk-RKHPXZM6.mjs";import{d as w}from"./chunk-YE5B2S5L.mjs";async function v(s){let{aptosConfig:n,options:t}=s;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(s){let{aptosConfig:n}=s;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(s){let{aptosConfig:n,ledgerVersion:t}=s,{data:o}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return o}async function T(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return o}async function G(s){let{aptosConfig:n,transactionHash:t}=s;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(o){if(o?.status===404)return!0;throw o}}async function b(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return o}async function W(s){let{aptosConfig:n,transactionHash:t,options:o}=s,r=o?.timeoutSecs??20,u=o?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof C)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(s){let{aptosConfig:n,processorType:t}=s,o=BigInt(s.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<o;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=o)break;await h(200)}}var f=class extends Error{constructor(t,o){super(t);this.lastSubmittedTransaction=o}},y=class extends Error{constructor(t,o){super(t);this.transaction=o}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
2
+ //# sourceMappingURL=chunk-CK272GUS.mjs.map
@@ -0,0 +1,2 @@
1
+ var o="1.14.0";export{o as a};
2
+ //# sourceMappingURL=chunk-CPBGL37X.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.14.0-zeta.2\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
1
+ {"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.14.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
@@ -0,0 +1,2 @@
1
+ import{a as M,c as en,d as an,e as N}from"./chunk-57VQMRBX.mjs";import{q as tn,t as f}from"./chunk-TICM455H.mjs";import{a as Y}from"./chunk-YUONW2LQ.mjs";import{a as Z}from"./chunk-52ECIIIH.mjs";import{a as y}from"./chunk-KDXECPCS.mjs";import{a as L}from"./chunk-NNIHTVLA.mjs";import{a as H,c as X,d as z}from"./chunk-7WJTKYRG.mjs";import{c as K,d as k,e as O,f as B,g as V,h as q,i as v}from"./chunk-RJ4PSGZ4.mjs";import{b as E,d as F,e as D,f as R}from"./chunk-3S3GIUQY.mjs";import{a as W,b as w,d as m}from"./chunk-HYDDIAJ6.mjs";import{a as _}from"./chunk-MWUJCP27.mjs";import{b as nn}from"./chunk-CK272GUS.mjs";import{a as Q}from"./chunk-AH44UPM4.mjs";import{a as J}from"./chunk-YQF2NZNF.mjs";import{a as x,b as l}from"./chunk-YV7OBLK2.mjs";import{a as S,c as U}from"./chunk-3CUVYW32.mjs";import{i as b}from"./chunk-PGCBIU33.mjs";import{a as P,c as g}from"./chunk-SI7MPP6G.mjs";import{b as u}from"./chunk-T23OVRNF.mjs";import{a as j}from"./chunk-UTXJOB3O.mjs";import{b as I}from"./chunk-AOCNYMMX.mjs";import{g as $}from"./chunk-JM544NRW.mjs";import{b as G,c as C}from"./chunk-YE5B2S5L.mjs";import{sha3_256 as dn}from"@noble/hashes/sha3";async function kn(t){if(tn(t))return yn(t);let{moduleAddress:n,moduleName:e,functionName:i}=f(t.function),a=await on({key:"entry-function",moduleAddress:n,moduleName:e,functionName:i,aptosConfig:t.aptosConfig,abi:t.abi,fetch:en});return An({...t,abi:a})}function An(t){let n=t.abi,{moduleAddress:e,moduleName:i,functionName:a}=f(t.function),r=M(t.typeArguments);if(r.length!==n.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${n.typeParameters.length}, received ${r.length}`);let o=t.functionArguments.map((s,d)=>N(t.function,n,s,d,r));if(o.length!==n.parameters.length)throw new Error(`Too few arguments for '${e}::${i}::${a}', expected ${n.parameters.length} but got ${o.length}`);let c=B.build(`${e}::${i}`,a,r,o);if("multisigAddress"in t){let s=u.from(t.multisigAddress);return new O(new q(s,new v(c)))}return new k(c)}async function On(t){let{moduleAddress:n,moduleName:e,functionName:i}=f(t.function),a=await on({key:"view-function",moduleAddress:n,moduleName:e,functionName:i,aptosConfig:t.aptosConfig,abi:t.abi,fetch:an});return mn({abi:a,...t})}function mn(t){let n=t.abi,{moduleAddress:e,moduleName:i,functionName:a}=f(t.function),r=M(t.typeArguments);if(r.length!==n.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${n.typeParameters.length}, received ${r.length}`);let o=t?.functionArguments?.map((c,s)=>N(t.function,n,c,s,r))??[];if(o.length!==n.parameters.length)throw new Error(`Too few arguments for '${e}::${i}::${a}', expected ${n.parameters.length} but got ${o.length}`);return B.build(`${e}::${i}`,a,r,o)}function yn(t){return new K(new V(I.fromHexInput(t.bytecode).toUint8Array(),t.typeArguments??[],t.functionArguments))}async function fn(t){let{aptosConfig:n,sender:e,payload:i,options:a,feePayerAddress:r}=t,o=async()=>$[n.network]?{chainId:$[n.network]}:{chainId:(await J({aptosConfig:n})).chain_id},c=async()=>a?.gasUnitPrice?{gasEstimate:a.gasUnitPrice}:{gasEstimate:(await nn({aptosConfig:n})).gas_estimate},s=async()=>{let p=async()=>a?.accountSequenceNumber!==void 0?a.accountSequenceNumber:(await Y({aptosConfig:n,accountAddress:e})).sequence_number;if(r&&u.from(r).equals(u.ZERO))try{return await p()}catch{return 0}else return p()},[{chainId:d},{gasEstimate:A},h]=await Promise.all([o(),c(),s()]),{maxGasAmount:sn,gasUnitPrice:cn,expireTimestamp:un}={maxGasAmount:a?.maxGasAmount?BigInt(a.maxGasAmount):BigInt(2e5),gasUnitPrice:a?.gasUnitPrice??BigInt(A),expireTimestamp:a?.expireTimestamp??BigInt(Math.floor(Date.now()/1e3)+20)};return new H(u.from(e),BigInt(h),i,BigInt(sn),BigInt(cn),BigInt(un),new _(d))}async function Vn(t){let{aptosConfig:n,sender:e,payload:i,options:a,feePayerAddress:r}=t,o=await fn({aptosConfig:n,sender:e,payload:i,options:a,feePayerAddress:r});if("secondarySignerAddresses"in t){let c=t.secondarySignerAddresses?.map(s=>u.from(s))??[];return new Z(o,c,t.feePayerAddress?u.from(t.feePayerAddress):void 0)}return new L(o,t.feePayerAddress?u.from(t.feePayerAddress):void 0)}function qn(t){let{signerPublicKey:n,transaction:e,secondarySignersPublicKeys:i,feePayerPublicKey:a}=t,r=T(n);if(e.feePayerAddress){let c=new z(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress),s=[];i&&(s=i.map(h=>T(h)));let d=T(a),A=new D(r,e.secondarySignerAddresses??[],s,{address:e.feePayerAddress,authenticator:d});return new y(c.raw_txn,A).bcsToBytes()}if(e.secondarySignerAddresses){let c=new X(e.rawTransaction,e.secondarySignerAddresses),s=[];s=i.map(A=>T(A));let d=new F(r,e.secondarySignerAddresses,s);return new y(c.raw_txn,d).bcsToBytes()}let o;if(r instanceof w)o=new E(r.public_key,r.signature);else if(r instanceof m)o=new R(r);else throw new Error("Invalid public key");return new y(e.rawTransaction,o).bcsToBytes()}function T(t){let n=t;if((n instanceof b||n instanceof S)&&(n=new x(n)),n instanceof x){if(n.publicKey instanceof P)return new m(n,new l(new g(new Uint8Array(64))));if(n.publicKey instanceof S)return new m(n,new l(new U(new Uint8Array(64))));if(n.publicKey instanceof b)return new m(n,new l(new g(new Uint8Array(64))))}return new w(new P(n.toUint8Array()),new g(new Uint8Array(64)))}function pn(t){let{transaction:n,feePayerAuthenticator:e,additionalSignersAuthenticators:i}=t,a=j(W,t.senderAuthenticator),r;if(n.feePayerAddress){if(!e)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");r=new D(a,n.secondarySignerAddresses??[],i??[],{address:n.feePayerAddress,authenticator:e})}else if(n.secondarySignerAddresses){if(!i)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");r=new F(a,n.secondarySignerAddresses,i)}else a instanceof w?r=new E(a.public_key,a.signature):r=new R(a);return new y(n.rawTransaction,r).bcsToBytes()}function rn(t){let n=dn.create();for(let e of t)n.update(e);return n.digest()}var gn=rn(["APTOS::Transaction"]);function vn(t){let n=pn(t);return new I(rn([gn,new Uint8Array([0]),n])).toString()}async function on({key:t,moduleAddress:n,moduleName:e,functionName:i,aptosConfig:a,abi:r,fetch:o}){return r!==void 0?r:Q(async()=>o(n,e,i,a),`${t}-${a.network}-${n}-${e}-${i}`,1e3*60*5)()}export{kn as a,An as b,On as c,mn as d,fn as e,Vn as f,qn as g,T as h,pn as i,rn as j,vn as k};
2
+ //# sourceMappingURL=chunk-DYUF5UID.mjs.map
@@ -0,0 +1 @@
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 Secp256k1PublicKey,\n Secp256k1Signature,\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(Hex.fromHexInput(args.bytecode).toUint8Array(), args.typeArguments ?? [], args.functionArguments),\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(pk: PublicKey) {\n let publicKey = pk;\n if (publicKey instanceof KeylessPublicKey || publicKey instanceof Secp256k1PublicKey) {\n publicKey = new AnyPublicKey(publicKey);\n }\n\n // TODO add support for AnyMultiKey\n if (publicKey instanceof AnyPublicKey) {\n if (publicKey.publicKey instanceof Ed25519PublicKey) {\n return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Ed25519Signature(new Uint8Array(64))));\n }\n if (publicKey.publicKey instanceof Secp256k1PublicKey) {\n return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Secp256k1Signature(new Uint8Array(64))));\n }\n if (publicKey.publicKey instanceof KeylessPublicKey) {\n return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Ed25519Signature(new Uint8Array(64))));\n }\n }\n\n // legacy code\n return new AccountAuthenticatorEd25519(\n new Ed25519PublicKey(publicKey.toUint8Array()),\n new Ed25519Signature(new Uint8Array(64)),\n );\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":"skCAQA,OAAS,YAAYA,OAAgB,qBA8FrC,eAAsBC,GACpBC,EACwC,CACxC,GAAIC,GAAkBD,CAAI,EACxB,OAAOE,GAAiCF,CAAI,EAE9C,GAAM,CAAE,cAAAG,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAiBN,EAAK,QAAQ,EAE5EO,EAAc,MAAMC,GAAS,CACjC,IAAK,iBACL,cAAAL,EACA,WAAAC,EACA,aAAAC,EACA,YAAaL,EAAK,YAClB,IAAKA,EAAK,IACV,MAAOS,EACT,CAAC,EAGD,OAAOC,GAAkC,CAAE,GAAGV,EAAM,IAAKO,CAAY,CAAC,CACxE,CAIO,SAASG,GACdV,EAC+B,CAC/B,IAAMO,EAAcP,EAAK,IACnB,CAAE,cAAAG,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAiBN,EAAK,QAAQ,EAG5EW,EAAgBC,EAAoBZ,EAAK,aAAa,EAG5D,GAAIW,EAAc,SAAWJ,EAAY,eAAe,OACtD,MAAM,IAAI,MACR,0CAA0CA,EAAY,e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AC7B,QAAWC,KAAQH,EACjBC,EAAK,OAAOE,CAAI,EAElB,OAAOF,EAAK,OAAO,CACrB,CAKA,IAAMG,GAAqBL,GAAW,CAAC,oBAAoB,CAAC,EAMrD,SAASM,GAA4BpG,EAA0C,CACpF,IAAMqG,EAAoBb,GAA0BxF,CAAI,EAKxD,OAAO,IAAI8B,EAAIgE,GAAW,CAACK,GAAoB,IAAI,WAAW,CAAC,CAAC,CAAC,EAAGE,CAAiB,CAAC,CAAC,EAAE,SAAS,CACpG,CAYA,eAAe7F,GAAgC,CAC7C,IAAA8F,EACA,cAAAnG,EACA,WAAAC,EACA,aAAAC,EACA,YAAA2B,EACA,IAAAuE,EACA,MAAAC,CACF,EAQe,CACb,OAAID,IAAQ,OACHA,EAIFE,EACL,SAAYD,EAAMrG,EAAeC,EAAYC,EAAc2B,CAAW,EACtE,GAAGsE,CAAG,IAAItE,EAAY,OAAO,IAAI7B,CAAa,IAAIC,CAAU,IAAIC,CAAY,GAC5E,IAAO,GAAK,CACd,EAAE,CACJ","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","pk","KeylessPublicKey","Secp256k1PublicKey","AnyPublicKey","Ed25519PublicKey","AnySignature","Ed25519Signature","Secp256k1Signature","generateSignedTransaction","additionalSignersAuthenticators","senderAuthenticator","normalizeBundle","AccountAuthenticator","txnAuthenticator","hashValues","input","hash","sha3Hash","item","TRANSACTION_PREFIX","generateUserTransactionHash","signedTransaction","key","abi","fetch","memoizeAsync"]}
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-6S4QCJMU.mjs";import{f as t,i as o}from"./chunk-3VGX3TXH.mjs";import{e as n}from"./chunk-YE5B2S5L.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
2
- //# sourceMappingURL=chunk-4IX52YGU.mjs.map
1
+ import{a as r}from"./chunk-LEMNHXB6.mjs";import{f as t,i as o}from"./chunk-3VGX3TXH.mjs";import{e as n}from"./chunk-YE5B2S5L.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
2
+ //# sourceMappingURL=chunk-EM2TYSMT.mjs.map
@@ -1,2 +1,2 @@
1
- import{f as n}from"./chunk-KEYTRAFA.mjs";import{p as g,u as d}from"./chunk-S4SEFF4K.mjs";import{b as s}from"./chunk-T23OVRNF.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
2
- //# sourceMappingURL=chunk-NAHTRLXC.mjs.map
1
+ import{f as n}from"./chunk-YQF2NZNF.mjs";import{p as g,u as d}from"./chunk-S4SEFF4K.mjs";import{b as s}from"./chunk-T23OVRNF.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
2
+ //# sourceMappingURL=chunk-EOVIHU3S.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-4X7IX2NK.mjs";import{a as n}from"./chunk-WW4IQL47.mjs";import{e as o}from"./chunk-YE5B2S5L.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
2
- //# sourceMappingURL=chunk-S7JBGEYI.mjs.map
1
+ import{a as n}from"./chunk-NX6YYFXD.mjs";import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-YUONW2LQ.mjs";import{e as o}from"./chunk-YE5B2S5L.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
2
+ //# sourceMappingURL=chunk-FUWIJEE6.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-6S4QCJMU.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
- //# sourceMappingURL=chunk-GMJ5FBKJ.mjs.map
1
+ import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-LEMNHXB6.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
+ //# sourceMappingURL=chunk-H7NNUC3D.mjs.map
@@ -1,2 +1,2 @@
1
- import{f as e,g as s,h as t,i as o,j as r,k as i,l as a,m,n as c,o as g,p as u,q as p,r as d}from"./chunk-DLVGWOTI.mjs";var A=class{constructor(n){this.config=n}async getOwnerAddress(n){return e({aptosConfig:this.config,...n})}async getExpiration(n){return t({aptosConfig:this.config,...n})}async getTargetAddress(n){return i({aptosConfig:this.config,...n})}async setTargetAddress(n){return a({aptosConfig:this.config,...n})}async getPrimaryName(n){return o({aptosConfig:this.config,...n})}async setPrimaryName(n){return r({aptosConfig:this.config,...n})}async registerName(n){return s({aptosConfig:this.config,...n})}async renewDomain(n){return d({aptosConfig:this.config,...n})}async getName(n){return m({aptosConfig:this.config,...n})}async getAccountNames(n){return c({aptosConfig:this.config,...n})}async getAccountDomains(n){return g({aptosConfig:this.config,...n})}async getAccountSubdomains(n){return u({aptosConfig:this.config,...n})}async getDomainSubdomains(n){return p({aptosConfig:this.config,...n})}};export{A as a};
2
- //# sourceMappingURL=chunk-DZRH4BNK.mjs.map
1
+ import{f as e,g as s,h as t,i as o,j as r,k as i,l as a,m,n as c,o as g,p as u,q as p,r as d}from"./chunk-OWIDLQOG.mjs";var A=class{constructor(n){this.config=n}async getOwnerAddress(n){return e({aptosConfig:this.config,...n})}async getExpiration(n){return t({aptosConfig:this.config,...n})}async getTargetAddress(n){return i({aptosConfig:this.config,...n})}async setTargetAddress(n){return a({aptosConfig:this.config,...n})}async getPrimaryName(n){return o({aptosConfig:this.config,...n})}async setPrimaryName(n){return r({aptosConfig:this.config,...n})}async registerName(n){return s({aptosConfig:this.config,...n})}async renewDomain(n){return d({aptosConfig:this.config,...n})}async getName(n){return m({aptosConfig:this.config,...n})}async getAccountNames(n){return c({aptosConfig:this.config,...n})}async getAccountDomains(n){return g({aptosConfig:this.config,...n})}async getAccountSubdomains(n){return u({aptosConfig:this.config,...n})}async getDomainSubdomains(n){return p({aptosConfig:this.config,...n})}};export{A as a};
2
+ //# sourceMappingURL=chunk-HLN6GUIY.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-FQVVTJ4Y.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super();this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
2
- //# sourceMappingURL=chunk-VHL524RK.mjs.map
1
+ import{c as a}from"./chunk-XTO3FQND.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super();this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
2
+ //# sourceMappingURL=chunk-HXQADNOJ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-Z2ZR4PTF.mjs";import{a as e}from"./chunk-3S3GIUQY.mjs";import{a as r}from"./chunk-TVRJ3M7B.mjs";var n=class o extends r{constructor(t,a){super();this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=i.deserialize(t),s=e.deserialize(t);return new o(a,s)}};export{n as a};
2
- //# sourceMappingURL=chunk-RFCXZ4TC.mjs.map
1
+ import{a as i}from"./chunk-7WJTKYRG.mjs";import{a as e}from"./chunk-3S3GIUQY.mjs";import{a as r}from"./chunk-TVRJ3M7B.mjs";var n=class o extends r{constructor(t,a){super();this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=i.deserialize(t),s=e.deserialize(t);return new o(a,s)}};export{n as a};
2
+ //# sourceMappingURL=chunk-KDXECPCS.mjs.map