@aptos-labs/ts-sdk 5.0.0 → 5.1.0

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 (304) hide show
  1. package/dist/common/{account-BDwBREvt.d.ts → account-BW99GTa5.d.ts} +7 -2
  2. package/dist/common/chunk-A2XB7TVI.js +4 -0
  3. package/dist/common/{chunk-6MMUUJHX.js.map → chunk-A2XB7TVI.js.map} +1 -1
  4. package/dist/common/cli/index.d.ts +1 -1
  5. package/dist/common/cli/index.js +1 -1
  6. package/dist/common/index.d.ts +328 -10
  7. package/dist/common/index.js +34 -34
  8. package/dist/common/index.js.map +1 -1
  9. package/dist/esm/{Ed25519Account-8ETkcAk_.d.mts → Ed25519Account-CPwej6wB.d.mts} +1 -1
  10. package/dist/esm/account/AbstractKeylessAccount.d.mts +3 -3
  11. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  12. package/dist/esm/account/AbstractedAccount.d.mts +2 -2
  13. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  14. package/dist/esm/account/Account.d.mts +2 -2
  15. package/dist/esm/account/Account.mjs +1 -1
  16. package/dist/esm/account/AccountUtils.d.mts +3 -3
  17. package/dist/esm/account/AccountUtils.mjs +1 -1
  18. package/dist/esm/account/DerivableAbstractedAccount.d.mts +2 -2
  19. package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
  20. package/dist/esm/account/Ed25519Account.d.mts +2 -2
  21. package/dist/esm/account/Ed25519Account.mjs +1 -1
  22. package/dist/esm/account/EphemeralKeyPair.d.mts +1 -1
  23. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  24. package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
  25. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  26. package/dist/esm/account/KeylessAccount.d.mts +3 -3
  27. package/dist/esm/account/KeylessAccount.mjs +1 -1
  28. package/dist/esm/account/MultiEd25519Account.d.mts +2 -2
  29. package/dist/esm/account/MultiEd25519Account.mjs +1 -1
  30. package/dist/esm/account/MultiKeyAccount.d.mts +3 -3
  31. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  32. package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
  33. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  34. package/dist/esm/account/index.d.mts +3 -3
  35. package/dist/esm/account/index.mjs +1 -1
  36. package/dist/esm/account/utils.d.mts +1 -1
  37. package/dist/esm/account/utils.mjs +1 -1
  38. package/dist/esm/{account-ClxOwjdh.d.mts → account-BortO8g2.d.mts} +6 -1
  39. package/dist/esm/api/account/abstraction.d.mts +1 -1
  40. package/dist/esm/api/account/abstraction.mjs +1 -1
  41. package/dist/esm/api/account.d.mts +30 -9
  42. package/dist/esm/api/account.mjs +1 -1
  43. package/dist/esm/api/ans.d.mts +2 -2
  44. package/dist/esm/api/ans.mjs +1 -1
  45. package/dist/esm/api/aptos.d.mts +3 -3
  46. package/dist/esm/api/aptos.mjs +1 -1
  47. package/dist/esm/api/aptosConfig.d.mts +1 -1
  48. package/dist/esm/api/coin.d.mts +1 -1
  49. package/dist/esm/api/coin.mjs +1 -1
  50. package/dist/esm/api/digitalAsset.d.mts +2 -2
  51. package/dist/esm/api/digitalAsset.mjs +1 -1
  52. package/dist/esm/api/faucet.d.mts +1 -1
  53. package/dist/esm/api/faucet.mjs +1 -1
  54. package/dist/esm/api/fungibleAsset.d.mts +2 -2
  55. package/dist/esm/api/fungibleAsset.mjs +1 -1
  56. package/dist/esm/api/general.d.mts +1 -1
  57. package/dist/esm/api/general.mjs +1 -1
  58. package/dist/esm/api/index.d.mts +3 -3
  59. package/dist/esm/api/index.mjs +1 -1
  60. package/dist/esm/api/keyless.d.mts +3 -3
  61. package/dist/esm/api/keyless.mjs +1 -1
  62. package/dist/esm/api/object.d.mts +1 -1
  63. package/dist/esm/api/object.mjs +1 -1
  64. package/dist/esm/api/staking.d.mts +1 -1
  65. package/dist/esm/api/staking.mjs +1 -1
  66. package/dist/esm/api/table.d.mts +1 -1
  67. package/dist/esm/api/table.mjs +1 -1
  68. package/dist/esm/api/transaction.d.mts +2 -2
  69. package/dist/esm/api/transaction.mjs +1 -1
  70. package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
  71. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  72. package/dist/esm/api/transactionSubmission/helpers.d.mts +1 -1
  73. package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
  74. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  75. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  76. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  77. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  78. package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
  79. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  80. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  81. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  82. package/dist/esm/api/utils.d.mts +1 -1
  83. package/dist/esm/api/utils.mjs +1 -1
  84. package/dist/esm/bcs/consts.d.mts +1 -1
  85. package/dist/esm/bcs/deserializer.d.mts +1 -1
  86. package/dist/esm/bcs/index.d.mts +1 -1
  87. package/dist/esm/bcs/index.mjs +1 -1
  88. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
  89. package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
  90. package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
  91. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  92. package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
  93. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  94. package/dist/esm/bcs/serializer.d.mts +1 -1
  95. package/dist/esm/chunk-2PASUPUO.mjs +2 -0
  96. package/dist/esm/chunk-2PASUPUO.mjs.map +1 -0
  97. package/dist/esm/{chunk-V74WPKSY.mjs → chunk-2XQKGWHQ.mjs} +2 -2
  98. package/dist/esm/{chunk-GFFKEZ56.mjs → chunk-4AI7KQQ7.mjs} +2 -2
  99. package/dist/esm/{chunk-TGRLDWXV.mjs → chunk-6OWBKU7N.mjs} +2 -2
  100. package/dist/esm/{chunk-DNRUDMMV.mjs → chunk-7EER7GWV.mjs} +2 -2
  101. package/dist/esm/{chunk-N3O3ULF7.mjs → chunk-AMXZQPUQ.mjs} +2 -2
  102. package/dist/esm/chunk-CIJA7ONS.mjs +2 -0
  103. package/dist/esm/{chunk-5FI4545P.mjs.map → chunk-CIJA7ONS.mjs.map} +1 -1
  104. package/dist/esm/{chunk-RQX6JOEN.mjs → chunk-EF4FA5I6.mjs} +2 -2
  105. package/dist/esm/chunk-I7XT6L7S.mjs +2 -0
  106. package/dist/esm/chunk-I7XT6L7S.mjs.map +1 -0
  107. package/dist/esm/{chunk-HNBKTJPN.mjs → chunk-JABP65XD.mjs} +2 -2
  108. package/dist/esm/chunk-L72TIN7T.mjs +4 -0
  109. package/dist/esm/chunk-L72TIN7T.mjs.map +1 -0
  110. package/dist/esm/{chunk-EM52Z7T7.mjs → chunk-M3AO73ZL.mjs} +2 -2
  111. package/dist/esm/chunk-MCFQE4GC.mjs +2 -0
  112. package/dist/esm/chunk-MCFQE4GC.mjs.map +1 -0
  113. package/dist/esm/{chunk-LWL57YFU.mjs → chunk-QP2BY4PK.mjs} +2 -2
  114. package/dist/esm/{chunk-GMQCQDW4.mjs → chunk-SJDCGNWU.mjs} +2 -2
  115. package/dist/esm/{chunk-ES2KP6BS.mjs → chunk-WHSTLR3F.mjs} +2 -2
  116. package/dist/esm/cli/index.d.mts +1 -1
  117. package/dist/esm/cli/index.mjs +1 -1
  118. package/dist/esm/cli/localNode.mjs +1 -1
  119. package/dist/esm/cli/move.d.mts +1 -1
  120. package/dist/esm/client/core.d.mts +1 -1
  121. package/dist/esm/client/core.mjs +1 -1
  122. package/dist/esm/client/get.d.mts +1 -1
  123. package/dist/esm/client/get.mjs +1 -1
  124. package/dist/esm/client/index.d.mts +1 -1
  125. package/dist/esm/client/index.mjs +1 -1
  126. package/dist/esm/client/post.d.mts +1 -1
  127. package/dist/esm/client/post.mjs +1 -1
  128. package/dist/esm/core/account/index.d.mts +1 -1
  129. package/dist/esm/core/account/index.mjs +1 -1
  130. package/dist/esm/core/account/utils/address.d.mts +1 -1
  131. package/dist/esm/core/account/utils/address.mjs +1 -1
  132. package/dist/esm/core/account/utils/index.d.mts +1 -1
  133. package/dist/esm/core/account/utils/index.mjs +1 -1
  134. package/dist/esm/core/accountAddress.d.mts +1 -1
  135. package/dist/esm/core/accountAddress.mjs +1 -1
  136. package/dist/esm/core/authenticationKey.d.mts +1 -1
  137. package/dist/esm/core/authenticationKey.mjs +1 -1
  138. package/dist/esm/core/crypto/abstraction.d.mts +1 -1
  139. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  140. package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
  141. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  142. package/dist/esm/core/crypto/ed25519.d.mts +1 -1
  143. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  144. package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
  145. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  146. package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
  147. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  148. package/dist/esm/core/crypto/index.d.mts +3 -2
  149. package/dist/esm/core/crypto/index.mjs +1 -1
  150. package/dist/esm/core/crypto/keyless.d.mts +2 -2
  151. package/dist/esm/core/crypto/keyless.mjs +1 -1
  152. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  153. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  154. package/dist/esm/core/crypto/multiKey.d.mts +1 -1
  155. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  156. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  157. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  158. package/dist/esm/core/crypto/proof.d.mts +1 -1
  159. package/dist/esm/core/crypto/proof.mjs +1 -1
  160. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  161. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  162. package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
  163. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  164. package/dist/esm/core/crypto/secp256r1.d.mts +306 -0
  165. package/dist/esm/core/crypto/secp256r1.mjs +2 -0
  166. package/dist/esm/core/crypto/secp256r1.mjs.map +1 -0
  167. package/dist/esm/core/crypto/signature.d.mts +1 -1
  168. package/dist/esm/core/crypto/signature.mjs +1 -1
  169. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  170. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  171. package/dist/esm/core/crypto/types.d.mts +1 -1
  172. package/dist/esm/core/crypto/utils.d.mts +1 -1
  173. package/dist/esm/core/crypto/utils.mjs +1 -1
  174. package/dist/esm/core/hex.d.mts +1 -1
  175. package/dist/esm/core/index.d.mts +3 -2
  176. package/dist/esm/core/index.mjs +1 -1
  177. package/dist/esm/errors/index.d.mts +1 -1
  178. package/dist/esm/errors/index.mjs +1 -1
  179. package/dist/esm/{federatedKeyless-CUPEnP-W.d.mts → federatedKeyless-CTzDAQTu.d.mts} +1 -1
  180. package/dist/esm/index.d.mts +4 -3
  181. package/dist/esm/index.mjs +1 -1
  182. package/dist/esm/internal/abstraction.d.mts +1 -1
  183. package/dist/esm/internal/abstraction.mjs +1 -1
  184. package/dist/esm/internal/account.d.mts +21 -3
  185. package/dist/esm/internal/account.mjs +1 -1
  186. package/dist/esm/internal/ans.d.mts +2 -2
  187. package/dist/esm/internal/ans.mjs +1 -1
  188. package/dist/esm/internal/coin.d.mts +1 -1
  189. package/dist/esm/internal/coin.mjs +1 -1
  190. package/dist/esm/internal/digitalAsset.d.mts +2 -2
  191. package/dist/esm/internal/digitalAsset.mjs +1 -1
  192. package/dist/esm/internal/faucet.d.mts +1 -1
  193. package/dist/esm/internal/faucet.mjs +1 -1
  194. package/dist/esm/internal/fungibleAsset.d.mts +2 -2
  195. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  196. package/dist/esm/internal/general.d.mts +1 -1
  197. package/dist/esm/internal/general.mjs +1 -1
  198. package/dist/esm/internal/keyless.d.mts +3 -3
  199. package/dist/esm/internal/keyless.mjs +1 -1
  200. package/dist/esm/internal/object.d.mts +1 -1
  201. package/dist/esm/internal/object.mjs +1 -1
  202. package/dist/esm/internal/staking.d.mts +1 -1
  203. package/dist/esm/internal/staking.mjs +1 -1
  204. package/dist/esm/internal/table.d.mts +1 -1
  205. package/dist/esm/internal/table.mjs +1 -1
  206. package/dist/esm/internal/transaction.d.mts +1 -1
  207. package/dist/esm/internal/transaction.mjs +1 -1
  208. package/dist/esm/internal/transactionSubmission.d.mts +2 -2
  209. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  210. package/dist/esm/internal/utils/index.d.mts +1 -1
  211. package/dist/esm/internal/utils/index.mjs +1 -1
  212. package/dist/esm/internal/utils/utils.d.mts +1 -1
  213. package/dist/esm/internal/utils/utils.mjs +1 -1
  214. package/dist/esm/internal/view.d.mts +1 -1
  215. package/dist/esm/internal/view.mjs +1 -1
  216. package/dist/esm/transactions/authenticator/account.d.mts +1 -1
  217. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  218. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  219. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  220. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  221. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  222. package/dist/esm/transactions/index.d.mts +1 -1
  223. package/dist/esm/transactions/index.mjs +1 -1
  224. package/dist/esm/transactions/instances/chainId.d.mts +1 -1
  225. package/dist/esm/transactions/instances/identifier.d.mts +1 -1
  226. package/dist/esm/transactions/instances/index.d.mts +1 -1
  227. package/dist/esm/transactions/instances/index.mjs +1 -1
  228. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  229. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  230. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
  231. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  232. package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
  233. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  234. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  235. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  236. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  237. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  238. package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
  239. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  240. package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
  241. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  242. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  243. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
  244. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  245. package/dist/esm/transactions/management/index.d.mts +2 -2
  246. package/dist/esm/transactions/management/index.mjs +1 -1
  247. package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
  248. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  249. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
  250. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  251. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
  252. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  253. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -1
  254. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  255. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
  256. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  257. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
  258. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  259. package/dist/esm/transactions/typeTag/index.d.mts +1 -1
  260. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  261. package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
  262. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  263. package/dist/esm/transactions/types.d.mts +1 -1
  264. package/dist/esm/types/index.d.mts +1 -1
  265. package/dist/esm/types/index.mjs +1 -1
  266. package/dist/esm/types/types.d.mts +1 -1
  267. package/dist/esm/types/types.mjs +1 -1
  268. package/dist/esm/utils/helpers.d.mts +1 -1
  269. package/dist/esm/utils/helpers.mjs +1 -1
  270. package/dist/esm/utils/index.d.mts +1 -1
  271. package/dist/esm/utils/index.mjs +1 -1
  272. package/dist/esm/utils/normalizeBundle.d.mts +1 -1
  273. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  274. package/dist/esm/version.d.mts +1 -1
  275. package/dist/esm/version.mjs +1 -1
  276. package/package.json +2 -3
  277. package/src/api/account.ts +32 -7
  278. package/src/core/crypto/index.ts +1 -0
  279. package/src/core/crypto/privateKey.ts +1 -0
  280. package/src/core/crypto/secp256k1.ts +9 -1
  281. package/src/core/crypto/secp256r1.ts +495 -0
  282. package/src/core/crypto/singleKey.ts +11 -0
  283. package/src/internal/account.ts +33 -0
  284. package/src/types/types.ts +5 -0
  285. package/src/version.ts +1 -1
  286. package/dist/common/chunk-6MMUUJHX.js +0 -4
  287. package/dist/esm/chunk-5FI4545P.mjs +0 -2
  288. package/dist/esm/chunk-DIGP2ALY.mjs +0 -4
  289. package/dist/esm/chunk-DIGP2ALY.mjs.map +0 -1
  290. package/dist/esm/chunk-IJE2LVZG.mjs +0 -2
  291. package/dist/esm/chunk-IJE2LVZG.mjs.map +0 -1
  292. package/dist/esm/chunk-ROT6S6BM.mjs +0 -2
  293. package/dist/esm/chunk-ROT6S6BM.mjs.map +0 -1
  294. /package/dist/esm/{chunk-V74WPKSY.mjs.map → chunk-2XQKGWHQ.mjs.map} +0 -0
  295. /package/dist/esm/{chunk-GFFKEZ56.mjs.map → chunk-4AI7KQQ7.mjs.map} +0 -0
  296. /package/dist/esm/{chunk-TGRLDWXV.mjs.map → chunk-6OWBKU7N.mjs.map} +0 -0
  297. /package/dist/esm/{chunk-DNRUDMMV.mjs.map → chunk-7EER7GWV.mjs.map} +0 -0
  298. /package/dist/esm/{chunk-N3O3ULF7.mjs.map → chunk-AMXZQPUQ.mjs.map} +0 -0
  299. /package/dist/esm/{chunk-RQX6JOEN.mjs.map → chunk-EF4FA5I6.mjs.map} +0 -0
  300. /package/dist/esm/{chunk-HNBKTJPN.mjs.map → chunk-JABP65XD.mjs.map} +0 -0
  301. /package/dist/esm/{chunk-EM52Z7T7.mjs.map → chunk-M3AO73ZL.mjs.map} +0 -0
  302. /package/dist/esm/{chunk-LWL57YFU.mjs.map → chunk-QP2BY4PK.mjs.map} +0 -0
  303. /package/dist/esm/{chunk-GMQCQDW4.mjs.map → chunk-SJDCGNWU.mjs.map} +0 -0
  304. /package/dist/esm/{chunk-ES2KP6BS.mjs.map → chunk-WHSTLR3F.mjs.map} +0 -0
@@ -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 *\n * @param config - The configuration object for Aptos.\n * @group Implementation\n */\nexport class Sign {\n readonly config: AptosConfig;\n\n /**\n * Creates an instance of the Aptos client with the specified configuration.\n *\n * @param config - The configuration settings for the Aptos client.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a new Aptos client with testnet configuration\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client created with config:\", config);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Signs a transaction using the provided account signer. This function is essential for ensuring that transactions are properly\n * authenticated before being sent to the network.\n *\n * @param args - The arguments for signing the transaction.\n * @param args.signer - The account that will sign the transaction.\n * @param args.transaction - The raw transaction data to be signed.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const sender = Account.generate(); // Generate a new account for signing\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [ \"0x1\", 100 ], // replace with a real account address and amount\n * },\n * });\n *\n * // Sign the transaction\n * const signedTransaction = await aptos.transaction.sign({\n * signer: sender,\n * transaction: transaction,\n * });\n *\n * console.log(\"Signed Transaction:\", signedTransaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\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 /**\n * Sets the fee payer address for a transaction and signs it with the provided account.\n * This function is essential for transactions that require a designated fee payer.\n *\n * @param args - The arguments for the function.\n * @param args.signer - The account that will sign the transaction.\n * @param args.transaction - The transaction object that requires a fee payer address.\n *\n * @throws Error if the transaction does not have a feePayerAddress property.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const sender = Account.generate(); // Generate a new account for signing\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x1\", 100], // replace with a real recipient address\n * },\n * });\n *\n * // Set the fee payer for the transaction\n * transaction.feePayerAddress = \"0x1\"; // replace with a real fee payer address\n *\n * const signedTransaction = await aptos.transactionAsFeePayer({ signer: sender, transaction });\n *\n * console.log(\"Signed Transaction:\", signedTransaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\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 doesn't 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":"s2DAcO,IAAMA,EAAN,KAAW,CAuBhB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAwCA,YAAYC,EAAiF,CAC3F,OAAOC,EAAgB,CACrB,GAAGD,CACL,CAAC,CACH,CAyCA,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 *\n * @param config - The configuration object for Aptos.\n * @group Implementation\n */\nexport class Sign {\n readonly config: AptosConfig;\n\n /**\n * Creates an instance of the Aptos client with the specified configuration.\n *\n * @param config - The configuration settings for the Aptos client.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a new Aptos client with testnet configuration\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client created with config:\", config);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Signs a transaction using the provided account signer. This function is essential for ensuring that transactions are properly\n * authenticated before being sent to the network.\n *\n * @param args - The arguments for signing the transaction.\n * @param args.signer - The account that will sign the transaction.\n * @param args.transaction - The raw transaction data to be signed.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const sender = Account.generate(); // Generate a new account for signing\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [ \"0x1\", 100 ], // replace with a real account address and amount\n * },\n * });\n *\n * // Sign the transaction\n * const signedTransaction = await aptos.transaction.sign({\n * signer: sender,\n * transaction: transaction,\n * });\n *\n * console.log(\"Signed Transaction:\", signedTransaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\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 /**\n * Sets the fee payer address for a transaction and signs it with the provided account.\n * This function is essential for transactions that require a designated fee payer.\n *\n * @param args - The arguments for the function.\n * @param args.signer - The account that will sign the transaction.\n * @param args.transaction - The transaction object that requires a fee payer address.\n *\n * @throws Error if the transaction does not have a feePayerAddress property.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const sender = Account.generate(); // Generate a new account for signing\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x1\", 100], // replace with a real recipient address\n * },\n * });\n *\n * // Set the fee payer for the transaction\n * transaction.feePayerAddress = \"0x1\"; // replace with a real fee payer address\n *\n * const signedTransaction = await aptos.transactionAsFeePayer({ signer: sender, transaction });\n *\n * console.log(\"Signed Transaction:\", signedTransaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\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 doesn't 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":"u4DAcO,IAAMA,EAAN,KAAW,CAuBhB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAwCA,YAAYC,EAAiF,CAC3F,OAAOC,EAAgB,CACrB,GAAGD,CACL,CAAC,CACH,CAyCA,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,4 +1,4 @@
1
- import { A as AptosConfig, C as PublicKey, bg as AnyRawTransaction, bi as InputSimulateTransactionOptions, cm as UserTransactionResponse } from '../../account-ClxOwjdh.mjs';
1
+ import { A as AptosConfig, C as PublicKey, bg as AnyRawTransaction, bi as InputSimulateTransactionOptions, cm as UserTransactionResponse } from '../../account-BortO8g2.mjs';
2
2
  import '../../types/indexer.mjs';
3
3
  import '../../types/generated/operations.mjs';
4
4
  import '../../types/generated/types.mjs';
@@ -1,2 +1,2 @@
1
- import{ce as a}from"../../chunk-DIGP2ALY.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-ROT6S6BM.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-HNBKTJPN.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ES2KP6BS.mjs";import"../../chunk-EM52Z7T7.mjs";import"../../chunk-TGRLDWXV.mjs";import"../../chunk-N3O3ULF7.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-GMQCQDW4.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-DNRUDMMV.mjs";import"../../chunk-GFFKEZ56.mjs";import"../../chunk-LWL57YFU.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-6WDVDEQZ.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-7DQDJ2SA.mjs";import"../../chunk-HNBVYE3N.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-IJE2LVZG.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-RCSJFTST.mjs";import"../../chunk-4RXKALLC.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-5FI4545P.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as Simulate};
1
+ import{de as a}from"../../chunk-L72TIN7T.mjs";import"../../chunk-2XQKGWHQ.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-I7XT6L7S.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-JABP65XD.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-EF4FA5I6.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-WHSTLR3F.mjs";import"../../chunk-M3AO73ZL.mjs";import"../../chunk-6OWBKU7N.mjs";import"../../chunk-AMXZQPUQ.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-SJDCGNWU.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-4AI7KQQ7.mjs";import"../../chunk-7EER7GWV.mjs";import"../../chunk-QP2BY4PK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-6WDVDEQZ.mjs";import"../../chunk-RCSJFTST.mjs";import"../../chunk-4RXKALLC.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-7DQDJ2SA.mjs";import"../../chunk-HNBVYE3N.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-CIJA7ONS.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as Simulate};
2
2
  //# sourceMappingURL=simulate.mjs.map
@@ -1,4 +1,4 @@
1
- import { A as AptosConfig, bg as AnyRawTransaction, W as AccountAuthenticator, bm as InputTransactionPluginData, cl as PendingTransactionResponse } from '../../account-ClxOwjdh.mjs';
1
+ import { A as AptosConfig, bg as AnyRawTransaction, W as AccountAuthenticator, bm as InputTransactionPluginData, cl as PendingTransactionResponse } from '../../account-BortO8g2.mjs';
2
2
  import '../../types/indexer.mjs';
3
3
  import '../../types/generated/operations.mjs';
4
4
  import '../../types/generated/types.mjs';
@@ -1,2 +1,2 @@
1
- import{de as a}from"../../chunk-DIGP2ALY.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-ROT6S6BM.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-HNBKTJPN.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ES2KP6BS.mjs";import"../../chunk-EM52Z7T7.mjs";import"../../chunk-TGRLDWXV.mjs";import"../../chunk-N3O3ULF7.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-GMQCQDW4.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-DNRUDMMV.mjs";import"../../chunk-GFFKEZ56.mjs";import"../../chunk-LWL57YFU.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-6WDVDEQZ.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-7DQDJ2SA.mjs";import"../../chunk-HNBVYE3N.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-IJE2LVZG.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-RCSJFTST.mjs";import"../../chunk-4RXKALLC.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-5FI4545P.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as Submit};
1
+ import{ee as a}from"../../chunk-L72TIN7T.mjs";import"../../chunk-2XQKGWHQ.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-I7XT6L7S.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-JABP65XD.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-EF4FA5I6.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-WHSTLR3F.mjs";import"../../chunk-M3AO73ZL.mjs";import"../../chunk-6OWBKU7N.mjs";import"../../chunk-AMXZQPUQ.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-SJDCGNWU.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-4AI7KQQ7.mjs";import"../../chunk-7EER7GWV.mjs";import"../../chunk-QP2BY4PK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-6WDVDEQZ.mjs";import"../../chunk-RCSJFTST.mjs";import"../../chunk-4RXKALLC.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-7DQDJ2SA.mjs";import"../../chunk-HNBVYE3N.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-CIJA7ONS.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as Submit};
2
2
  //# sourceMappingURL=submit.mjs.map
@@ -1,5 +1,5 @@
1
1
  import { ProcessorType } from '../utils/const.mjs';
2
- import { A as AptosConfig, bN as AnyNumber } from '../account-ClxOwjdh.mjs';
2
+ import { A as AptosConfig, bN as AnyNumber } from '../account-BortO8g2.mjs';
3
3
  import '../types/indexer.mjs';
4
4
  import '../types/generated/operations.mjs';
5
5
  import '../types/generated/types.mjs';
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-TGRLDWXV.mjs";import"../chunk-N3O3ULF7.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-GMQCQDW4.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-DNRUDMMV.mjs";import"../chunk-GFFKEZ56.mjs";import"../chunk-LWL57YFU.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-5FI4545P.mjs";import"../chunk-KDMSOCZY.mjs";export{a as waitForIndexerOnVersion};
1
+ import{a}from"../chunk-6OWBKU7N.mjs";import"../chunk-AMXZQPUQ.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-SJDCGNWU.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-4AI7KQQ7.mjs";import"../chunk-7EER7GWV.mjs";import"../chunk-QP2BY4PK.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-CIJA7ONS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as waitForIndexerOnVersion};
2
2
  //# sourceMappingURL=utils.mjs.map
@@ -1,4 +1,4 @@
1
- import { bH as Uint8, bI as Uint16, bJ as Uint32, bK as Uint64, bL as Uint128, bM as Uint256 } from '../account-ClxOwjdh.mjs';
1
+ import { bH as Uint8, bI as Uint16, bJ as Uint32, bK as Uint64, bL as Uint128, bM as Uint256 } from '../account-BortO8g2.mjs';
2
2
  import '../types/indexer.mjs';
3
3
  import '../types/generated/operations.mjs';
4
4
  import '../types/generated/types.mjs';
@@ -1,4 +1,4 @@
1
- export { D as Deserializable, a as Deserializer } from '../account-ClxOwjdh.mjs';
1
+ export { D as Deserializable, a as Deserializer } from '../account-BortO8g2.mjs';
2
2
  import '../types/indexer.mjs';
3
3
  import '../types/generated/operations.mjs';
4
4
  import '../types/generated/types.mjs';
@@ -1,4 +1,4 @@
1
- export { B as Bool, D as Deserializable, a as Deserializer, F as FixedBytes, k as MoveOption, j as MoveString, M as MoveVector, S as Serializable, i as Serialized, b as Serializer, g as U128, c as U16, h as U256, d as U32, f as U64, U as U8, e as ensureBoolean, o as outOfRangeErrorMessage, v as validateNumberInRange } from '../account-ClxOwjdh.mjs';
1
+ export { B as Bool, D as Deserializable, a as Deserializer, F as FixedBytes, k as MoveOption, j as MoveString, M as MoveVector, S as Serializable, i as Serialized, b as Serializer, g as U128, c as U16, h as U256, d as U32, f as U64, U as U8, e as ensureBoolean, o as outOfRangeErrorMessage, v as validateNumberInRange } from '../account-BortO8g2.mjs';
2
2
  export { EntryFunctionBytes } from './serializable/entryFunctionBytes.mjs';
3
3
  import '../types/indexer.mjs';
4
4
  import '../types/generated/operations.mjs';
@@ -1,2 +1,2 @@
1
- import"../chunk-FZY4PMEE.mjs";import{a as h}from"../chunk-TOBQ5UE6.mjs";import{a as g}from"../chunk-MT2RJ7H3.mjs";import{a as p,b as q,c as r,d as s}from"../chunk-Q4W3WJ2U.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-ORMOQWWH.mjs";import{a}from"../chunk-FLZPUYXQ.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import{a as b,b as c,c as d,d as e,e as f}from"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-KDMSOCZY.mjs";export{i as Bool,a as Deserializer,h as EntryFunctionBytes,g as FixedBytes,s as MoveOption,r as MoveString,p as MoveVector,b as Serializable,q as Serialized,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,d as s}from"../chunk-Q4W3WJ2U.mjs";import{a as h}from"../chunk-TOBQ5UE6.mjs";import{a as g}from"../chunk-MT2RJ7H3.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-ORMOQWWH.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import{a}from"../chunk-FLZPUYXQ.mjs";import{a as b,b as c,c as d,d as e,e as f}from"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-KDMSOCZY.mjs";export{i as Bool,a as Deserializer,h as EntryFunctionBytes,g as FixedBytes,s as MoveOption,r as MoveString,p as MoveVector,b as Serializable,q as Serialized,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,4 +1,4 @@
1
- import { S as Serializable, aa as EntryFunctionArgument, F as FixedBytes, b as Serializer, a as Deserializer } from '../../account-ClxOwjdh.mjs';
1
+ import { S as Serializable, aa as EntryFunctionArgument, F as FixedBytes, b as Serializer, a as Deserializer } from '../../account-BortO8g2.mjs';
2
2
  import '../../types/indexer.mjs';
3
3
  import '../../types/generated/operations.mjs';
4
4
  import '../../types/generated/types.mjs';
@@ -1,4 +1,4 @@
1
- export { F as FixedBytes } from '../../account-ClxOwjdh.mjs';
1
+ export { F as FixedBytes } from '../../account-BortO8g2.mjs';
2
2
  import '../../types/indexer.mjs';
3
3
  import '../../types/generated/operations.mjs';
4
4
  import '../../types/generated/types.mjs';
@@ -1,4 +1,4 @@
1
- export { B as Bool, g as U128, c as U16, h as U256, d as U32, f as U64, U as U8 } from '../../account-ClxOwjdh.mjs';
1
+ export { B as Bool, g as U128, c as U16, h as U256, d as U32, f as U64, U as U8 } from '../../account-BortO8g2.mjs';
2
2
  import '../../types/indexer.mjs';
3
3
  import '../../types/generated/operations.mjs';
4
4
  import '../../types/generated/types.mjs';
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g}from"../../chunk-ORMOQWWH.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-IJE2LVZG.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as Bool,f as U128,c as U16,g as U256,d as U32,e as U64,b as U8};
1
+ import{a,b,c,d,e,f,g}from"../../chunk-ORMOQWWH.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as Bool,f as U128,c as U16,g as U256,d as U32,e as U64,b as U8};
2
2
  //# sourceMappingURL=movePrimitives.mjs.map
@@ -1,4 +1,4 @@
1
- export { k as MoveOption, j as MoveString, M as MoveVector, i as Serialized } from '../../account-ClxOwjdh.mjs';
1
+ export { k as MoveOption, j as MoveString, M as MoveVector, i as Serialized } from '../../account-BortO8g2.mjs';
2
2
  import '../../types/indexer.mjs';
3
3
  import '../../types/generated/operations.mjs';
4
4
  import '../../types/generated/types.mjs';
@@ -1,2 +1,2 @@
1
- import{a,b,c,d}from"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-IJE2LVZG.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-KDMSOCZY.mjs";export{d as MoveOption,c as MoveString,a as MoveVector,b as Serialized};
1
+ import{a,b,c,d}from"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-KDMSOCZY.mjs";export{d as MoveOption,c as MoveString,a as MoveVector,b as Serialized};
2
2
  //# sourceMappingURL=moveStructs.mjs.map
@@ -1,4 +1,4 @@
1
- export { S as Serializable, b as Serializer, e as ensureBoolean, o as outOfRangeErrorMessage, v as validateNumberInRange } from '../account-ClxOwjdh.mjs';
1
+ export { S as Serializable, b as Serializer, e as ensureBoolean, o as outOfRangeErrorMessage, v as validateNumberInRange } from '../account-BortO8g2.mjs';
2
2
  import '../types/indexer.mjs';
3
3
  import '../types/generated/operations.mjs';
4
4
  import '../types/generated/types.mjs';
@@ -0,0 +1,2 @@
1
+ import{b as r}from"./chunk-STY74NUA.mjs";var a=class a{static formatPrivateKey(e,n){let i=a.AIP80_PREFIXES[n],t=e;return typeof t=="string"&&t.startsWith(i)&&(t=t.split("-")[2]),`${i}${r.fromHexInput(t).toString()}`}static parseHexInput(e,n,i){let t,p=a.AIP80_PREFIXES[n];if(typeof e=="string")if(!i&&!e.startsWith(p))t=r.fromHexInput(e),i!==!1&&console.warn("[Aptos SDK] It is recommended that private keys are AIP-80 compliant (https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md). You can fix the private key by formatting it with `PrivateKey.formatPrivateKey(privateKey: string, type: 'ed25519' | 'secp256k1'): string`.");else if(e.startsWith(p))t=r.fromHexString(e.split("-")[2]);else throw i?new Error("Invalid HexString input while parsing private key. Must AIP-80 compliant string."):new Error("Invalid HexString input while parsing private key.");else t=r.fromHexInput(e);return t}};a.AIP80_PREFIXES={ed25519:"ed25519-priv-",secp256k1:"secp256k1-priv-",secp256r1:"secp256r1-priv-"};var s=a;export{s as a};
2
+ //# sourceMappingURL=chunk-2PASUPUO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/crypto/privateKey.ts"],"sourcesContent":["/* eslint-disable max-len */\n\nimport { HexInput, PrivateKeyVariants } from \"../../types\";\nimport { Hex } from \"../hex\";\nimport { PublicKey } from \"./publicKey\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents a private key used for signing messages and deriving the associated public key.\n * @group Implementation\n * @category Serialization\n */\nexport interface PrivateKey {\n /**\n * Sign the given message with the private key to create a signature.\n * @param message - The message to be signed, provided in HexInput format.\n * @returns A Signature object representing the signed message.\n * @group Implementation\n * @category Serialization\n */\n sign(message: HexInput): Signature;\n\n /**\n * Derive the public key associated with the private key.\n * @group Implementation\n * @category Serialization\n */\n publicKey(): PublicKey;\n\n /**\n * Get the private key in bytes (Uint8Array).\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array;\n}\n\nexport class PrivateKey {\n /**\n * The AIP-80 compliant prefixes for each private key type. Append this to a private key's hex representation\n * to get an AIP-80 compliant string.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n */\n public static readonly AIP80_PREFIXES = {\n [PrivateKeyVariants.Ed25519]: \"ed25519-priv-\",\n [PrivateKeyVariants.Secp256k1]: \"secp256k1-priv-\",\n [PrivateKeyVariants.Secp256r1]: \"secp256r1-priv-\",\n };\n\n /**\n * Format a HexInput to an AIP-80 compliant string.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @param privateKey - The HexString or Uint8Array format of the private key.\n * @param privateKeyType - The private key type\n */\n public static formatPrivateKey(privateKey: HexInput, type: PrivateKeyVariants): string {\n const aip80Prefix = PrivateKey.AIP80_PREFIXES[type];\n\n // Remove the prefix if it exists\n let formattedPrivateKey = privateKey;\n if (typeof formattedPrivateKey === \"string\" && formattedPrivateKey.startsWith(aip80Prefix)) {\n // eslint-disable-next-line prefer-destructuring\n formattedPrivateKey = formattedPrivateKey.split(\"-\")[2];\n }\n\n return `${aip80Prefix}${Hex.fromHexInput(formattedPrivateKey).toString()}`;\n }\n\n /**\n * Parse a HexInput that may be a HexString, Uint8Array, or a AIP-80 compliant string to a Hex instance.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @param value - A HexString, Uint8Array, or a AIP-80 compliant string.\n * @param privateKeyType - The private key type\n * @param strict - If true, the value MUST be compliant with AIP-80.\n */\n public static parseHexInput(value: HexInput, type: PrivateKeyVariants, strict?: boolean): Hex {\n let data: Hex;\n\n const aip80Prefix = PrivateKey.AIP80_PREFIXES[type];\n if (typeof value === \"string\") {\n if (!strict && !value.startsWith(aip80Prefix)) {\n // HexString input\n data = Hex.fromHexInput(value);\n // If the strictness is false, the user has opted into non-AIP-80 compliant private keys.\n if (strict !== false) {\n // eslint-disable-next-line no-console\n console.warn(\n \"[Aptos SDK] It is recommended that private keys are AIP-80 compliant (https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md). You can fix the private key by formatting it with `PrivateKey.formatPrivateKey(privateKey: string, type: 'ed25519' | 'secp256k1'): string`.\",\n );\n }\n } else if (value.startsWith(aip80Prefix)) {\n // AIP-80 Compliant String input\n data = Hex.fromHexString(value.split(\"-\")[2]);\n } else {\n if (strict) {\n // The value does not start with the AIP-80 prefix, and strict is true.\n throw new Error(\"Invalid HexString input while parsing private key. Must AIP-80 compliant string.\");\n }\n\n // This condition should never be reached.\n throw new Error(\"Invalid HexString input while parsing private key.\");\n }\n } else {\n // The value is an Uint8Array\n data = Hex.fromHexInput(value);\n }\n\n return data;\n }\n}\n"],"mappings":"yCAqCO,IAAMA,EAAN,MAAMA,CAAW,CAqBtB,OAAc,iBAAiBC,EAAsBC,EAAkC,CACrF,IAAMC,EAAcH,EAAW,eAAeE,CAAI,EAG9CE,EAAsBH,EAC1B,OAAI,OAAOG,GAAwB,UAAYA,EAAoB,WAAWD,CAAW,IAEvFC,EAAsBA,EAAoB,MAAM,GAAG,EAAE,CAAC,GAGjD,GAAGD,CAAW,GAAGE,EAAI,aAAaD,CAAmB,EAAE,SAAS,CAAC,EAC1E,CAWA,OAAc,cAAcE,EAAiBJ,EAA0BK,EAAuB,CAC5F,IAAIC,EAEEL,EAAcH,EAAW,eAAeE,CAAI,EAClD,GAAI,OAAOI,GAAU,SACnB,GAAI,CAACC,GAAU,CAACD,EAAM,WAAWH,CAAW,EAE1CK,EAAOH,EAAI,aAAaC,CAAK,EAEzBC,IAAW,IAEb,QAAQ,KACN,uRACF,UAEOD,EAAM,WAAWH,CAAW,EAErCK,EAAOH,EAAI,cAAcC,EAAM,MAAM,GAAG,EAAE,CAAC,CAAC,MAE5C,OAAIC,EAEI,IAAI,MAAM,kFAAkF,EAI9F,IAAI,MAAM,oDAAoD,OAItEC,EAAOH,EAAI,aAAaC,CAAK,EAG/B,OAAOE,CACT,CACF,EA7EaR,EAOY,eAAiB,CACrC,QAA6B,gBAC7B,UAA+B,kBAC/B,UAA+B,iBAClC,EAXK,IAAMS,EAANT","names":["_PrivateKey","privateKey","type","aip80Prefix","formattedPrivateKey","Hex","value","strict","data","PrivateKey"]}
@@ -1,2 +1,2 @@
1
- import{a as u,c as r}from"./chunk-Q4W3WJ2U.mjs";import{e as t}from"./chunk-ORMOQWWH.mjs";import{b as o}from"./chunk-RGKRCZ36.mjs";import{a as i}from"./chunk-EBMEXURY.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
2
- //# sourceMappingURL=chunk-V74WPKSY.mjs.map
1
+ import{b as o}from"./chunk-RGKRCZ36.mjs";import{a as u,c as r}from"./chunk-Q4W3WJ2U.mjs";import{e as t}from"./chunk-ORMOQWWH.mjs";import{a as i}from"./chunk-EBMEXURY.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
2
+ //# sourceMappingURL=chunk-2XQKGWHQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-LWL57YFU.mjs";async function o(e){let{type:t,originMethod:s,path:i,body:r,acceptType:R,contentType:f,params:c,aptosConfig:n,overrides:A}=e,d=n.getRequestUrl(t);return p({url:d,method:"POST",originMethod:s,path:i,body:r,contentType:f,acceptType:R,params:c,overrides:A},n,e.type)}async function q(e){let{aptosConfig:t}=e;return o({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function C(e){let{aptosConfig:t}=e;return o({...e,type:"Indexer",overrides:{...t.clientConfig,...t.indexerConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.indexerConfig?.HEADERS}}})}async function E(e){let{aptosConfig:t}=e,s={...t,clientConfig:{...t.clientConfig}};return delete s?.clientConfig?.API_KEY,o({...e,type:"Faucet",overrides:{...s.clientConfig,...s.faucetConfig,...e.overrides,HEADERS:{...s.clientConfig?.HEADERS,...s.faucetConfig?.HEADERS}}})}async function a(e){return o({...e,type:"Pepper"})}async function m(e){return o({...e,type:"Prover"})}export{o as a,q as b,C as c,E as d,a as e,m as f};
2
- //# sourceMappingURL=chunk-GFFKEZ56.mjs.map
1
+ import{b as p}from"./chunk-QP2BY4PK.mjs";async function o(e){let{type:t,originMethod:s,path:i,body:r,acceptType:R,contentType:f,params:c,aptosConfig:n,overrides:A}=e,d=n.getRequestUrl(t);return p({url:d,method:"POST",originMethod:s,path:i,body:r,contentType:f,acceptType:R,params:c,overrides:A},n,e.type)}async function q(e){let{aptosConfig:t}=e;return o({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function C(e){let{aptosConfig:t}=e;return o({...e,type:"Indexer",overrides:{...t.clientConfig,...t.indexerConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.indexerConfig?.HEADERS}}})}async function E(e){let{aptosConfig:t}=e,s={...t,clientConfig:{...t.clientConfig}};return delete s?.clientConfig?.API_KEY,o({...e,type:"Faucet",overrides:{...s.clientConfig,...s.faucetConfig,...e.overrides,HEADERS:{...s.clientConfig?.HEADERS,...s.faucetConfig?.HEADERS}}})}async function a(e){return o({...e,type:"Pepper"})}async function m(e){return o({...e,type:"Prover"})}export{o as a,q as b,C as c,E as d,a as e,m as f};
2
+ //# sourceMappingURL=chunk-4AI7KQQ7.mjs.map
@@ -1,2 +1,2 @@
1
- import{h as e}from"./chunk-N3O3ULF7.mjs";async function i(o){o.minimumLedgerVersion!==void 0&&await e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:o.processorType})}export{i as a};
2
- //# sourceMappingURL=chunk-TGRLDWXV.mjs.map
1
+ import{h as e}from"./chunk-AMXZQPUQ.mjs";async function i(o){o.minimumLedgerVersion!==void 0&&await e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:o.processorType})}export{i as a};
2
+ //# sourceMappingURL=chunk-6OWBKU7N.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as u}from"./chunk-LWL57YFU.mjs";async function i(e){let{aptosConfig:t,overrides:s,params:r,contentType:n,acceptType:a,path:p,originMethod:o,type:R}=e,d=t.getRequestUrl(R);return u({url:d,method:"GET",originMethod:o,path:p,contentType:n,acceptType:a,params:r,overrides:{...t.clientConfig,...s}},t,e.type)}async function y(e){let{aptosConfig:t}=e;return i({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function l(e){return i({...e,type:"Pepper"})}async function q(e){let t=new Array(0),s,r=e.params;do{let n=await i({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:r,overrides:e.overrides});s=n.headers["x-aptos-cursor"],delete n.headers,t.push(...n.data),r.start=s}while(s!=null);return t}async function A(e){let t=new Array(0),s,r=e.params,n=r.limit;do{let{response:a,cursor:p}=await m({...e});if(s=p,t.push(...a.data),e?.params&&(e.params.start=s),n!==void 0){let o=n-t.length;if(o<=0)break;r.limit=o}}while(s!=null);return t}async function m(e){let t,s={};typeof e.params?.cursor=="string"&&(s.start=e.params.cursor),typeof e.params?.limit=="number"&&(s.limit=e.params.limit);let r=await i({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:s,overrides:e.overrides});return t=r.headers["x-aptos-cursor"],{response:r,cursor:t}}export{i as a,y as b,l as c,q as d,A as e,m as f};
2
- //# sourceMappingURL=chunk-DNRUDMMV.mjs.map
1
+ import{b as u}from"./chunk-QP2BY4PK.mjs";async function i(e){let{aptosConfig:t,overrides:s,params:r,contentType:n,acceptType:a,path:p,originMethod:o,type:R}=e,d=t.getRequestUrl(R);return u({url:d,method:"GET",originMethod:o,path:p,contentType:n,acceptType:a,params:r,overrides:{...t.clientConfig,...s}},t,e.type)}async function y(e){let{aptosConfig:t}=e;return i({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function l(e){return i({...e,type:"Pepper"})}async function q(e){let t=new Array(0),s,r=e.params;do{let n=await i({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:r,overrides:e.overrides});s=n.headers["x-aptos-cursor"],delete n.headers,t.push(...n.data),r.start=s}while(s!=null);return t}async function A(e){let t=new Array(0),s,r=e.params,n=r.limit;do{let{response:a,cursor:p}=await m({...e});if(s=p,t.push(...a.data),e?.params&&(e.params.start=s),n!==void 0){let o=n-t.length;if(o<=0)break;r.limit=o}}while(s!=null);return t}async function m(e){let t,s={};typeof e.params?.cursor=="string"&&(s.start=e.params.cursor),typeof e.params?.limit=="number"&&(s.limit=e.params.limit);let r=await i({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:s,overrides:e.overrides});return t=r.headers["x-aptos-cursor"],{response:r,cursor:t}}export{i as a,y as b,l as c,q as d,A as e,m as f};
2
+ //# sourceMappingURL=chunk-7EER7GWV.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as k}from"./chunk-YOZBVVKL.mjs";import{e as x,f as B}from"./chunk-GMQCQDW4.mjs";import{b as f,d as A}from"./chunk-DNRUDMMV.mjs";import{e as b}from"./chunk-6WDVDEQZ.mjs";import{a as d}from"./chunk-7DQDJ2SA.mjs";import{d as C}from"./chunk-OLILO7VD.mjs";async function H(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function W(o){let{aptosConfig:n}=o;return k(async()=>{let{data:t}=await f({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function O(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await f({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function y(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function q(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await y({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function R(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function z(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,e=!0,p=0,i,g,l=200,h=1.5;function c(a){if(!(a instanceof b)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}try{i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(a){c(a)}if(e){let a=Date.now();try{i=await R({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(w){c(w)}p=(Date.now()-a)/1e3}for(;e&&!(p>=r);){try{if(i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction",!e)break}catch(a){c(a)}await d(l),p+=l/1e3,l*=h}if(i===void 0)throw g||new m(`Fetching transaction ${t} failed and timed out after ${r} seconds`,i);if(i.type==="pending_transaction")throw new m(`Transaction ${t} timed out in pending state after ${r} seconds`,i);if(!u)return i;if(!i.success)throw new T(`Transaction ${t} failed with an error: ${i.vm_status}`,i);return i}async function U(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),e=BigInt(-1);for(;e<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?e=await x({aptosConfig:n}):e=(await B({aptosConfig:n,processorType:t})).last_success_version,e>=s)break;await d(200)}}var m=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};async function X(o){let{aptosConfig:n,ledgerVersion:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function j(o){let{aptosConfig:n,blockHeight:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function P(o){let{aptosConfig:n,block:t,options:s}=o;if(s?.withTransactions){t.transactions=t.transactions??[];let r=t.transactions[t.transactions.length-1],u=BigInt(t.first_version),e=BigInt(t.last_version),p=r?.version,i;if(p===void 0?i=u-1n:i=BigInt(p),i===e)return t;let g=[],l=100n;for(let c=i+1n;c<e;c+=BigInt(100))g.push(H({aptosConfig:n,options:{offset:c,limit:Math.min(Number(l),Number(e-c+1n))}}));let h=await Promise.all(g);for(let c of h)t.transactions.push(...c)}return t}export{H as a,W as b,O as c,y as d,q as e,R as f,z as g,U as h,m as i,T as j,X as k,j as l};
2
- //# sourceMappingURL=chunk-N3O3ULF7.mjs.map
1
+ import{a as k}from"./chunk-YOZBVVKL.mjs";import{e as x,f as B}from"./chunk-SJDCGNWU.mjs";import{b as f,d as A}from"./chunk-7EER7GWV.mjs";import{e as b}from"./chunk-6WDVDEQZ.mjs";import{d as C}from"./chunk-OLILO7VD.mjs";import{a as d}from"./chunk-7DQDJ2SA.mjs";async function H(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function W(o){let{aptosConfig:n}=o;return k(async()=>{let{data:t}=await f({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function O(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await f({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function y(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function q(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await y({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function R(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function z(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,e=!0,p=0,i,g,l=200,h=1.5;function c(a){if(!(a instanceof b)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}try{i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(a){c(a)}if(e){let a=Date.now();try{i=await R({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(w){c(w)}p=(Date.now()-a)/1e3}for(;e&&!(p>=r);){try{if(i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction",!e)break}catch(a){c(a)}await d(l),p+=l/1e3,l*=h}if(i===void 0)throw g||new m(`Fetching transaction ${t} failed and timed out after ${r} seconds`,i);if(i.type==="pending_transaction")throw new m(`Transaction ${t} timed out in pending state after ${r} seconds`,i);if(!u)return i;if(!i.success)throw new T(`Transaction ${t} failed with an error: ${i.vm_status}`,i);return i}async function U(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),e=BigInt(-1);for(;e<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?e=await x({aptosConfig:n}):e=(await B({aptosConfig:n,processorType:t})).last_success_version,e>=s)break;await d(200)}}var m=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};async function X(o){let{aptosConfig:n,ledgerVersion:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function j(o){let{aptosConfig:n,blockHeight:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function P(o){let{aptosConfig:n,block:t,options:s}=o;if(s?.withTransactions){t.transactions=t.transactions??[];let r=t.transactions[t.transactions.length-1],u=BigInt(t.first_version),e=BigInt(t.last_version),p=r?.version,i;if(p===void 0?i=u-1n:i=BigInt(p),i===e)return t;let g=[],l=100n;for(let c=i+1n;c<e;c+=BigInt(100))g.push(H({aptosConfig:n,options:{offset:c,limit:Math.min(Number(l),Number(e-c+1n))}}));let h=await Promise.all(g);for(let c of h)t.transactions.push(...c)}return t}export{H as a,W as b,O as c,y as d,q as e,R as f,z as g,U as h,m as i,T as j,X as k,j as l};
2
+ //# sourceMappingURL=chunk-AMXZQPUQ.mjs.map
@@ -0,0 +1,2 @@
1
+ var o="5.1.0";export{o as a};
2
+ //# sourceMappingURL=chunk-CIJA7ONS.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 = \"5.0.0\";\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 = \"5.1.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-WSR5EBJM.mjs";import{a as s}from"./chunk-WCMW2L3P.mjs";import{a as t}from"./chunk-FGFLPH5K.mjs";import{b as i}from"./chunk-STY74NUA.mjs";var n=class e extends s{constructor(r){super(),this.value=i.fromHexInput(r).toUint8Array()}serialize(r){r.serializeBytes(this.value)}static deserialize(r){return new e(r.deserializeBytes())}},a=class extends o{constructor(r){super(),this.accountAddress=r}authKey(){return new t({data:this.accountAddress.toUint8Array()})}verifySignature(r){throw new Error("This function is not implemented for AbstractPublicKey.")}async verifySignatureAsync(r){throw new Error("This function is not implemented for AbstractPublicKey.")}serialize(r){throw new Error("This function is not implemented for AbstractPublicKey.")}};export{n as a,a as b};
2
- //# sourceMappingURL=chunk-RQX6JOEN.mjs.map
1
+ import{a as s}from"./chunk-WCMW2L3P.mjs";import{b as o}from"./chunk-WSR5EBJM.mjs";import{a as t}from"./chunk-FGFLPH5K.mjs";import{b as i}from"./chunk-STY74NUA.mjs";var n=class e extends s{constructor(r){super(),this.value=i.fromHexInput(r).toUint8Array()}serialize(r){r.serializeBytes(this.value)}static deserialize(r){return new e(r.deserializeBytes())}},a=class extends o{constructor(r){super(),this.accountAddress=r}authKey(){return new t({data:this.accountAddress.toUint8Array()})}verifySignature(r){throw new Error("This function is not implemented for AbstractPublicKey.")}async verifySignatureAsync(r){throw new Error("This function is not implemented for AbstractPublicKey.")}serialize(r){throw new Error("This function is not implemented for AbstractPublicKey.")}};export{n as a,a as b};
2
+ //# sourceMappingURL=chunk-EF4FA5I6.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as l}from"./chunk-2PASUPUO.mjs";import{a as h}from"./chunk-WCMW2L3P.mjs";import{a as x}from"./chunk-WSR5EBJM.mjs";import{a as m}from"./chunk-FGFLPH5K.mjs";import{b as c}from"./chunk-EBMEXURY.mjs";import{b as n}from"./chunk-STY74NUA.mjs";import{sha3_256 as A}from"@noble/hashes/sha3";import{p256 as y}from"@noble/curves/nist.js";var s=class s extends x{constructor(e){super();this.keyType="secp256r1";let r=n.fromHexInput(e),i=r.toUint8Array().length;if(i!==s.LENGTH&&i!==s.COMPRESSED_LENGTH)throw new Error(`PublicKey length should be ${s.LENGTH} or ${s.COMPRESSED_LENGTH}, received ${i}`);if(i===s.COMPRESSED_LENGTH){let u=y.ProjectivePoint.fromHex(r.toUint8Array());this.key=n.fromHexInput(u.toRawBytes(!1))}else this.key=r}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}bcsToBytes(){let e=new c;return this.serialize(e),e.toUint8Array()}verifySignature(e){let{message:r,signature:i}=e,u=n.fromHexInput(r).toUint8Array(),f=A(u),U=i.toUint8Array();return y.verify(U,f,this.toUint8Array())}async verifySignatureAsync(e){return this.verifySignature({message:e.message,signature:e.signature})}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new s(r)}static load(e){let r=e.deserializeBytes();return new s(r)}static isInstance(e){return"key"in e&&e.key?.data?.length===s.LENGTH&&"keyType"in e&&e.keyType==="secp256r1"}authKey(){let e=new c;return e.serializeU32AsUleb128(2),e.serializeFixedBytes(this.bcsToBytes()),m.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}};s.LENGTH=65,s.COMPRESSED_LENGTH=33;var g=s,a=class a extends l{constructor(t,e){super();let r=l.parseHexInput(t,"secp256r1",e),i=r.toUint8Array().length;if(i!==a.LENGTH)throw new Error(`PrivateKey length should be ${a.LENGTH}, received ${i}`);this.key=r}toUint8Array(){return this.key.toUint8Array()}toString(){return l.formatPrivateKey(this.key.toString(),"secp256r1")}toHexString(){return this.key.toString()}sign(t){let e=n.fromHexInput(t),r=A(e.toUint8Array()),i=y.sign(r,this.key.toUint8Array());return new p(i.toCompactRawBytes())}serialize(t){t.serializeBytes(this.toUint8Array())}static deserialize(t){let e=t.deserializeBytes();return new a(e)}static generate(){let t=y.utils.randomPrivateKey();return new a(t)}publicKey(){let t=y.getPublicKey(this.key.toUint8Array(),!1);return new g(t)}};a.LENGTH=32;var H=a,S=class d extends h{constructor(t,e,r){super(),this.signature=n.fromHexInput(t),this.authenticatorData=n.fromHexInput(e),this.clientDataJSON=n.fromHexInput(r)}toUint8Array(){return this.signature.toUint8Array()}serialize(t){t.serializeU32AsUleb128(0),t.serializeBytes(this.signature.toUint8Array()),t.serializeBytes(this.authenticatorData.toUint8Array()),t.serializeBytes(this.clientDataJSON.toUint8Array())}bcsToBytes(){let t=new c;return this.serialize(t),t.toUint8Array()}bcsToHex(){return n.fromHexInput(this.bcsToBytes())}toStringWithoutPrefix(){return n.fromHexInput(this.bcsToBytes()).toString()}static deserialize(t){let e=t.deserializeUleb128AsU32();if(e!==0)throw new Error(`Invalid id for WebAuthnSignature: ${e}`);let r=t.deserializeBytes(),i=t.deserializeBytes(),u=t.deserializeBytes();return new d(r,i,u)}},o=class o extends h{constructor(t){super();let e=n.fromHexInput(t),r=e.toUint8Array().length;if(r!==o.LENGTH)throw new Error(`Signature length should be ${o.LENGTH}, received ${r}`);let i=y.Signature.fromCompact(e.toUint8Array()).normalizeS().toCompactRawBytes();this.data=n.fromHexInput(i)}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(t){t.serializeBytes(this.data.toUint8Array())}static deserialize(t){let e=t.deserializeBytes();return new o(e)}};o.LENGTH=64;var p=o;export{g as a,H as b,S as c,p as d};
2
+ //# sourceMappingURL=chunk-I7XT6L7S.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/crypto/secp256r1.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { sha3_256 } from \"@noble/hashes/sha3\";\nimport { p256 } from \"@noble/curves/nist.js\";\nimport { Deserializer, Serializer } from \"../../bcs\";\nimport { Hex } from \"../hex\";\nimport {\n HexInput,\n PrivateKeyVariants,\n SigningScheme as AuthenticationKeyScheme,\n AnyPublicKeyVariant,\n} from \"../../types\";\nimport { PublicKey, VerifySignatureAsyncArgs } from \"./publicKey\";\nimport { PrivateKey } from \"./privateKey\";\nimport { Signature } from \"./signature\";\nimport { AuthenticationKey } from \"../authenticationKey\";\n\n/**\n * Represents a Secp256r1 ECDSA public key.\n *\n * @extends PublicKey\n * @property LENGTH - The length of the Secp256r1 public key in bytes.\n * @group Implementation\n * @category Serialization\n */\nexport class Secp256r1PublicKey extends PublicKey {\n // Secp256r1 ecdsa public keys contain a prefix indicating compression and two 32-byte coordinates.\n static readonly LENGTH: number = 65;\n\n // If it's compressed, it is only 33 bytes\n static readonly COMPRESSED_LENGTH: number = 33;\n\n // Hex value of the public key\n private readonly key: Hex;\n\n // Identifier to distinguish from Secp256k1PublicKey\n public readonly keyType: string = \"secp256r1\";\n\n /**\n * Create a new PublicKey instance from a HexInput, which can be a string or Uint8Array.\n * This constructor validates the length of the provided public key data.\n *\n * @param hexInput - A HexInput (string or Uint8Array) representing the public key data.\n * @throws Error if the length of the public key data is not equal to Secp256r1PublicKey.LENGTH or COMPRESSED_LENGTH.\n * @group Implementation\n * @category Serialization\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n const keyLength = hex.toUint8Array().length;\n if (keyLength !== Secp256r1PublicKey.LENGTH && keyLength !== Secp256r1PublicKey.COMPRESSED_LENGTH) {\n throw new Error(\n `PublicKey length should be ${Secp256r1PublicKey.LENGTH} or ${Secp256r1PublicKey.COMPRESSED_LENGTH}, received ${keyLength}`,\n );\n }\n\n if (keyLength === Secp256r1PublicKey.COMPRESSED_LENGTH) {\n const point = p256.ProjectivePoint.fromHex(hex.toUint8Array());\n this.key = Hex.fromHexInput(point.toRawBytes(false));\n } else {\n this.key = hex;\n }\n }\n\n /**\n * Get the data as a Uint8Array representation.\n *\n * @returns Uint8Array representation of the data.\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n /**\n * Get the public key as a hex string with the 0x prefix.\n *\n * @returns string representation of the public key.\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n return this.key.toString();\n }\n\n /**\n * Converts the public key to BCS (Binary Canonical Serialization) bytes.\n * This function serializes the public key data into a byte array format suitable for transmission or storage.\n *\n * @returns Uint8Array representation of the serialized public key.\n * @group Implementation\n * @category Serialization\n */\n bcsToBytes() {\n const serializer = new Serializer();\n this.serialize(serializer);\n return serializer.toUint8Array();\n }\n\n /**\n * Verifies a Secp256r1 signature against the public key.\n *\n * This function checks the validity of a signature for a given message.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The message that was signed.\n * @param args.signature - The signature to verify against the public key.\n * @group Implementation\n * @category Serialization\n */\n verifySignature(args: { message: HexInput; signature: Signature }): boolean {\n const { message, signature } = args;\n\n const msgHex = Hex.fromHexInput(message).toUint8Array();\n const sha3Message = sha3_256(msgHex);\n const rawSignature = signature.toUint8Array();\n\n return p256.verify(rawSignature, sha3Message, this.toUint8Array());\n }\n\n /**\n * Note: Secp256r1Signatures can be verified synchronously.\n *\n * Verifies the provided signature against the given message.\n * This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.\n *\n * @param args - The arguments for signature verification.\n * @param args.message - The message that was signed.\n * @param args.signature - The signature to verify, which must be an instance of Secp256r1Signature.\n * @returns A boolean indicating whether the signature is valid for the given message.\n * @group Implementation\n * @category Serialization\n */\n async verifySignatureAsync(args: VerifySignatureAsyncArgs): Promise<boolean> {\n return this.verifySignature({ message: args.message, signature: args.signature });\n }\n\n /**\n * Serializes the data into a byte array using the provided serializer.\n * This function is essential for converting data into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to convert the data.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.key.toUint8Array());\n }\n\n /**\n * Deserializes a Secp256r1PublicKey from the provided deserializer.\n * This function allows you to reconstruct a Secp256r1PublicKey object from its serialized byte representation.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): Secp256r1PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256r1PublicKey(bytes);\n }\n\n /**\n * Loads a Secp256r1PublicKey from the provided deserializer.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Serialization\n */\n static load(deserializer: Deserializer): Secp256r1PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256r1PublicKey(bytes);\n }\n\n /**\n * Determines if the provided public key is a valid instance of a Secp256r1 public key.\n * This function checks for the presence of a \"key\" property and validates the length of the key data.\n *\n * @param publicKey - The public key to validate.\n * @returns A boolean indicating whether the public key is a valid Secp256r1 public key.\n * @group Implementation\n * @category Serialization\n */\n static isInstance(publicKey: PublicKey): publicKey is Secp256r1PublicKey {\n return (\n \"key\" in publicKey &&\n (publicKey.key as any)?.data?.length === Secp256r1PublicKey.LENGTH &&\n \"keyType\" in publicKey &&\n (publicKey as any).keyType === \"secp256r1\"\n );\n }\n\n /**\n * Generates an authentication key from the public key using the Secp256r1 scheme.\n * This function is essential for creating a secure authentication key that can be used for further cryptographic operations.\n *\n * @returns {AuthenticationKey} The generated authentication key.\n * @group Implementation\n * @category Serialization\n */\n authKey(): AuthenticationKey {\n const serializer = new Serializer();\n serializer.serializeU32AsUleb128(AnyPublicKeyVariant.Secp256r1);\n serializer.serializeFixedBytes(this.bcsToBytes());\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.SingleKey,\n input: serializer.toUint8Array(),\n });\n }\n}\n\n/**\n * Represents a Secp256r1 ECDSA private key, providing functionality to create, sign messages,\n * derive public keys, and serialize/deserialize the key.\n * @group Implementation\n * @category Serialization\n */\nexport class Secp256r1PrivateKey extends PrivateKey {\n /**\n * Length of Secp256r1 ecdsa private key\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The private key bytes\n * @private\n * @group Implementation\n * @category Serialization\n */\n private readonly key: Hex;\n\n /**\n * Create a new PrivateKey instance from a Uint8Array or String.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @param hexInput A HexInput (string or Uint8Array)\n * @param strict If true, private key must AIP-80 compliant.\n * @group Implementation\n * @category Serialization\n */\n constructor(hexInput: HexInput, strict?: boolean) {\n super();\n\n const privateKeyHex = PrivateKey.parseHexInput(hexInput, PrivateKeyVariants.Secp256r1, strict);\n const keyLength = privateKeyHex.toUint8Array().length;\n if (keyLength !== Secp256r1PrivateKey.LENGTH) {\n throw new Error(`PrivateKey length should be ${Secp256r1PrivateKey.LENGTH}, received ${keyLength}`);\n }\n\n this.key = privateKeyHex;\n }\n\n /**\n * Get the private key in bytes (Uint8Array).\n *\n * @returns\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n /**\n * Get the private key as a string representation.\n *\n * @returns string representation of the private key\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n return PrivateKey.formatPrivateKey(this.key.toString(), PrivateKeyVariants.Secp256r1);\n }\n\n /**\n * Get the private key as a hex string with the 0x prefix.\n *\n * @returns string representation of the private key.\n */\n toHexString(): string {\n return this.key.toString();\n }\n\n /**\n * Sign the given message with the private key.\n * This function generates a cryptographic signature for the provided message.\n *\n * @param message - A message in HexInput format to be signed.\n * @returns Signature - The generated signature for the provided message.\n * @group Implementation\n * @category Serialization\n */\n sign(message: HexInput): Secp256r1Signature {\n const msgHex = Hex.fromHexInput(message);\n const sha3Message = sha3_256(msgHex.toUint8Array());\n const signature = p256.sign(sha3Message, this.key.toUint8Array());\n return new Secp256r1Signature(signature.toCompactRawBytes());\n }\n\n /**\n * Serializes the data into a byte array using the provided serializer.\n * This function is essential for converting data into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to convert the data.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n /**\n * Deserializes a Secp256r1PrivateKey from the provided deserializer.\n * This function allows you to reconstruct a Secp256r1PrivateKey object from its serialized byte representation.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): Secp256r1PrivateKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256r1PrivateKey(bytes);\n }\n\n /**\n * Generate a new random private key.\n *\n * @returns Secp256r1PrivateKey - A newly generated Secp256r1 private key.\n * @group Implementation\n * @category Serialization\n */\n static generate(): Secp256r1PrivateKey {\n const hexInput = p256.utils.randomPrivateKey();\n return new Secp256r1PrivateKey(hexInput);\n }\n\n /**\n * Derive the Secp256r1PublicKey from this private key.\n *\n * @returns Secp256r1PublicKey The derived public key.\n * @group Implementation\n * @category Serialization\n */\n publicKey(): Secp256r1PublicKey {\n const bytes = p256.getPublicKey(this.key.toUint8Array(), false);\n return new Secp256r1PublicKey(bytes);\n }\n}\n\nexport class WebAuthnSignature extends Signature {\n signature: Hex;\n\n authenticatorData: Hex;\n\n clientDataJSON: Hex;\n\n constructor(signature: HexInput, authenticatorData: HexInput, clientDataJSON: HexInput) {\n super();\n this.signature = Hex.fromHexInput(signature);\n this.authenticatorData = Hex.fromHexInput(authenticatorData);\n this.clientDataJSON = Hex.fromHexInput(clientDataJSON);\n }\n\n toUint8Array() {\n return this.signature.toUint8Array();\n }\n\n serialize(serializer: Serializer) {\n serializer.serializeU32AsUleb128(0);\n serializer.serializeBytes(this.signature.toUint8Array());\n serializer.serializeBytes(this.authenticatorData.toUint8Array());\n serializer.serializeBytes(this.clientDataJSON.toUint8Array());\n }\n\n bcsToBytes() {\n const serializer = new Serializer();\n this.serialize(serializer);\n return serializer.toUint8Array();\n }\n\n bcsToHex() {\n return Hex.fromHexInput(this.bcsToBytes());\n }\n\n toStringWithoutPrefix() {\n return Hex.fromHexInput(this.bcsToBytes()).toString();\n }\n\n static deserialize(deserializer: Deserializer) {\n const id = deserializer.deserializeUleb128AsU32();\n if (id !== 0) {\n throw new Error(`Invalid id for WebAuthnSignature: ${id}`);\n }\n const signature = deserializer.deserializeBytes();\n const authenticatorData = deserializer.deserializeBytes();\n const clientDataJSON = deserializer.deserializeBytes();\n return new WebAuthnSignature(signature, authenticatorData, clientDataJSON);\n }\n}\n\n/**\n * Represents a signature of a message signed using a Secp256r1 ECDSA private key.\n *\n * @group Implementation\n * @category Serialization\n */\nexport class Secp256r1Signature extends Signature {\n /**\n * Secp256r1 ecdsa signatures are 256-bit.\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH = 64;\n\n /**\n * The signature bytes\n * @private\n * @group Implementation\n * @category Serialization\n */\n private readonly data: Hex;\n\n /**\n * Create a new Signature instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n * @group Implementation\n * @category Serialization\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n const signatureLength = hex.toUint8Array().length;\n if (signatureLength !== Secp256r1Signature.LENGTH) {\n throw new Error(`Signature length should be ${Secp256r1Signature.LENGTH}, received ${signatureLength}`);\n }\n const signature = p256.Signature.fromCompact(hex.toUint8Array()).normalizeS().toCompactRawBytes();\n this.data = Hex.fromHexInput(signature);\n }\n\n /**\n * Get the signature in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the signature\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.data.toUint8Array();\n }\n\n /**\n * Get the signature as a hex string with the 0x prefix.\n *\n * @returns string representation of the signature\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n return this.data.toString();\n }\n\n /**\n * Serializes the data into a byte array using the provided serializer.\n * This function is essential for converting data into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to convert the data.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.data.toUint8Array());\n }\n\n /**\n * Deserializes a Secp256r1Signature from the provided deserializer.\n * This function allows you to reconstruct a Secp256r1Signature object from its serialized byte representation.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): Secp256r1Signature {\n const hex = deserializer.deserializeBytes();\n return new Secp256r1Signature(hex);\n }\n}\n"],"mappings":"sPAGA,OAAS,YAAAA,MAAgB,qBACzB,OAAS,QAAAC,MAAY,wBAsBd,IAAMC,EAAN,MAAMA,UAA2BC,CAAU,CAsBhD,YAAYC,EAAoB,CAC9B,MAAM,EAZR,KAAgB,QAAkB,YAchC,IAAMC,EAAMC,EAAI,aAAaF,CAAQ,EAC/BG,EAAYF,EAAI,aAAa,EAAE,OACrC,GAAIE,IAAcL,EAAmB,QAAUK,IAAcL,EAAmB,kBAC9E,MAAM,IAAI,MACR,8BAA8BA,EAAmB,MAAM,OAAOA,EAAmB,iBAAiB,cAAcK,CAAS,EAC3H,EAGF,GAAIA,IAAcL,EAAmB,kBAAmB,CACtD,IAAMM,EAAQC,EAAK,gBAAgB,QAAQJ,EAAI,aAAa,CAAC,EAC7D,KAAK,IAAMC,EAAI,aAAaE,EAAM,WAAW,EAAK,CAAC,CACrD,MACE,KAAK,IAAMH,CAEf,CASA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CASA,UAAmB,CACjB,OAAO,KAAK,IAAI,SAAS,CAC3B,CAUA,YAAa,CACX,IAAMK,EAAa,IAAIC,EACvB,YAAK,UAAUD,CAAU,EAClBA,EAAW,aAAa,CACjC,CAaA,gBAAgBE,EAA4D,CAC1E,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EAEzBG,EAAST,EAAI,aAAaO,CAAO,EAAE,aAAa,EAChDG,EAAcC,EAASF,CAAM,EAC7BG,EAAeJ,EAAU,aAAa,EAE5C,OAAOL,EAAK,OAAOS,EAAcF,EAAa,KAAK,aAAa,CAAC,CACnE,CAeA,MAAM,qBAAqBJ,EAAkD,CAC3E,OAAO,KAAK,gBAAgB,CAAE,QAASA,EAAK,QAAS,UAAWA,EAAK,SAAU,CAAC,CAClF,CAUA,UAAUF,EAA8B,CACtCA,EAAW,eAAe,KAAK,IAAI,aAAa,CAAC,CACnD,CAUA,OAAO,YAAYS,EAAgD,CACjE,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAIjB,EAAmBkB,CAAK,CACrC,CASA,OAAO,KAAKD,EAAgD,CAC1D,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAIjB,EAAmBkB,CAAK,CACrC,CAWA,OAAO,WAAWC,EAAuD,CACvE,MACE,QAASA,GACRA,EAAU,KAAa,MAAM,SAAWnB,EAAmB,QAC5D,YAAamB,GACZA,EAAkB,UAAY,WAEnC,CAUA,SAA6B,CAC3B,IAAMX,EAAa,IAAIC,EACvB,OAAAD,EAAW,uBAAmD,EAC9DA,EAAW,oBAAoB,KAAK,WAAW,CAAC,EACzCY,EAAkB,mBAAmB,CAC1C,SACA,MAAOZ,EAAW,aAAa,CACjC,CAAC,CACH,CACF,EA3LaR,EAEK,OAAiB,GAFtBA,EAKK,kBAA4B,GALvC,IAAMqB,EAANrB,EAmMMsB,EAAN,MAAMA,UAA4BC,CAAW,CA0BlD,YAAYrB,EAAoBsB,EAAkB,CAChD,MAAM,EAEN,IAAMC,EAAgBF,EAAW,cAAcrB,cAAwCsB,CAAM,EACvFnB,EAAYoB,EAAc,aAAa,EAAE,OAC/C,GAAIpB,IAAciB,EAAoB,OACpC,MAAM,IAAI,MAAM,+BAA+BA,EAAoB,MAAM,cAAcjB,CAAS,EAAE,EAGpG,KAAK,IAAMoB,CACb,CASA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CASA,UAAmB,CACjB,OAAOF,EAAW,iBAAiB,KAAK,IAAI,SAAS,aAA+B,CACtF,CAOA,aAAsB,CACpB,OAAO,KAAK,IAAI,SAAS,CAC3B,CAWA,KAAKZ,EAAuC,CAC1C,IAAME,EAAST,EAAI,aAAaO,CAAO,EACjCG,EAAcC,EAASF,EAAO,aAAa,CAAC,EAC5CD,EAAYL,EAAK,KAAKO,EAAa,KAAK,IAAI,aAAa,CAAC,EAChE,OAAO,IAAIY,EAAmBd,EAAU,kBAAkB,CAAC,CAC7D,CAUA,UAAUJ,EAA8B,CACtCA,EAAW,eAAe,KAAK,aAAa,CAAC,CAC/C,CAUA,OAAO,YAAYS,EAAiD,CAClE,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAIK,EAAoBJ,CAAK,CACtC,CASA,OAAO,UAAgC,CACrC,IAAMhB,EAAWK,EAAK,MAAM,iBAAiB,EAC7C,OAAO,IAAIe,EAAoBpB,CAAQ,CACzC,CASA,WAAgC,CAC9B,IAAMgB,EAAQX,EAAK,aAAa,KAAK,IAAI,aAAa,EAAG,EAAK,EAC9D,OAAO,IAAIc,EAAmBH,CAAK,CACrC,CACF,EArIaI,EAMK,OAAiB,GAN5B,IAAMK,EAANL,EAuIMM,EAAN,MAAMC,UAA0BC,CAAU,CAO/C,YAAYlB,EAAqBmB,EAA6BC,EAA0B,CACtF,MAAM,EACN,KAAK,UAAY5B,EAAI,aAAaQ,CAAS,EAC3C,KAAK,kBAAoBR,EAAI,aAAa2B,CAAiB,EAC3D,KAAK,eAAiB3B,EAAI,aAAa4B,CAAc,CACvD,CAEA,cAAe,CACb,OAAO,KAAK,UAAU,aAAa,CACrC,CAEA,UAAUxB,EAAwB,CAChCA,EAAW,sBAAsB,CAAC,EAClCA,EAAW,eAAe,KAAK,UAAU,aAAa,CAAC,EACvDA,EAAW,eAAe,KAAK,kBAAkB,aAAa,CAAC,EAC/DA,EAAW,eAAe,KAAK,eAAe,aAAa,CAAC,CAC9D,CAEA,YAAa,CACX,IAAMA,EAAa,IAAIC,EACvB,YAAK,UAAUD,CAAU,EAClBA,EAAW,aAAa,CACjC,CAEA,UAAW,CACT,OAAOJ,EAAI,aAAa,KAAK,WAAW,CAAC,CAC3C,CAEA,uBAAwB,CACtB,OAAOA,EAAI,aAAa,KAAK,WAAW,CAAC,EAAE,SAAS,CACtD,CAEA,OAAO,YAAYa,EAA4B,CAC7C,IAAMgB,EAAKhB,EAAa,wBAAwB,EAChD,GAAIgB,IAAO,EACT,MAAM,IAAI,MAAM,qCAAqCA,CAAE,EAAE,EAE3D,IAAMrB,EAAYK,EAAa,iBAAiB,EAC1Cc,EAAoBd,EAAa,iBAAiB,EAClDe,EAAiBf,EAAa,iBAAiB,EACrD,OAAO,IAAIY,EAAkBjB,EAAWmB,EAAmBC,CAAc,CAC3E,CACF,EAQaE,EAAN,MAAMA,UAA2BJ,CAAU,CAuBhD,YAAY5B,EAAoB,CAC9B,MAAM,EAEN,IAAMC,EAAMC,EAAI,aAAaF,CAAQ,EAC/BiC,EAAkBhC,EAAI,aAAa,EAAE,OAC3C,GAAIgC,IAAoBD,EAAmB,OACzC,MAAM,IAAI,MAAM,8BAA8BA,EAAmB,MAAM,cAAcC,CAAe,EAAE,EAExG,IAAMvB,EAAYL,EAAK,UAAU,YAAYJ,EAAI,aAAa,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAChG,KAAK,KAAOC,EAAI,aAAaQ,CAAS,CACxC,CASA,cAA2B,CACzB,OAAO,KAAK,KAAK,aAAa,CAChC,CASA,UAAmB,CACjB,OAAO,KAAK,KAAK,SAAS,CAC5B,CAUA,UAAUJ,EAA8B,CACtCA,EAAW,eAAe,KAAK,KAAK,aAAa,CAAC,CACpD,CAUA,OAAO,YAAYS,EAAgD,CACjE,IAAMd,EAAMc,EAAa,iBAAiB,EAC1C,OAAO,IAAIiB,EAAmB/B,CAAG,CACnC,CACF,EAjFa+B,EAMK,OAAS,GANpB,IAAMR,EAANQ","names":["sha3_256","p256","_Secp256r1PublicKey","PublicKey","hexInput","hex","Hex","keyLength","point","p256","serializer","Serializer","args","message","signature","msgHex","sha3Message","sha3_256","rawSignature","deserializer","bytes","publicKey","AuthenticationKey","Secp256r1PublicKey","_Secp256r1PrivateKey","PrivateKey","strict","privateKeyHex","Secp256r1Signature","Secp256r1PrivateKey","WebAuthnSignature","_WebAuthnSignature","Signature","authenticatorData","clientDataJSON","id","_Secp256r1Signature","signatureLength"]}
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-YOZBVVKL.mjs";import{b as s}from"./chunk-DNRUDMMV.mjs";import{b as r}from"./chunk-RGKRCZ36.mjs";async function g(o){let{aptosConfig:e,accountAddress:t}=o,{data:n}=await s({aptosConfig:e,originMethod:"getInfo",path:`accounts/${r.from(t).toString()}`});return n}async function f(o){return o.options?.ledgerVersion!==void 0?c(o):d(async()=>c(o),`module-${o.accountAddress}-${o.moduleName}`,1e3*60*5)()}async function c(o){let{aptosConfig:e,accountAddress:t,moduleName:n,options:i}=o,{data:u}=await s({aptosConfig:e,originMethod:"getModule",path:`accounts/${r.from(t).toString()}/module/${n}`,params:{ledger_version:i?.ledgerVersion}});return u}export{g as a,f as b};
2
- //# sourceMappingURL=chunk-HNBKTJPN.mjs.map
1
+ import{a as d}from"./chunk-YOZBVVKL.mjs";import{b as s}from"./chunk-7EER7GWV.mjs";import{b as r}from"./chunk-RGKRCZ36.mjs";async function g(o){let{aptosConfig:e,accountAddress:t}=o,{data:n}=await s({aptosConfig:e,originMethod:"getInfo",path:`accounts/${r.from(t).toString()}`});return n}async function f(o){return o.options?.ledgerVersion!==void 0?c(o):d(async()=>c(o),`module-${o.accountAddress}-${o.moduleName}`,1e3*60*5)()}async function c(o){let{aptosConfig:e,accountAddress:t,moduleName:n,options:i}=o,{data:u}=await s({aptosConfig:e,originMethod:"getModule",path:`accounts/${r.from(t).toString()}/module/${n}`,params:{ledger_version:i?.ledgerVersion}});return u}export{g as a,f as b};
2
+ //# sourceMappingURL=chunk-JABP65XD.mjs.map