@aptos-labs/ts-sdk 5.0.0 → 5.1.1-side-effect-free.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 (547) hide show
  1. package/dist/common/{account-BDwBREvt.d.ts → account-Dr4y1uZG.d.ts} +8 -2
  2. package/dist/common/chunk-AWFAHZSB.js +4 -0
  3. package/dist/common/{chunk-6MMUUJHX.js.map → chunk-AWFAHZSB.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/cli/index.js.map +1 -1
  7. package/dist/common/index.d.ts +339 -10
  8. package/dist/common/index.js +33 -33
  9. package/dist/common/index.js.map +1 -1
  10. package/dist/esm/{Ed25519Account-8ETkcAk_.d.mts → Ed25519Account-CPwej6wB.d.mts} +1 -1
  11. package/dist/esm/account/AbstractKeylessAccount.d.mts +3 -3
  12. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  13. package/dist/esm/account/AbstractKeylessAccount.mjs.map +1 -1
  14. package/dist/esm/account/AbstractedAccount.d.mts +2 -2
  15. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  16. package/dist/esm/account/AbstractedAccount.mjs.map +1 -1
  17. package/dist/esm/account/Account.d.mts +2 -2
  18. package/dist/esm/account/Account.mjs +1 -1
  19. package/dist/esm/account/Account.mjs.map +1 -1
  20. package/dist/esm/account/AccountUtils.d.mts +3 -3
  21. package/dist/esm/account/AccountUtils.mjs +1 -1
  22. package/dist/esm/account/AccountUtils.mjs.map +1 -1
  23. package/dist/esm/account/DerivableAbstractedAccount.d.mts +2 -2
  24. package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
  25. package/dist/esm/account/DerivableAbstractedAccount.mjs.map +1 -1
  26. package/dist/esm/account/Ed25519Account.d.mts +2 -2
  27. package/dist/esm/account/Ed25519Account.mjs +1 -1
  28. package/dist/esm/account/Ed25519Account.mjs.map +1 -1
  29. package/dist/esm/account/EphemeralKeyPair.d.mts +1 -1
  30. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  31. package/dist/esm/account/EphemeralKeyPair.mjs.map +1 -1
  32. package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
  33. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  34. package/dist/esm/account/FederatedKeylessAccount.mjs.map +1 -1
  35. package/dist/esm/account/KeylessAccount.d.mts +3 -3
  36. package/dist/esm/account/KeylessAccount.mjs +1 -1
  37. package/dist/esm/account/KeylessAccount.mjs.map +1 -1
  38. package/dist/esm/account/MultiEd25519Account.d.mts +2 -2
  39. package/dist/esm/account/MultiEd25519Account.mjs +1 -1
  40. package/dist/esm/account/MultiEd25519Account.mjs.map +1 -1
  41. package/dist/esm/account/MultiKeyAccount.d.mts +3 -3
  42. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  43. package/dist/esm/account/MultiKeyAccount.mjs.map +1 -1
  44. package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
  45. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  46. package/dist/esm/account/SingleKeyAccount.mjs.map +1 -1
  47. package/dist/esm/account/index.d.mts +3 -3
  48. package/dist/esm/account/index.mjs +1 -1
  49. package/dist/esm/account/index.mjs.map +1 -1
  50. package/dist/esm/account/utils.d.mts +1 -1
  51. package/dist/esm/account/utils.mjs +1 -1
  52. package/dist/esm/account/utils.mjs.map +1 -1
  53. package/dist/esm/{account-ClxOwjdh.d.mts → account-BortO8g2.d.mts} +6 -1
  54. package/dist/esm/api/account/abstraction.d.mts +1 -1
  55. package/dist/esm/api/account/abstraction.mjs +1 -1
  56. package/dist/esm/api/account/abstraction.mjs.map +1 -1
  57. package/dist/esm/api/account.d.mts +30 -9
  58. package/dist/esm/api/account.mjs +1 -1
  59. package/dist/esm/api/account.mjs.map +1 -1
  60. package/dist/esm/api/ans.d.mts +2 -2
  61. package/dist/esm/api/ans.mjs +1 -1
  62. package/dist/esm/api/ans.mjs.map +1 -1
  63. package/dist/esm/api/aptos.d.mts +3 -3
  64. package/dist/esm/api/aptos.mjs +1 -1
  65. package/dist/esm/api/aptos.mjs.map +1 -1
  66. package/dist/esm/api/aptosConfig.d.mts +1 -1
  67. package/dist/esm/api/aptosConfig.mjs +1 -1
  68. package/dist/esm/api/aptosConfig.mjs.map +1 -1
  69. package/dist/esm/api/coin.d.mts +1 -1
  70. package/dist/esm/api/coin.mjs +1 -1
  71. package/dist/esm/api/coin.mjs.map +1 -1
  72. package/dist/esm/api/digitalAsset.d.mts +2 -2
  73. package/dist/esm/api/digitalAsset.mjs +1 -1
  74. package/dist/esm/api/digitalAsset.mjs.map +1 -1
  75. package/dist/esm/api/faucet.d.mts +1 -1
  76. package/dist/esm/api/faucet.mjs +1 -1
  77. package/dist/esm/api/faucet.mjs.map +1 -1
  78. package/dist/esm/api/fungibleAsset.d.mts +2 -2
  79. package/dist/esm/api/fungibleAsset.mjs +1 -1
  80. package/dist/esm/api/fungibleAsset.mjs.map +1 -1
  81. package/dist/esm/api/general.d.mts +1 -1
  82. package/dist/esm/api/general.mjs +1 -1
  83. package/dist/esm/api/general.mjs.map +1 -1
  84. package/dist/esm/api/index.d.mts +3 -3
  85. package/dist/esm/api/index.mjs +1 -1
  86. package/dist/esm/api/index.mjs.map +1 -1
  87. package/dist/esm/api/keyless.d.mts +3 -3
  88. package/dist/esm/api/keyless.mjs +1 -1
  89. package/dist/esm/api/keyless.mjs.map +1 -1
  90. package/dist/esm/api/object.d.mts +1 -1
  91. package/dist/esm/api/object.mjs +1 -1
  92. package/dist/esm/api/object.mjs.map +1 -1
  93. package/dist/esm/api/staking.d.mts +1 -1
  94. package/dist/esm/api/staking.mjs +1 -1
  95. package/dist/esm/api/staking.mjs.map +1 -1
  96. package/dist/esm/api/table.d.mts +1 -1
  97. package/dist/esm/api/table.mjs +1 -1
  98. package/dist/esm/api/table.mjs.map +1 -1
  99. package/dist/esm/api/transaction.d.mts +2 -2
  100. package/dist/esm/api/transaction.mjs +1 -1
  101. package/dist/esm/api/transaction.mjs.map +1 -1
  102. package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
  103. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  104. package/dist/esm/api/transactionSubmission/build.mjs.map +1 -1
  105. package/dist/esm/api/transactionSubmission/helpers.d.mts +1 -1
  106. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  107. package/dist/esm/api/transactionSubmission/helpers.mjs.map +1 -1
  108. package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
  109. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  110. package/dist/esm/api/transactionSubmission/management.mjs.map +1 -1
  111. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  112. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  113. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  114. package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
  115. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  116. package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -1
  117. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  118. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  119. package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -1
  120. package/dist/esm/api/utils.d.mts +1 -1
  121. package/dist/esm/api/utils.mjs +1 -1
  122. package/dist/esm/api/utils.mjs.map +1 -1
  123. package/dist/esm/bcs/consts.d.mts +1 -1
  124. package/dist/esm/bcs/consts.mjs +1 -1
  125. package/dist/esm/bcs/consts.mjs.map +1 -1
  126. package/dist/esm/bcs/deserializer.d.mts +1 -1
  127. package/dist/esm/bcs/deserializer.mjs +1 -1
  128. package/dist/esm/bcs/deserializer.mjs.map +1 -1
  129. package/dist/esm/bcs/index.d.mts +1 -1
  130. package/dist/esm/bcs/index.mjs +1 -1
  131. package/dist/esm/bcs/index.mjs.map +1 -1
  132. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
  133. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  134. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +1 -1
  135. package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
  136. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  137. package/dist/esm/bcs/serializable/fixedBytes.mjs.map +1 -1
  138. package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
  139. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  140. package/dist/esm/bcs/serializable/movePrimitives.mjs.map +1 -1
  141. package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
  142. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  143. package/dist/esm/bcs/serializable/moveStructs.mjs.map +1 -1
  144. package/dist/esm/bcs/serializer.d.mts +1 -1
  145. package/dist/esm/bcs/serializer.mjs +1 -1
  146. package/dist/esm/bcs/serializer.mjs.map +1 -1
  147. package/dist/esm/cli/index.d.mts +1 -1
  148. package/dist/esm/cli/index.mjs +1 -1
  149. package/dist/esm/cli/index.mjs.map +1 -1
  150. package/dist/esm/cli/localNode.mjs +1 -1
  151. package/dist/esm/cli/localNode.mjs.map +1 -1
  152. package/dist/esm/cli/move.d.mts +1 -1
  153. package/dist/esm/cli/move.mjs +1 -1
  154. package/dist/esm/cli/move.mjs.map +1 -1
  155. package/dist/esm/client/core.d.mts +1 -1
  156. package/dist/esm/client/core.mjs +1 -1
  157. package/dist/esm/client/core.mjs.map +1 -1
  158. package/dist/esm/client/get.d.mts +1 -1
  159. package/dist/esm/client/get.mjs +1 -1
  160. package/dist/esm/client/get.mjs.map +1 -1
  161. package/dist/esm/client/index.d.mts +1 -1
  162. package/dist/esm/client/index.mjs +1 -1
  163. package/dist/esm/client/index.mjs.map +1 -1
  164. package/dist/esm/client/post.d.mts +1 -1
  165. package/dist/esm/client/post.mjs +1 -1
  166. package/dist/esm/client/post.mjs.map +1 -1
  167. package/dist/esm/core/account/index.d.mts +2 -2
  168. package/dist/esm/core/account/index.mjs +1 -1
  169. package/dist/esm/core/account/index.mjs.map +1 -1
  170. package/dist/esm/core/account/utils/address.d.mts +13 -2
  171. package/dist/esm/core/account/utils/address.mjs +1 -1
  172. package/dist/esm/core/account/utils/address.mjs.map +1 -1
  173. package/dist/esm/core/account/utils/index.d.mts +2 -2
  174. package/dist/esm/core/account/utils/index.mjs +1 -1
  175. package/dist/esm/core/account/utils/index.mjs.map +1 -1
  176. package/dist/esm/core/accountAddress.d.mts +1 -1
  177. package/dist/esm/core/accountAddress.mjs +3 -1
  178. package/dist/esm/core/accountAddress.mjs.map +1 -1
  179. package/dist/esm/core/authenticationKey.d.mts +1 -1
  180. package/dist/esm/core/authenticationKey.mjs +1 -1
  181. package/dist/esm/core/authenticationKey.mjs.map +1 -1
  182. package/dist/esm/core/common.mjs +1 -1
  183. package/dist/esm/core/common.mjs.map +1 -1
  184. package/dist/esm/core/crypto/abstraction.d.mts +1 -1
  185. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  186. package/dist/esm/core/crypto/abstraction.mjs.map +1 -1
  187. package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
  188. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  189. package/dist/esm/core/crypto/deserializationUtils.mjs.map +1 -1
  190. package/dist/esm/core/crypto/ed25519.d.mts +1 -1
  191. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  192. package/dist/esm/core/crypto/ed25519.mjs.map +1 -1
  193. package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
  194. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  195. package/dist/esm/core/crypto/ephemeral.mjs.map +1 -1
  196. package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
  197. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  198. package/dist/esm/core/crypto/federatedKeyless.mjs.map +1 -1
  199. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  200. package/dist/esm/core/crypto/hdKey.mjs.map +1 -1
  201. package/dist/esm/core/crypto/index.d.mts +3 -2
  202. package/dist/esm/core/crypto/index.mjs +1 -1
  203. package/dist/esm/core/crypto/index.mjs.map +1 -1
  204. package/dist/esm/core/crypto/keyless.d.mts +2 -2
  205. package/dist/esm/core/crypto/keyless.mjs +1 -1
  206. package/dist/esm/core/crypto/keyless.mjs.map +1 -1
  207. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  208. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  209. package/dist/esm/core/crypto/multiEd25519.mjs.map +1 -1
  210. package/dist/esm/core/crypto/multiKey.d.mts +1 -1
  211. package/dist/esm/core/crypto/multiKey.mjs +3 -1
  212. package/dist/esm/core/crypto/multiKey.mjs.map +1 -1
  213. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  214. package/dist/esm/core/crypto/poseidon.mjs.map +1 -1
  215. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  216. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  217. package/dist/esm/core/crypto/privateKey.mjs.map +1 -1
  218. package/dist/esm/core/crypto/proof.d.mts +1 -1
  219. package/dist/esm/core/crypto/proof.mjs +1 -1
  220. package/dist/esm/core/crypto/proof.mjs.map +1 -1
  221. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  222. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  223. package/dist/esm/core/crypto/publicKey.mjs.map +1 -1
  224. package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
  225. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  226. package/dist/esm/core/crypto/secp256k1.mjs.map +1 -1
  227. package/dist/esm/core/crypto/secp256r1.d.mts +306 -0
  228. package/dist/esm/core/crypto/secp256r1.mjs +2 -0
  229. package/dist/esm/core/crypto/secp256r1.mjs.map +1 -0
  230. package/dist/esm/core/crypto/signature.d.mts +1 -1
  231. package/dist/esm/core/crypto/signature.mjs +1 -1
  232. package/dist/esm/core/crypto/signature.mjs.map +1 -1
  233. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  234. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  235. package/dist/esm/core/crypto/singleKey.mjs.map +1 -1
  236. package/dist/esm/core/crypto/types.d.mts +1 -1
  237. package/dist/esm/core/crypto/types.mjs +0 -1
  238. package/dist/esm/core/crypto/utils.d.mts +1 -1
  239. package/dist/esm/core/crypto/utils.mjs +1 -1
  240. package/dist/esm/core/crypto/utils.mjs.map +1 -1
  241. package/dist/esm/core/hex.d.mts +1 -1
  242. package/dist/esm/core/hex.mjs +1 -1
  243. package/dist/esm/core/hex.mjs.map +1 -1
  244. package/dist/esm/core/index.d.mts +4 -3
  245. package/dist/esm/core/index.mjs +1 -1
  246. package/dist/esm/core/index.mjs.map +1 -1
  247. package/dist/esm/errors/index.d.mts +1 -1
  248. package/dist/esm/errors/index.mjs +6 -1
  249. package/dist/esm/errors/index.mjs.map +1 -1
  250. package/dist/esm/{federatedKeyless-CUPEnP-W.d.mts → federatedKeyless-CTzDAQTu.d.mts} +1 -1
  251. package/dist/esm/index.d.mts +5 -4
  252. package/dist/esm/index.mjs +1 -1
  253. package/dist/esm/index.mjs.map +1 -1
  254. package/dist/esm/internal/abstraction.d.mts +1 -1
  255. package/dist/esm/internal/abstraction.mjs +1 -1
  256. package/dist/esm/internal/abstraction.mjs.map +1 -1
  257. package/dist/esm/internal/account.d.mts +21 -3
  258. package/dist/esm/internal/account.mjs +1 -1
  259. package/dist/esm/internal/account.mjs.map +1 -1
  260. package/dist/esm/internal/ans.d.mts +2 -2
  261. package/dist/esm/internal/ans.mjs +1 -1
  262. package/dist/esm/internal/ans.mjs.map +1 -1
  263. package/dist/esm/internal/coin.d.mts +1 -1
  264. package/dist/esm/internal/coin.mjs +1 -1
  265. package/dist/esm/internal/coin.mjs.map +1 -1
  266. package/dist/esm/internal/digitalAsset.d.mts +2 -2
  267. package/dist/esm/internal/digitalAsset.mjs +1 -1
  268. package/dist/esm/internal/digitalAsset.mjs.map +1 -1
  269. package/dist/esm/internal/faucet.d.mts +1 -1
  270. package/dist/esm/internal/faucet.mjs +1 -1
  271. package/dist/esm/internal/faucet.mjs.map +1 -1
  272. package/dist/esm/internal/fungibleAsset.d.mts +2 -2
  273. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  274. package/dist/esm/internal/fungibleAsset.mjs.map +1 -1
  275. package/dist/esm/internal/general.d.mts +1 -1
  276. package/dist/esm/internal/general.mjs +1 -1
  277. package/dist/esm/internal/general.mjs.map +1 -1
  278. package/dist/esm/internal/keyless.d.mts +3 -3
  279. package/dist/esm/internal/keyless.mjs +1 -1
  280. package/dist/esm/internal/keyless.mjs.map +1 -1
  281. package/dist/esm/internal/object.d.mts +1 -1
  282. package/dist/esm/internal/object.mjs +1 -1
  283. package/dist/esm/internal/object.mjs.map +1 -1
  284. package/dist/esm/internal/staking.d.mts +1 -1
  285. package/dist/esm/internal/staking.mjs +1 -1
  286. package/dist/esm/internal/staking.mjs.map +1 -1
  287. package/dist/esm/internal/table.d.mts +1 -1
  288. package/dist/esm/internal/table.mjs +1 -1
  289. package/dist/esm/internal/table.mjs.map +1 -1
  290. package/dist/esm/internal/transaction.d.mts +1 -1
  291. package/dist/esm/internal/transaction.mjs +1 -1
  292. package/dist/esm/internal/transaction.mjs.map +1 -1
  293. package/dist/esm/internal/transactionSubmission.d.mts +2 -2
  294. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  295. package/dist/esm/internal/transactionSubmission.mjs.map +1 -1
  296. package/dist/esm/internal/utils/index.d.mts +1 -1
  297. package/dist/esm/internal/utils/index.mjs +1 -1
  298. package/dist/esm/internal/utils/index.mjs.map +1 -1
  299. package/dist/esm/internal/utils/utils.d.mts +1 -1
  300. package/dist/esm/internal/utils/utils.mjs +1 -1
  301. package/dist/esm/internal/utils/utils.mjs.map +1 -1
  302. package/dist/esm/internal/view.d.mts +1 -1
  303. package/dist/esm/internal/view.mjs +1 -1
  304. package/dist/esm/internal/view.mjs.map +1 -1
  305. package/dist/esm/transactions/authenticator/account.d.mts +1 -1
  306. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  307. package/dist/esm/transactions/authenticator/account.mjs.map +1 -1
  308. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  309. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  310. package/dist/esm/transactions/authenticator/index.mjs.map +1 -1
  311. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  312. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  313. package/dist/esm/transactions/authenticator/transaction.mjs.map +1 -1
  314. package/dist/esm/transactions/index.d.mts +1 -1
  315. package/dist/esm/transactions/index.mjs +1 -1
  316. package/dist/esm/transactions/index.mjs.map +1 -1
  317. package/dist/esm/transactions/instances/chainId.d.mts +1 -1
  318. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  319. package/dist/esm/transactions/instances/chainId.mjs.map +1 -1
  320. package/dist/esm/transactions/instances/identifier.d.mts +1 -1
  321. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  322. package/dist/esm/transactions/instances/identifier.mjs.map +1 -1
  323. package/dist/esm/transactions/instances/index.d.mts +1 -1
  324. package/dist/esm/transactions/instances/index.mjs +1 -1
  325. package/dist/esm/transactions/instances/index.mjs.map +1 -1
  326. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  327. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  328. package/dist/esm/transactions/instances/moduleId.mjs.map +1 -1
  329. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
  330. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  331. package/dist/esm/transactions/instances/multiAgentTransaction.mjs.map +1 -1
  332. package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
  333. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  334. package/dist/esm/transactions/instances/rawTransaction.mjs.map +1 -1
  335. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  336. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  337. package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +1 -1
  338. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  339. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  340. package/dist/esm/transactions/instances/signedTransaction.mjs.map +1 -1
  341. package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
  342. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  343. package/dist/esm/transactions/instances/simpleTransaction.mjs.map +1 -1
  344. package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
  345. package/dist/esm/transactions/instances/transactionArgument.mjs +0 -1
  346. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  347. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  348. package/dist/esm/transactions/instances/transactionPayload.mjs.map +1 -1
  349. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
  350. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  351. package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +1 -1
  352. package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
  353. package/dist/esm/transactions/management/asyncQueue.mjs.map +1 -1
  354. package/dist/esm/transactions/management/index.d.mts +2 -2
  355. package/dist/esm/transactions/management/index.mjs +1 -1
  356. package/dist/esm/transactions/management/index.mjs.map +1 -1
  357. package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
  358. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  359. package/dist/esm/transactions/management/transactionWorker.mjs.map +1 -1
  360. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
  361. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  362. package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +1 -1
  363. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
  364. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  365. package/dist/esm/transactions/transactionBuilder/index.mjs.map +1 -1
  366. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -1
  367. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  368. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +1 -1
  369. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
  370. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  371. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -1
  372. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
  373. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  374. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +1 -1
  375. package/dist/esm/transactions/typeTag/index.d.mts +1 -1
  376. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  377. package/dist/esm/transactions/typeTag/index.mjs.map +1 -1
  378. package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
  379. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  380. package/dist/esm/transactions/typeTag/parser.mjs.map +1 -1
  381. package/dist/esm/transactions/types.d.mts +1 -1
  382. package/dist/esm/transactions/types.mjs +0 -1
  383. package/dist/esm/types/abstraction.mjs +1 -1
  384. package/dist/esm/types/abstraction.mjs.map +1 -1
  385. package/dist/esm/types/generated/queries.mjs +493 -1
  386. package/dist/esm/types/generated/queries.mjs.map +1 -1
  387. package/dist/esm/types/generated/types.mjs +1 -1
  388. package/dist/esm/types/generated/types.mjs.map +1 -1
  389. package/dist/esm/types/index.d.mts +1 -1
  390. package/dist/esm/types/index.mjs +1 -1
  391. package/dist/esm/types/index.mjs.map +1 -1
  392. package/dist/esm/types/indexer.mjs +0 -1
  393. package/dist/esm/types/types.d.mts +1 -1
  394. package/dist/esm/types/types.mjs +1 -1
  395. package/dist/esm/types/types.mjs.map +1 -1
  396. package/dist/esm/utils/apiEndpoints.d.mts +1 -0
  397. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  398. package/dist/esm/utils/apiEndpoints.mjs.map +1 -1
  399. package/dist/esm/utils/const.mjs +1 -1
  400. package/dist/esm/utils/const.mjs.map +1 -1
  401. package/dist/esm/utils/helpers.d.mts +1 -1
  402. package/dist/esm/utils/helpers.mjs +1 -1
  403. package/dist/esm/utils/helpers.mjs.map +1 -1
  404. package/dist/esm/utils/index.d.mts +1 -1
  405. package/dist/esm/utils/index.mjs +1 -1
  406. package/dist/esm/utils/index.mjs.map +1 -1
  407. package/dist/esm/utils/memoize.mjs +1 -1
  408. package/dist/esm/utils/memoize.mjs.map +1 -1
  409. package/dist/esm/utils/normalizeBundle.d.mts +1 -1
  410. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  411. package/dist/esm/utils/normalizeBundle.mjs.map +1 -1
  412. package/dist/esm/version.d.mts +1 -1
  413. package/dist/esm/version.mjs +1 -1
  414. package/dist/esm/version.mjs.map +1 -1
  415. package/package.json +40 -22
  416. package/src/api/account.ts +32 -7
  417. package/src/api/aptos.ts +25 -14
  418. package/src/core/account/utils/address.ts +22 -0
  419. package/src/core/crypto/index.ts +1 -0
  420. package/src/core/crypto/privateKey.ts +1 -0
  421. package/src/core/crypto/secp256k1.ts +9 -1
  422. package/src/core/crypto/secp256r1.ts +495 -0
  423. package/src/core/crypto/singleKey.ts +11 -0
  424. package/src/internal/account.ts +33 -0
  425. package/src/internal/ans.ts +1 -0
  426. package/src/types/types.ts +5 -0
  427. package/src/utils/apiEndpoints.ts +7 -0
  428. package/src/version.ts +1 -1
  429. package/dist/common/chunk-6MMUUJHX.js +0 -4
  430. package/dist/esm/chunk-35DKMW7Q.mjs +0 -2
  431. package/dist/esm/chunk-35DKMW7Q.mjs.map +0 -1
  432. package/dist/esm/chunk-4QMXOWHP.mjs +0 -1
  433. package/dist/esm/chunk-4QMXOWHP.mjs.map +0 -1
  434. package/dist/esm/chunk-4RXKALLC.mjs +0 -2
  435. package/dist/esm/chunk-4RXKALLC.mjs.map +0 -1
  436. package/dist/esm/chunk-4WPQQPUF.mjs +0 -1
  437. package/dist/esm/chunk-4WPQQPUF.mjs.map +0 -1
  438. package/dist/esm/chunk-56CNRT2K.mjs +0 -2
  439. package/dist/esm/chunk-56CNRT2K.mjs.map +0 -1
  440. package/dist/esm/chunk-5FI4545P.mjs +0 -2
  441. package/dist/esm/chunk-5FI4545P.mjs.map +0 -1
  442. package/dist/esm/chunk-5HXLZHDW.mjs +0 -1
  443. package/dist/esm/chunk-5HXLZHDW.mjs.map +0 -1
  444. package/dist/esm/chunk-6WDVDEQZ.mjs +0 -7
  445. package/dist/esm/chunk-6WDVDEQZ.mjs.map +0 -1
  446. package/dist/esm/chunk-7DQDJ2SA.mjs +0 -2
  447. package/dist/esm/chunk-7DQDJ2SA.mjs.map +0 -1
  448. package/dist/esm/chunk-7ECCT6PK.mjs +0 -1
  449. package/dist/esm/chunk-7ECCT6PK.mjs.map +0 -1
  450. package/dist/esm/chunk-A5L76YP7.mjs +0 -2
  451. package/dist/esm/chunk-A5L76YP7.mjs.map +0 -1
  452. package/dist/esm/chunk-B563XRSZ.mjs +0 -2
  453. package/dist/esm/chunk-B563XRSZ.mjs.map +0 -1
  454. package/dist/esm/chunk-C3Q23D22.mjs +0 -2
  455. package/dist/esm/chunk-C3Q23D22.mjs.map +0 -1
  456. package/dist/esm/chunk-CW35YAMN.mjs +0 -2
  457. package/dist/esm/chunk-CW35YAMN.mjs.map +0 -1
  458. package/dist/esm/chunk-DIGP2ALY.mjs +0 -4
  459. package/dist/esm/chunk-DIGP2ALY.mjs.map +0 -1
  460. package/dist/esm/chunk-DNRUDMMV.mjs +0 -2
  461. package/dist/esm/chunk-DNRUDMMV.mjs.map +0 -1
  462. package/dist/esm/chunk-EBMEXURY.mjs +0 -2
  463. package/dist/esm/chunk-EBMEXURY.mjs.map +0 -1
  464. package/dist/esm/chunk-EM52Z7T7.mjs +0 -2
  465. package/dist/esm/chunk-EM52Z7T7.mjs.map +0 -1
  466. package/dist/esm/chunk-ES2KP6BS.mjs +0 -2
  467. package/dist/esm/chunk-ES2KP6BS.mjs.map +0 -1
  468. package/dist/esm/chunk-FD6FGKYY.mjs +0 -1
  469. package/dist/esm/chunk-FD6FGKYY.mjs.map +0 -1
  470. package/dist/esm/chunk-FGFLPH5K.mjs +0 -2
  471. package/dist/esm/chunk-FGFLPH5K.mjs.map +0 -1
  472. package/dist/esm/chunk-FLZPUYXQ.mjs +0 -2
  473. package/dist/esm/chunk-FLZPUYXQ.mjs.map +0 -1
  474. package/dist/esm/chunk-FZY4PMEE.mjs +0 -1
  475. package/dist/esm/chunk-FZY4PMEE.mjs.map +0 -1
  476. package/dist/esm/chunk-G3MHXDYA.mjs +0 -1
  477. package/dist/esm/chunk-G3MHXDYA.mjs.map +0 -1
  478. package/dist/esm/chunk-GFFKEZ56.mjs +0 -2
  479. package/dist/esm/chunk-GFFKEZ56.mjs.map +0 -1
  480. package/dist/esm/chunk-GMQCQDW4.mjs +0 -2
  481. package/dist/esm/chunk-GMQCQDW4.mjs.map +0 -1
  482. package/dist/esm/chunk-GOXRBEIJ.mjs +0 -2
  483. package/dist/esm/chunk-GOXRBEIJ.mjs.map +0 -1
  484. package/dist/esm/chunk-HGLO5LDS.mjs +0 -1
  485. package/dist/esm/chunk-HGLO5LDS.mjs.map +0 -1
  486. package/dist/esm/chunk-HNBKTJPN.mjs +0 -2
  487. package/dist/esm/chunk-HNBKTJPN.mjs.map +0 -1
  488. package/dist/esm/chunk-HNBVYE3N.mjs +0 -2
  489. package/dist/esm/chunk-HNBVYE3N.mjs.map +0 -1
  490. package/dist/esm/chunk-IF4UU2MT.mjs +0 -2
  491. package/dist/esm/chunk-IF4UU2MT.mjs.map +0 -1
  492. package/dist/esm/chunk-IJE2LVZG.mjs +0 -2
  493. package/dist/esm/chunk-IJE2LVZG.mjs.map +0 -1
  494. package/dist/esm/chunk-KDMSOCZY.mjs +0 -2
  495. package/dist/esm/chunk-KDMSOCZY.mjs.map +0 -1
  496. package/dist/esm/chunk-LWL57YFU.mjs +0 -2
  497. package/dist/esm/chunk-LWL57YFU.mjs.map +0 -1
  498. package/dist/esm/chunk-MT2RJ7H3.mjs +0 -2
  499. package/dist/esm/chunk-MT2RJ7H3.mjs.map +0 -1
  500. package/dist/esm/chunk-N3O3ULF7.mjs +0 -2
  501. package/dist/esm/chunk-N3O3ULF7.mjs.map +0 -1
  502. package/dist/esm/chunk-N6YTF76Q.mjs +0 -2
  503. package/dist/esm/chunk-N6YTF76Q.mjs.map +0 -1
  504. package/dist/esm/chunk-NECL5FCQ.mjs +0 -1
  505. package/dist/esm/chunk-NECL5FCQ.mjs.map +0 -1
  506. package/dist/esm/chunk-OLILO7VD.mjs +0 -2
  507. package/dist/esm/chunk-OLILO7VD.mjs.map +0 -1
  508. package/dist/esm/chunk-ORMOQWWH.mjs +0 -2
  509. package/dist/esm/chunk-ORMOQWWH.mjs.map +0 -1
  510. package/dist/esm/chunk-Q4W3WJ2U.mjs +0 -2
  511. package/dist/esm/chunk-Q4W3WJ2U.mjs.map +0 -1
  512. package/dist/esm/chunk-QREVMGQZ.mjs +0 -2
  513. package/dist/esm/chunk-QREVMGQZ.mjs.map +0 -1
  514. package/dist/esm/chunk-RCSJFTST.mjs +0 -2
  515. package/dist/esm/chunk-RCSJFTST.mjs.map +0 -1
  516. package/dist/esm/chunk-RGKRCZ36.mjs +0 -4
  517. package/dist/esm/chunk-RGKRCZ36.mjs.map +0 -1
  518. package/dist/esm/chunk-ROT6S6BM.mjs +0 -2
  519. package/dist/esm/chunk-ROT6S6BM.mjs.map +0 -1
  520. package/dist/esm/chunk-RQX6JOEN.mjs +0 -2
  521. package/dist/esm/chunk-RQX6JOEN.mjs.map +0 -1
  522. package/dist/esm/chunk-STY74NUA.mjs +0 -2
  523. package/dist/esm/chunk-STY74NUA.mjs.map +0 -1
  524. package/dist/esm/chunk-TGRLDWXV.mjs +0 -2
  525. package/dist/esm/chunk-TGRLDWXV.mjs.map +0 -1
  526. package/dist/esm/chunk-TOBQ5UE6.mjs +0 -2
  527. package/dist/esm/chunk-TOBQ5UE6.mjs.map +0 -1
  528. package/dist/esm/chunk-UL777LTI.mjs +0 -494
  529. package/dist/esm/chunk-UL777LTI.mjs.map +0 -1
  530. package/dist/esm/chunk-UYVPNUH3.mjs +0 -1
  531. package/dist/esm/chunk-UYVPNUH3.mjs.map +0 -1
  532. package/dist/esm/chunk-V3MBJJTL.mjs +0 -1
  533. package/dist/esm/chunk-V3MBJJTL.mjs.map +0 -1
  534. package/dist/esm/chunk-V74WPKSY.mjs +0 -2
  535. package/dist/esm/chunk-V74WPKSY.mjs.map +0 -1
  536. package/dist/esm/chunk-WCMW2L3P.mjs +0 -2
  537. package/dist/esm/chunk-WCMW2L3P.mjs.map +0 -1
  538. package/dist/esm/chunk-WSR5EBJM.mjs +0 -2
  539. package/dist/esm/chunk-WSR5EBJM.mjs.map +0 -1
  540. package/dist/esm/chunk-XJJVJOX5.mjs +0 -2
  541. package/dist/esm/chunk-XJJVJOX5.mjs.map +0 -1
  542. package/dist/esm/chunk-XKUIMGKU.mjs +0 -2
  543. package/dist/esm/chunk-XKUIMGKU.mjs.map +0 -1
  544. package/dist/esm/chunk-YOZBVVKL.mjs +0 -2
  545. package/dist/esm/chunk-YOZBVVKL.mjs.map +0 -1
  546. package/dist/esm/chunk-ZP4DWSQA.mjs +0 -2
  547. package/dist/esm/chunk-ZP4DWSQA.mjs.map +0 -1
@@ -0,0 +1,306 @@
1
+ import { C as PublicKey, bp as HexInput, K as Signature, z as VerifySignatureAsyncArgs, b as Serializer, a as Deserializer, p as AuthenticationKey, P as PrivateKey, R as Hex } from '../../account-BortO8g2.mjs';
2
+ import '../../types/indexer.mjs';
3
+ import '../../types/generated/operations.mjs';
4
+ import '../../types/generated/types.mjs';
5
+ import '../../utils/apiEndpoints.mjs';
6
+ import '../../utils/const.mjs';
7
+ import '../common.mjs';
8
+
9
+ /**
10
+ * Represents a Secp256r1 ECDSA public key.
11
+ *
12
+ * @extends PublicKey
13
+ * @property LENGTH - The length of the Secp256r1 public key in bytes.
14
+ * @group Implementation
15
+ * @category Serialization
16
+ */
17
+ declare class Secp256r1PublicKey extends PublicKey {
18
+ static readonly LENGTH: number;
19
+ static readonly COMPRESSED_LENGTH: number;
20
+ private readonly key;
21
+ readonly keyType: string;
22
+ /**
23
+ * Create a new PublicKey instance from a HexInput, which can be a string or Uint8Array.
24
+ * This constructor validates the length of the provided public key data.
25
+ *
26
+ * @param hexInput - A HexInput (string or Uint8Array) representing the public key data.
27
+ * @throws Error if the length of the public key data is not equal to Secp256r1PublicKey.LENGTH or COMPRESSED_LENGTH.
28
+ * @group Implementation
29
+ * @category Serialization
30
+ */
31
+ constructor(hexInput: HexInput);
32
+ /**
33
+ * Get the data as a Uint8Array representation.
34
+ *
35
+ * @returns Uint8Array representation of the data.
36
+ * @group Implementation
37
+ * @category Serialization
38
+ */
39
+ toUint8Array(): Uint8Array;
40
+ /**
41
+ * Get the public key as a hex string with the 0x prefix.
42
+ *
43
+ * @returns string representation of the public key.
44
+ * @group Implementation
45
+ * @category Serialization
46
+ */
47
+ toString(): string;
48
+ /**
49
+ * Converts the public key to BCS (Binary Canonical Serialization) bytes.
50
+ * This function serializes the public key data into a byte array format suitable for transmission or storage.
51
+ *
52
+ * @returns Uint8Array representation of the serialized public key.
53
+ * @group Implementation
54
+ * @category Serialization
55
+ */
56
+ bcsToBytes(): Uint8Array<ArrayBufferLike>;
57
+ /**
58
+ * Verifies a Secp256r1 signature against the public key.
59
+ *
60
+ * This function checks the validity of a signature for a given message.
61
+ *
62
+ * @param args - The arguments for verifying the signature.
63
+ * @param args.message - The message that was signed.
64
+ * @param args.signature - The signature to verify against the public key.
65
+ * @group Implementation
66
+ * @category Serialization
67
+ */
68
+ verifySignature(args: {
69
+ message: HexInput;
70
+ signature: Signature;
71
+ }): boolean;
72
+ /**
73
+ * Note: Secp256r1Signatures can be verified synchronously.
74
+ *
75
+ * Verifies the provided signature against the given message.
76
+ * This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.
77
+ *
78
+ * @param args - The arguments for signature verification.
79
+ * @param args.message - The message that was signed.
80
+ * @param args.signature - The signature to verify, which must be an instance of Secp256r1Signature.
81
+ * @returns A boolean indicating whether the signature is valid for the given message.
82
+ * @group Implementation
83
+ * @category Serialization
84
+ */
85
+ verifySignatureAsync(args: VerifySignatureAsyncArgs): Promise<boolean>;
86
+ /**
87
+ * Serializes the data into a byte array using the provided serializer.
88
+ * This function is essential for converting data into a format suitable for transmission or storage.
89
+ *
90
+ * @param serializer - The serializer instance used to convert the data.
91
+ * @group Implementation
92
+ * @category Serialization
93
+ */
94
+ serialize(serializer: Serializer): void;
95
+ /**
96
+ * Deserializes a Secp256r1PublicKey from the provided deserializer.
97
+ * This function allows you to reconstruct a Secp256r1PublicKey object from its serialized byte representation.
98
+ *
99
+ * @param deserializer - The deserializer instance used to read the serialized data.
100
+ * @group Implementation
101
+ * @category Serialization
102
+ */
103
+ static deserialize(deserializer: Deserializer): Secp256r1PublicKey;
104
+ /**
105
+ * Loads a Secp256r1PublicKey from the provided deserializer.
106
+ *
107
+ * @param deserializer - The deserializer instance used to read the serialized data.
108
+ * @group Implementation
109
+ * @category Serialization
110
+ */
111
+ static load(deserializer: Deserializer): Secp256r1PublicKey;
112
+ /**
113
+ * Determines if the provided public key is a valid instance of a Secp256r1 public key.
114
+ * This function checks for the presence of a "key" property and validates the length of the key data.
115
+ *
116
+ * @param publicKey - The public key to validate.
117
+ * @returns A boolean indicating whether the public key is a valid Secp256r1 public key.
118
+ * @group Implementation
119
+ * @category Serialization
120
+ */
121
+ static isInstance(publicKey: PublicKey): publicKey is Secp256r1PublicKey;
122
+ /**
123
+ * Generates an authentication key from the public key using the Secp256r1 scheme.
124
+ * This function is essential for creating a secure authentication key that can be used for further cryptographic operations.
125
+ *
126
+ * @returns {AuthenticationKey} The generated authentication key.
127
+ * @group Implementation
128
+ * @category Serialization
129
+ */
130
+ authKey(): AuthenticationKey;
131
+ }
132
+ /**
133
+ * Represents a Secp256r1 ECDSA private key, providing functionality to create, sign messages,
134
+ * derive public keys, and serialize/deserialize the key.
135
+ * @group Implementation
136
+ * @category Serialization
137
+ */
138
+ declare class Secp256r1PrivateKey extends PrivateKey {
139
+ /**
140
+ * Length of Secp256r1 ecdsa private key
141
+ * @group Implementation
142
+ * @category Serialization
143
+ */
144
+ static readonly LENGTH: number;
145
+ /**
146
+ * The private key bytes
147
+ * @private
148
+ * @group Implementation
149
+ * @category Serialization
150
+ */
151
+ private readonly key;
152
+ /**
153
+ * Create a new PrivateKey instance from a Uint8Array or String.
154
+ *
155
+ * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)
156
+ *
157
+ * @param hexInput A HexInput (string or Uint8Array)
158
+ * @param strict If true, private key must AIP-80 compliant.
159
+ * @group Implementation
160
+ * @category Serialization
161
+ */
162
+ constructor(hexInput: HexInput, strict?: boolean);
163
+ /**
164
+ * Get the private key in bytes (Uint8Array).
165
+ *
166
+ * @returns
167
+ * @group Implementation
168
+ * @category Serialization
169
+ */
170
+ toUint8Array(): Uint8Array;
171
+ /**
172
+ * Get the private key as a string representation.
173
+ *
174
+ * @returns string representation of the private key
175
+ * @group Implementation
176
+ * @category Serialization
177
+ */
178
+ toString(): string;
179
+ /**
180
+ * Get the private key as a hex string with the 0x prefix.
181
+ *
182
+ * @returns string representation of the private key.
183
+ */
184
+ toHexString(): string;
185
+ /**
186
+ * Sign the given message with the private key.
187
+ * This function generates a cryptographic signature for the provided message.
188
+ *
189
+ * @param message - A message in HexInput format to be signed.
190
+ * @returns Signature - The generated signature for the provided message.
191
+ * @group Implementation
192
+ * @category Serialization
193
+ */
194
+ sign(message: HexInput): Secp256r1Signature;
195
+ /**
196
+ * Serializes the data into a byte array using the provided serializer.
197
+ * This function is essential for converting data into a format suitable for transmission or storage.
198
+ *
199
+ * @param serializer - The serializer instance used to convert the data.
200
+ * @group Implementation
201
+ * @category Serialization
202
+ */
203
+ serialize(serializer: Serializer): void;
204
+ /**
205
+ * Deserializes a Secp256r1PrivateKey from the provided deserializer.
206
+ * This function allows you to reconstruct a Secp256r1PrivateKey object from its serialized byte representation.
207
+ *
208
+ * @param deserializer - The deserializer instance used to read the serialized data.
209
+ * @group Implementation
210
+ * @category Serialization
211
+ */
212
+ static deserialize(deserializer: Deserializer): Secp256r1PrivateKey;
213
+ /**
214
+ * Generate a new random private key.
215
+ *
216
+ * @returns Secp256r1PrivateKey - A newly generated Secp256r1 private key.
217
+ * @group Implementation
218
+ * @category Serialization
219
+ */
220
+ static generate(): Secp256r1PrivateKey;
221
+ /**
222
+ * Derive the Secp256r1PublicKey from this private key.
223
+ *
224
+ * @returns Secp256r1PublicKey The derived public key.
225
+ * @group Implementation
226
+ * @category Serialization
227
+ */
228
+ publicKey(): Secp256r1PublicKey;
229
+ }
230
+ declare class WebAuthnSignature extends Signature {
231
+ signature: Hex;
232
+ authenticatorData: Hex;
233
+ clientDataJSON: Hex;
234
+ constructor(signature: HexInput, authenticatorData: HexInput, clientDataJSON: HexInput);
235
+ toUint8Array(): Uint8Array<ArrayBufferLike>;
236
+ serialize(serializer: Serializer): void;
237
+ bcsToBytes(): Uint8Array<ArrayBufferLike>;
238
+ bcsToHex(): Hex;
239
+ toStringWithoutPrefix(): string;
240
+ static deserialize(deserializer: Deserializer): WebAuthnSignature;
241
+ }
242
+ /**
243
+ * Represents a signature of a message signed using a Secp256r1 ECDSA private key.
244
+ *
245
+ * @group Implementation
246
+ * @category Serialization
247
+ */
248
+ declare class Secp256r1Signature extends Signature {
249
+ /**
250
+ * Secp256r1 ecdsa signatures are 256-bit.
251
+ * @group Implementation
252
+ * @category Serialization
253
+ */
254
+ static readonly LENGTH = 64;
255
+ /**
256
+ * The signature bytes
257
+ * @private
258
+ * @group Implementation
259
+ * @category Serialization
260
+ */
261
+ private readonly data;
262
+ /**
263
+ * Create a new Signature instance from a Uint8Array or String.
264
+ *
265
+ * @param hexInput A HexInput (string or Uint8Array)
266
+ * @group Implementation
267
+ * @category Serialization
268
+ */
269
+ constructor(hexInput: HexInput);
270
+ /**
271
+ * Get the signature in bytes (Uint8Array).
272
+ *
273
+ * @returns Uint8Array representation of the signature
274
+ * @group Implementation
275
+ * @category Serialization
276
+ */
277
+ toUint8Array(): Uint8Array;
278
+ /**
279
+ * Get the signature as a hex string with the 0x prefix.
280
+ *
281
+ * @returns string representation of the signature
282
+ * @group Implementation
283
+ * @category Serialization
284
+ */
285
+ toString(): string;
286
+ /**
287
+ * Serializes the data into a byte array using the provided serializer.
288
+ * This function is essential for converting data into a format suitable for transmission or storage.
289
+ *
290
+ * @param serializer - The serializer instance used to convert the data.
291
+ * @group Implementation
292
+ * @category Serialization
293
+ */
294
+ serialize(serializer: Serializer): void;
295
+ /**
296
+ * Deserializes a Secp256r1Signature from the provided deserializer.
297
+ * This function allows you to reconstruct a Secp256r1Signature object from its serialized byte representation.
298
+ *
299
+ * @param deserializer - The deserializer instance used to read the serialized data.
300
+ * @group Implementation
301
+ * @category Serialization
302
+ */
303
+ static deserialize(deserializer: Deserializer): Secp256r1Signature;
304
+ }
305
+
306
+ export { Secp256r1PrivateKey, Secp256r1PublicKey, Secp256r1Signature, WebAuthnSignature };
@@ -0,0 +1,2 @@
1
+ import{sha3_256 as p}from"@noble/hashes/sha3";import{p256 as o}from"@noble/curves/nist.js";import{Serializer as c}from"../../bcs";import{Hex as s}from"../hex";import{PrivateKeyVariants as m,SigningScheme as f,AnyPublicKeyVariant as U}from"../../types";import{PublicKey as z}from"./publicKey";import{PrivateKey as l}from"./privateKey";import{Signature as x}from"./signature";import{AuthenticationKey as b}from"../authenticationKey";const n=class n extends z{constructor(e){super();this.keyType="secp256r1";const r=s.fromHexInput(e),i=r.toUint8Array().length;if(i!==n.LENGTH&&i!==n.COMPRESSED_LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH} or ${n.COMPRESSED_LENGTH}, received ${i}`);if(i===n.COMPRESSED_LENGTH){const u=o.ProjectivePoint.fromHex(r.toUint8Array());this.key=s.fromHexInput(u.toRawBytes(!1))}else this.key=r}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}bcsToBytes(){const e=new c;return this.serialize(e),e.toUint8Array()}verifySignature(e){const{message:r,signature:i}=e,u=s.fromHexInput(r).toUint8Array(),A=p(u),d=i.toUint8Array();return o.verify(d,A,this.toUint8Array())}async verifySignatureAsync(e){return this.verifySignature({message:e.message,signature:e.signature})}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){const r=e.deserializeBytes();return new n(r)}static load(e){const r=e.deserializeBytes();return new n(r)}static isInstance(e){return"key"in e&&e.key?.data?.length===n.LENGTH&&"keyType"in e&&e.keyType==="secp256r1"}authKey(){const e=new c;return e.serializeU32AsUleb128(U.Secp256r1),e.serializeFixedBytes(this.bcsToBytes()),b.fromSchemeAndBytes({scheme:f.SingleKey,input:e.toUint8Array()})}};n.LENGTH=65,n.COMPRESSED_LENGTH=33;let h=n;const a=class a extends l{constructor(t,e){super();const r=l.parseHexInput(t,m.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(),m.Secp256r1)}toHexString(){return this.key.toString()}sign(t){const e=s.fromHexInput(t),r=p(e.toUint8Array()),i=o.sign(r,this.key.toUint8Array());return new g(i.toCompactRawBytes())}serialize(t){t.serializeBytes(this.toUint8Array())}static deserialize(t){const e=t.deserializeBytes();return new a(e)}static generate(){const t=o.utils.randomPrivateKey();return new a(t)}publicKey(){const t=o.getPublicKey(this.key.toUint8Array(),!1);return new h(t)}};a.LENGTH=32;let H=a;class S extends x{constructor(t,e,r){super(),this.signature=s.fromHexInput(t),this.authenticatorData=s.fromHexInput(e),this.clientDataJSON=s.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(){const t=new c;return this.serialize(t),t.toUint8Array()}bcsToHex(){return s.fromHexInput(this.bcsToBytes())}toStringWithoutPrefix(){return s.fromHexInput(this.bcsToBytes()).toString()}static deserialize(t){const e=t.deserializeUleb128AsU32();if(e!==0)throw new Error(`Invalid id for WebAuthnSignature: ${e}`);const r=t.deserializeBytes(),i=t.deserializeBytes(),u=t.deserializeBytes();return new S(r,i,u)}}const y=class y extends x{constructor(t){super();const e=s.fromHexInput(t),r=e.toUint8Array().length;if(r!==y.LENGTH)throw new Error(`Signature length should be ${y.LENGTH}, received ${r}`);const i=o.Signature.fromCompact(e.toUint8Array()).normalizeS().toCompactRawBytes();this.data=s.fromHexInput(i)}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(t){t.serializeBytes(this.data.toUint8Array())}static deserialize(t){const e=t.deserializeBytes();return new y(e)}};y.LENGTH=64;let g=y;export{H as Secp256r1PrivateKey,h as Secp256r1PublicKey,g as Secp256r1Signature,S as WebAuthnSignature};
2
+ //# sourceMappingURL=secp256r1.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":"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","names":["sha3_256","p256","Serializer","Hex","PrivateKeyVariants","AuthenticationKeyScheme","AnyPublicKeyVariant","PublicKey","PrivateKey","Signature","AuthenticationKey","_Secp256r1PublicKey","hexInput","hex","keyLength","point","serializer","args","message","signature","msgHex","sha3Message","rawSignature","deserializer","bytes","publicKey","Secp256r1PublicKey","_Secp256r1PrivateKey","strict","privateKeyHex","Secp256r1Signature","Secp256r1PrivateKey","WebAuthnSignature","authenticatorData","clientDataJSON","id","_Secp256r1Signature","signatureLength"]}
@@ -1,4 +1,4 @@
1
- export { K as Signature } from '../../account-ClxOwjdh.mjs';
1
+ export { K as Signature } 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}from"../../chunk-WCMW2L3P.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-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 Signature};
1
+ import{Serializable as r}from"../../bcs";import{Hex as i}from"../hex";class s extends r{toUint8Array(){return this.bcsToBytes()}toString(){const t=this.toUint8Array();return i.fromHexInput(t).toString()}}export{s as Signature};
2
2
  //# sourceMappingURL=signature.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/crypto/signature.ts"],"sourcesContent":["import { Serializable } from \"../../bcs\";\nimport { Hex } from \"../hex\";\n\n/**\n * An abstract representation of a crypto signature,\n * associated with a specific signature scheme, e.g., Ed25519 or Secp256k1.\n *\n * This class represents the product of signing a message directly from a\n * PrivateKey and can be verified against a CryptoPublicKey.\n * @group Implementation\n * @category Serialization\n */\nexport abstract class Signature extends Serializable {\n /**\n * Get the raw signature bytes\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n /**\n * Get the signature as a hex string with a 0x prefix e.g. 0x123456...\n * @returns The hex string representation of the signature.\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n const bytes = this.toUint8Array();\n return Hex.fromHexInput(bytes).toString();\n }\n}\n\n/**\n * An abstract representation of an account signature,\n * associated to a specific authentication scheme e.g. Ed25519 or SingleKey\n *\n * This is the product of signing a message through an account,\n * and can be verified against an AccountPublicKey.\n * @group Implementation\n * @category Serialization\n */\n// export abstract class AccountSignature extends Serializable {\n// /**\n// * Get the raw signature bytes\n// */\n// abstract toUint8Array(): Uint8Array;\n//\n// /**\n// * Get the signature as a hex string with a 0x prefix e.g. 0x123456...\n// */\n// toString(): string {\n// const bytes = this.toUint8Array();\n// return Hex.fromHexInput(bytes).toString();\n// }\n// }\n"],"mappings":"AAAA,OAAS,gBAAAA,MAAoB,YAC7B,OAAS,OAAAC,MAAW,SAWb,MAAeC,UAAkBF,CAAa,CAMnD,cAA2B,CACzB,OAAO,KAAK,WAAW,CACzB,CAQA,UAAmB,CACjB,MAAMG,EAAQ,KAAK,aAAa,EAChC,OAAOF,EAAI,aAAaE,CAAK,EAAE,SAAS,CAC1C,CACF","names":["Serializable","Hex","Signature","bytes"]}
@@ -1,4 +1,4 @@
1
- export { N as AnyPublicKey, O as AnySignature, L as PrivateKeyInput } from '../../account-ClxOwjdh.mjs';
1
+ export { N as AnyPublicKey, O as AnySignature, L as PrivateKeyInput } 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{F as a,G as b}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 AnyPublicKey,b as AnySignature};
1
+ import{AnyPublicKeyVariant as t,AnySignatureVariant as r,SigningScheme as g}from"../../types";import{AuthenticationKey as K}from"../authenticationKey";import{Ed25519PublicKey as a,Ed25519Signature as l}from"./ed25519";import{AccountPublicKey as S}from"./publicKey";import{Secp256k1PublicKey as s,Secp256k1Signature as y}from"./secp256k1";import{KeylessPublicKey as o,KeylessSignature as p}from"./keyless";import{Signature as A}from"./signature";import{FederatedKeylessPublicKey as b}from"./federatedKeyless";import{Secp256r1PublicKey as f,WebAuthnSignature as h}from"./secp256r1";class u extends S{constructor(e){if(super(),this.publicKey=e,e instanceof a)this.variant=t.Ed25519;else if(e instanceof s)this.variant=t.Secp256k1;else if(e instanceof f)this.variant=t.Secp256r1;else if(e instanceof o)this.variant=t.Keyless;else if(e instanceof b)this.variant=t.FederatedKeyless;else throw new Error("Unsupported public key type")}verifySignature(e){const{message:n,signature:i}=e;if(this.publicKey instanceof o)throw new Error("Use verifySignatureAsync to verify Keyless signatures");return this.publicKey.verifySignature({message:n,signature:i.signature})}async verifySignatureAsync(e){if(!(e.signature instanceof c)){if(e.options?.throwErrorWithReason)throw new Error("Signature must be an instance of AnySignature");return!1}return await this.publicKey.verifySignatureAsync({...e,signature:e.signature.signature})}authKey(){return K.fromSchemeAndBytes({scheme:g.SingleKey,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){const n=e.deserializeUleb128AsU32();let i;switch(n){case t.Ed25519:i=a.deserialize(e);break;case t.Secp256k1:i=s.deserialize(e);break;case t.Secp256r1:i=f.deserialize(e);break;case t.Keyless:i=o.deserialize(e);break;case t.FederatedKeyless:i=b.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${n}`)}return new u(i)}static isPublicKey(e){return e instanceof u}isEd25519(){return this.publicKey instanceof a}isSecp256k1PublicKey(){return this.publicKey instanceof s}static isInstance(e){return"publicKey"in e&&"variant"in e}}class c extends A{constructor(e){if(super(),this.signature=e,e instanceof l)this.variant=r.Ed25519;else if(e instanceof y)this.variant=r.Secp256k1;else if(e instanceof h)this.variant=r.WebAuthn;else if(e instanceof p)this.variant=r.Keyless;else throw new Error("Unsupported signature type")}toUint8Array(){return console.warn("[Aptos SDK] Calls to AnySignature.toUint8Array() will soon return the underlying signature bytes. Use AnySignature.bcsToBytes() instead."),this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){const n=e.deserializeUleb128AsU32();let i;switch(n){case r.Ed25519:i=l.deserialize(e);break;case r.Secp256k1:i=y.deserialize(e);break;case r.WebAuthn:i=h.deserialize(e);break;case r.Keyless:i=p.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}return new c(i)}static isInstance(e){return"signature"in e&&typeof e.signature=="object"&&e.signature!==null&&"toUint8Array"in e.signature}}export{u as AnyPublicKey,c as AnySignature};
2
2
  //# sourceMappingURL=singleKey.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/crypto/singleKey.ts"],"sourcesContent":["import { Deserializer, Serializer } from \"../../bcs\";\nimport {\n AnyPublicKeyVariant,\n AnySignatureVariant,\n SigningScheme as AuthenticationKeyScheme,\n HexInput,\n} from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { AccountPublicKey, PublicKey } from \"./publicKey\";\nimport { Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature } from \"./secp256k1\";\nimport { KeylessPublicKey, KeylessSignature } from \"./keyless\";\nimport { Signature } from \"./signature\";\nimport { FederatedKeylessPublicKey } from \"./federatedKeyless\";\nimport { AptosConfig } from \"../../api\";\nimport { Secp256r1PublicKey, WebAuthnSignature } from \"./secp256r1\";\n\nexport type PrivateKeyInput = Ed25519PrivateKey | Secp256k1PrivateKey;\n\n/**\n * Represents any public key supported by Aptos.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Any unified authentication key is represented in the SDK as `AnyPublicKey`.\n * @group Implementation\n * @category Serialization\n */\nexport class AnyPublicKey extends AccountPublicKey {\n /**\n * Reference to the inner public key\n * @group Implementation\n * @category Serialization\n */\n public readonly publicKey: PublicKey;\n\n /**\n * Index of the underlying enum variant\n * @group Implementation\n * @category Serialization\n */\n public readonly variant: AnyPublicKeyVariant;\n\n // region Constructors\n\n /**\n * Creates an instance of the signature class based on the provided signature type.\n * This allows for the handling of different signature variants such as Ed25519, Secp256k1, and Keyless.\n *\n * @param publicKey - The publicKey object which determines the variant to be used.\n * @throws Error if the provided signature type is unsupported.\n * @group Implementation\n * @category Serialization\n */\n constructor(publicKey: PublicKey) {\n super();\n this.publicKey = publicKey;\n if (publicKey instanceof Ed25519PublicKey) {\n this.variant = AnyPublicKeyVariant.Ed25519;\n } else if (publicKey instanceof Secp256k1PublicKey) {\n this.variant = AnyPublicKeyVariant.Secp256k1;\n } else if (publicKey instanceof Secp256r1PublicKey) {\n this.variant = AnyPublicKeyVariant.Secp256r1;\n } else if (publicKey instanceof KeylessPublicKey) {\n this.variant = AnyPublicKeyVariant.Keyless;\n } else if (publicKey instanceof FederatedKeylessPublicKey) {\n this.variant = AnyPublicKeyVariant.FederatedKeyless;\n } else {\n throw new Error(\"Unsupported public key type\");\n }\n }\n\n // endregion\n\n // region AccountPublicKey\n\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 AnySignature.\n * @returns A boolean indicating whether the signature is valid for the given message.\n * @group Implementation\n * @category Serialization\n */\n verifySignature(args: { message: HexInput; signature: AnySignature }): boolean {\n const { message, signature } = args;\n if (this.publicKey instanceof KeylessPublicKey) {\n throw new Error(\"Use verifySignatureAsync to verify Keyless signatures\");\n }\n return this.publicKey.verifySignature({\n message,\n signature: signature.signature,\n });\n }\n\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.aptosConfig - The configuration object for connecting to the Aptos network\n * @param args.message - The message that was signed.\n * @param args.signature - The signature to verify, which must be an instance of AnySignature.\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: {\n aptosConfig: AptosConfig;\n message: HexInput;\n signature: Signature;\n options?: { throwErrorWithReason?: boolean };\n }): Promise<boolean> {\n if (!(args.signature instanceof AnySignature)) {\n if (args.options?.throwErrorWithReason) {\n throw new Error(\"Signature must be an instance of AnySignature\");\n }\n return false;\n }\n return await this.publicKey.verifySignatureAsync({\n ...args,\n signature: args.signature.signature,\n });\n }\n\n /**\n * Generates an authentication key from the current instance's byte representation.\n * This function is essential for creating a unique identifier for authentication purposes.\n *\n * @returns {AuthenticationKey} The generated authentication key.\n * @group Implementation\n * @category Serialization\n */\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.SingleKey,\n input: this.toUint8Array(),\n });\n }\n\n /**\n * Get the signature in bytes (Uint8Array).\n *\n * This function is a warning that it will soon return the underlying signature bytes directly.\n * Use AnySignature.bcsToBytes() instead.\n *\n * @returns Uint8Array representation of the signature.\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n /**\n * Serializes the current object using the provided serializer.\n * This function helps in converting the object into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.publicKey.serialize(serializer);\n }\n\n /**\n * Deserializes an AnySignature from the provided deserializer.\n * This function helps in reconstructing the AnySignature object from its serialized form, allowing for further processing or validation.\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): AnyPublicKey {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let publicKey: PublicKey;\n switch (variantIndex) {\n case AnyPublicKeyVariant.Ed25519:\n publicKey = Ed25519PublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.Secp256k1:\n publicKey = Secp256k1PublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.Secp256r1:\n publicKey = Secp256r1PublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.Keyless:\n publicKey = KeylessPublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.FederatedKeyless:\n publicKey = FederatedKeylessPublicKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnyPublicKey: ${variantIndex}`);\n }\n return new AnyPublicKey(publicKey);\n }\n // endregion\n\n /**\n * Determines if the provided public key is an instance of AnyPublicKey.\n *\n * @param publicKey - The public key to check.\n * @deprecated Use `instanceof AnyPublicKey` instead.\n * @group Implementation\n * @category Serialization\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is AnyPublicKey {\n return publicKey instanceof AnyPublicKey;\n }\n\n /**\n * Determines if the current public key is an instance of Ed25519PublicKey.\n *\n * @deprecated use `publicKey instanceof Ed25519PublicKey` instead.\n * @group Implementation\n * @category Serialization\n */\n isEd25519(): boolean {\n return this.publicKey instanceof Ed25519PublicKey;\n }\n\n /**\n * Checks if the public key is an instance of Secp256k1PublicKey.\n *\n * @deprecated use `publicKey instanceof Secp256k1PublicKey` instead.\n * @group Implementation\n * @category Serialization\n */\n isSecp256k1PublicKey(): boolean {\n return this.publicKey instanceof Secp256k1PublicKey;\n }\n\n /**\n * Determines if the provided publicKey is an instance of a valid PublicKey object.\n *\n * @param publicKey - The publicKey to be checked for validity.\n * @param publicKey.publicKey - The actual publicKey object that needs to be validated.\n * @returns True if the signature is a valid instance; otherwise, false.\n * @group Implementation\n * @category Serialization\n */\n static isInstance(publicKey: PublicKey): publicKey is AnyPublicKey {\n return \"publicKey\" in publicKey && \"variant\" in publicKey;\n }\n}\n\n/**\n * Represents a signature that utilizes the SingleKey authentication scheme.\n * This class is designed to encapsulate various types of signatures, which can\n * only be generated by a `SingleKeySigner` due to the shared authentication mechanism.\n *\n * @extends Signature\n * @group Implementation\n * @category Serialization\n */\nexport class AnySignature extends Signature {\n public readonly signature: Signature;\n\n /**\n * Index of the underlying enum variant\n * @group Implementation\n * @category Serialization\n */\n private readonly variant: AnySignatureVariant;\n\n // region Constructors\n\n constructor(signature: Signature) {\n super();\n this.signature = signature;\n\n if (signature instanceof Ed25519Signature) {\n this.variant = AnySignatureVariant.Ed25519;\n } else if (signature instanceof Secp256k1Signature) {\n this.variant = AnySignatureVariant.Secp256k1;\n } else if (signature instanceof WebAuthnSignature) {\n this.variant = AnySignatureVariant.WebAuthn;\n } else if (signature instanceof KeylessSignature) {\n this.variant = AnySignatureVariant.Keyless;\n } else {\n throw new Error(\"Unsupported signature type\");\n }\n }\n\n // endregion\n\n // region AccountSignature\n\n toUint8Array(): Uint8Array {\n // TODO: keep this warning around for a bit, and eventually change this to return `this.signature.toUint8Array()`.\n // eslint-disable-next-line no-console\n console.warn(\n \"[Aptos SDK] Calls to AnySignature.toUint8Array() will soon return the underlying signature bytes. \" +\n \"Use AnySignature.bcsToBytes() instead.\",\n );\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.signature.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnySignature {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let signature: Signature;\n switch (variantIndex) {\n case AnySignatureVariant.Ed25519:\n signature = Ed25519Signature.deserialize(deserializer);\n break;\n case AnySignatureVariant.Secp256k1:\n signature = Secp256k1Signature.deserialize(deserializer);\n break;\n case AnySignatureVariant.WebAuthn:\n signature = WebAuthnSignature.deserialize(deserializer);\n break;\n case AnySignatureVariant.Keyless:\n signature = KeylessSignature.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnySignature: ${variantIndex}`);\n }\n return new AnySignature(signature);\n }\n\n // endregion\n\n static isInstance(signature: Signature): signature is AnySignature {\n return (\n \"signature\" in signature &&\n typeof signature.signature === \"object\" &&\n signature.signature !== null &&\n \"toUint8Array\" in signature.signature\n );\n }\n}\n"],"mappings":"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","names":["AnyPublicKeyVariant","AnySignatureVariant","AuthenticationKeyScheme","AuthenticationKey","Ed25519PublicKey","Ed25519Signature","AccountPublicKey","Secp256k1PublicKey","Secp256k1Signature","KeylessPublicKey","KeylessSignature","Signature","FederatedKeylessPublicKey","Secp256r1PublicKey","WebAuthnSignature","AnyPublicKey","publicKey","args","message","signature","AnySignature","serializer","deserializer","variantIndex"]}
@@ -1,4 +1,4 @@
1
- import { E as Ed25519PublicKey, N as AnyPublicKey, x as MultiKey, t as MultiEd25519PublicKey } from '../../account-ClxOwjdh.mjs';
1
+ import { E as Ed25519PublicKey, N as AnyPublicKey, x as MultiKey, t as MultiEd25519PublicKey } 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 @@
1
- import"../../chunk-5HXLZHDW.mjs";
2
1
  //# sourceMappingURL=types.mjs.map
@@ -1,4 +1,4 @@
1
- import { bp as HexInput, G as AccountPublicKey, dr as SigningScheme } from '../../account-ClxOwjdh.mjs';
1
+ import { bp as HexInput, G as AccountPublicKey, dr as SigningScheme } from '../../account-BortO8g2.mjs';
2
2
  import { BaseAccountPublicKey } from './types.mjs';
3
3
  import '../../types/indexer.mjs';
4
4
  import '../../types/generated/operations.mjs';
@@ -1,2 +1,2 @@
1
- import{M as a,N as b,O as c}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{b as accountPublicKeyToBaseAccountPublicKey,c as accountPublicKeyToSigningScheme,a as convertSigningMessage};
1
+ import{SigningScheme as t}from"../../types";import{Hex as u}from"../hex";import{Ed25519PublicKey as i}from"./ed25519";import{FederatedKeylessPublicKey as f}from"./federatedKeyless";import{KeylessPublicKey as s}from"./keyless";import{MultiEd25519PublicKey as r}from"./multiEd25519";import{MultiKey as c}from"./multiKey";import{AnyPublicKey as o}from"./singleKey";const E=n=>typeof n=="string"?u.isValid(n).valid?n:new TextEncoder().encode(n):n,l=n=>{if(n instanceof i||n instanceof o||n instanceof r||n instanceof c)return n;if(n instanceof s||n instanceof f)return new o(n);throw new Error(`Unknown account public key: ${n}`)},h=n=>{const e=l(n);if(e instanceof i)return t.Ed25519;if(e instanceof o)return t.SingleKey;if(e instanceof r)return t.MultiEd25519;if(e instanceof c)return t.MultiKey;throw new Error(`Unknown signing scheme: ${e}`)};export{l as accountPublicKeyToBaseAccountPublicKey,h as accountPublicKeyToSigningScheme,E as convertSigningMessage};
2
2
  //# sourceMappingURL=utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/crypto/utils.ts"],"sourcesContent":["import { HexInput, SigningScheme } from \"../../types\";\nimport { Hex } from \"../hex\";\nimport { Ed25519PublicKey } from \"./ed25519\";\nimport { FederatedKeylessPublicKey } from \"./federatedKeyless\";\nimport { KeylessPublicKey } from \"./keyless\";\nimport { MultiEd25519PublicKey } from \"./multiEd25519\";\nimport { MultiKey } from \"./multiKey\";\nimport { AccountPublicKey } from \"./publicKey\";\nimport { AnyPublicKey } from \"./singleKey\";\nimport { BaseAccountPublicKey } from \"./types\";\n\n/**\n * Helper function to convert a message to sign or to verify to a valid message input\n *\n * @param message a message as a string or Uint8Array\n *\n * @returns a valid HexInput - string or Uint8Array\n * @group Implementation\n * @category Serialization\n */\nexport const convertSigningMessage = (message: HexInput): HexInput => {\n // if message is of type string, verify it is a valid Hex string\n if (typeof message === \"string\") {\n const isValid = Hex.isValid(message);\n // If message is not a valid Hex string, convert it\n if (!isValid.valid) {\n return new TextEncoder().encode(message);\n }\n // If message is a valid Hex string, return it\n return message;\n }\n // message is a Uint8Array\n return message;\n};\n\nexport const accountPublicKeyToBaseAccountPublicKey = (publicKey: AccountPublicKey): BaseAccountPublicKey => {\n if (\n publicKey instanceof Ed25519PublicKey ||\n publicKey instanceof AnyPublicKey ||\n publicKey instanceof MultiEd25519PublicKey ||\n publicKey instanceof MultiKey\n ) {\n return publicKey;\n }\n if (publicKey instanceof KeylessPublicKey || publicKey instanceof FederatedKeylessPublicKey) {\n return new AnyPublicKey(publicKey);\n }\n throw new Error(`Unknown account public key: ${publicKey}`);\n};\n\nexport const accountPublicKeyToSigningScheme = (publicKey: AccountPublicKey): SigningScheme => {\n const baseAccountPublicKey = accountPublicKeyToBaseAccountPublicKey(publicKey);\n if (baseAccountPublicKey instanceof Ed25519PublicKey) {\n return SigningScheme.Ed25519;\n } else if (baseAccountPublicKey instanceof AnyPublicKey) {\n return SigningScheme.SingleKey;\n } else if (baseAccountPublicKey instanceof MultiEd25519PublicKey) {\n return SigningScheme.MultiEd25519;\n } else if (baseAccountPublicKey instanceof MultiKey) {\n return SigningScheme.MultiKey;\n }\n throw new Error(`Unknown signing scheme: ${baseAccountPublicKey}`);\n};\n"],"mappings":"AAAA,OAAmB,iBAAAA,MAAqB,cACxC,OAAS,OAAAC,MAAW,SACpB,OAAS,oBAAAC,MAAwB,YACjC,OAAS,6BAAAC,MAAiC,qBAC1C,OAAS,oBAAAC,MAAwB,YACjC,OAAS,yBAAAC,MAA6B,iBACtC,OAAS,YAAAC,MAAgB,aAEzB,OAAS,gBAAAC,MAAoB,cAYtB,MAAMC,EAAyBC,GAEhC,OAAOA,GAAY,SACLR,EAAI,QAAQQ,CAAO,EAEtB,MAINA,EAHE,IAAI,YAAY,EAAE,OAAOA,CAAO,EAMpCA,EAGIC,EAA0CC,GAAsD,CAC3G,GACEA,aAAqBT,GACrBS,aAAqBJ,GACrBI,aAAqBN,GACrBM,aAAqBL,EAErB,OAAOK,EAET,GAAIA,aAAqBP,GAAoBO,aAAqBR,EAChE,OAAO,IAAII,EAAaI,CAAS,EAEnC,MAAM,IAAI,MAAM,+BAA+BA,CAAS,EAAE,CAC5D,EAEaC,EAAmCD,GAA+C,CAC7F,MAAME,EAAuBH,EAAuCC,CAAS,EAC7E,GAAIE,aAAgCX,EAClC,OAAOF,EAAc,QAChB,GAAIa,aAAgCN,EACzC,OAAOP,EAAc,UAChB,GAAIa,aAAgCR,EACzC,OAAOL,EAAc,aAChB,GAAIa,aAAgCP,EACzC,OAAON,EAAc,SAEvB,MAAM,IAAI,MAAM,2BAA2Ba,CAAoB,EAAE,CACnE","names":["SigningScheme","Hex","Ed25519PublicKey","FederatedKeylessPublicKey","KeylessPublicKey","MultiEd25519PublicKey","MultiKey","AnyPublicKey","convertSigningMessage","message","accountPublicKeyToBaseAccountPublicKey","publicKey","accountPublicKeyToSigningScheme","baseAccountPublicKey"]}
@@ -1,5 +1,5 @@
1
1
  import './common.mjs';
2
- export { R as Hex, Q as HexInvalidReason, T as hexToAsciiString } from '../account-ClxOwjdh.mjs';
2
+ export { R as Hex, Q as HexInvalidReason, T as hexToAsciiString } 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,b,c}from"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-KDMSOCZY.mjs";export{b as Hex,a as HexInvalidReason,c as hexToAsciiString};
1
+ import{bytesToHex as o,hexToBytes as s}from"@noble/hashes/utils";import{ParsingError as i}from"./common";var u=(e=>(e.TOO_SHORT="too_short",e.INVALID_LENGTH="invalid_length",e.INVALID_HEX_CHARS="invalid_hex_chars",e))(u||{});class n{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return o(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(t){let r=t;if(r.startsWith("0x")&&(r=r.slice(2)),r.length===0)throw new i("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(r.length%2!==0)throw new i("Hex string must be an even number of hex characters.","invalid_length");try{return new n(s(r))}catch(e){throw new i(`Hex string contains invalid hex characters: ${e?.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new n(t):n.fromHexString(t)}static hexInputToUint8Array(t){return t instanceof Uint8Array?t:n.fromHexString(t).toUint8Array()}static hexInputToString(t){return n.fromHexInput(t).toString()}static hexInputToStringWithoutPrefix(t){return n.fromHexInput(t).toStringWithoutPrefix()}static isValid(t){try{return n.fromHexString(t),{valid:!0}}catch(r){return{valid:!1,invalidReason:r?.invalidReason,invalidReasonMessage:r?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((r,e)=>r===t.data[e])}}const f=a=>new TextDecoder().decode(n.fromHexInput(a).toUint8Array());export{n as Hex,u as HexInvalidReason,f as hexToAsciiString};
2
2
  //# sourceMappingURL=hex.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/core/hex.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bytesToHex, hexToBytes } from \"@noble/hashes/utils\";\nimport { ParsingError, ParsingResult } from \"./common\";\nimport { HexInput } from \"../types\";\n\n/**\n * Provides reasons for parsing failures related to hexadecimal values.\n * @group Implementation\n * @category Serialization\n */\nexport enum HexInvalidReason {\n TOO_SHORT = \"too_short\",\n INVALID_LENGTH = \"invalid_length\",\n INVALID_HEX_CHARS = \"invalid_hex_chars\",\n}\n\n/**\n * NOTE: Do not use this class when working with account addresses; use AccountAddress instead.\n * When accepting hex data as input to a function, prefer to accept HexInput and\n *\n * A helper class for working with hex data. Hex data, when represented as a string,\n * generally looks like this, for example: 0xaabbcc, 45cd32, etc.\n *\n * then use the static helper methods of this class to convert it into the desired\n * format. This enables the greatest flexibility for the developer.\n *\n * Example usage:\n * ```typescript\n * getTransactionByHash(txnHash: HexInput): Promise<Transaction> {\n * const txnHashString = Hex.fromHexInput(txnHash).toString();\n * return await getTransactionByHashInner(txnHashString);\n * }\n * ```\n * This call to `Hex.fromHexInput().toString()` converts the HexInput to a hex string\n * with a leading 0x prefix, regardless of what the input format was.\n *\n * Other ways to chain the functions together:\n * - `Hex.fromHexString({ hexInput: \"0x1f\" }).toUint8Array()`\n * - `new Hex([1, 3]).toStringWithoutPrefix()`\n * @group Implementation\n * @category Serialization\n */\nexport class Hex {\n private readonly data: Uint8Array;\n\n /**\n * Create a new Hex instance from a Uint8Array.\n *\n * @param data - The Uint8Array containing the data to initialize the Hex instance.\n * @group Implementation\n * @category Serialization\n */\n constructor(data: Uint8Array) {\n this.data = data;\n }\n\n // ===\n // Methods for representing an instance of Hex as other types.\n // ===\n\n /**\n * Get the inner hex data as a Uint8Array. The inner data is already a Uint8Array, so no conversion takes place.\n *\n * @returns Hex data as Uint8Array\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.data;\n }\n\n /**\n * Get the hex data as a string without the 0x prefix.\n *\n * @returns Hex string without 0x prefix\n * @group Implementation\n * @category Serialization\n */\n toStringWithoutPrefix(): string {\n return bytesToHex(this.data);\n }\n\n /**\n * Get the hex data as a string with the 0x prefix.\n *\n * @returns Hex string with 0x prefix\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n\n // ===\n // Methods for creating an instance of Hex from other types.\n // ===\n\n /**\n * Converts a hex string into a Hex instance, allowing for both prefixed and non-prefixed formats.\n *\n * @param str - A hex string, with or without the 0x prefix.\n *\n * @throws ParsingError - If the hex string is too short, has an odd number of characters, or contains invalid hex characters.\n *\n * @returns Hex - The resulting Hex instance created from the provided string.\n * @group Implementation\n * @category Serialization\n */\n static fromHexString(str: string): Hex {\n let input = str;\n\n if (input.startsWith(\"0x\")) {\n input = input.slice(2);\n }\n\n if (input.length === 0) {\n throw new ParsingError(\n \"Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.\",\n HexInvalidReason.TOO_SHORT,\n );\n }\n\n if (input.length % 2 !== 0) {\n throw new ParsingError(\"Hex string must be an even number of hex characters.\", HexInvalidReason.INVALID_LENGTH);\n }\n\n try {\n return new Hex(hexToBytes(input));\n } catch (error: any) {\n throw new ParsingError(\n `Hex string contains invalid hex characters: ${error?.message}`,\n HexInvalidReason.INVALID_HEX_CHARS,\n );\n }\n }\n\n /**\n * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Hex instance.\n * This function is useful for transforming hexadecimal representations into a structured Hex object for further manipulation.\n *\n * @param hexInput - A HexInput which can be a string or Uint8Array.\n * @returns A Hex instance created from the provided hexInput.\n * @group Implementation\n * @category Serialization\n */\n static fromHexInput(hexInput: HexInput): Hex {\n if (hexInput instanceof Uint8Array) return new Hex(hexInput);\n return Hex.fromHexString(hexInput);\n }\n\n /**\n * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Uint8Array.\n *\n * @param hexInput - A HexInput which can be a string or Uint8Array.\n * @returns A Uint8Array created from the provided hexInput.\n */\n static hexInputToUint8Array(hexInput: HexInput): Uint8Array {\n if (hexInput instanceof Uint8Array) return hexInput;\n return Hex.fromHexString(hexInput).toUint8Array();\n }\n\n /**\n * Converts a HexInput (string or Uint8Array) to a hex string with '0x' prefix.\n *\n * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array\n * @returns A hex string with '0x' prefix (e.g., \"0x1234\")\n *\n * @example\n * ```typescript\n * Hex.hexInputToString(\"1234\") // returns \"0x1234\"\n * Hex.hexInputToString(\"0x1234\") // returns \"0x1234\"\n * Hex.hexInputToString(new Uint8Array([0x12, 0x34])) // returns \"0x1234\"\n * ```\n */\n static hexInputToString(hexInput: HexInput): string {\n return Hex.fromHexInput(hexInput).toString();\n }\n\n /**\n * Converts a HexInput (string or Uint8Array) to a hex string without '0x' prefix.\n *\n * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array\n * @returns A hex string without '0x' prefix (e.g., \"1234\")\n *\n * @example\n * ```typescript\n * Hex.hexInputToStringWithoutPrefix(\"1234\") // returns \"1234\"\n * Hex.hexInputToStringWithoutPrefix(\"0x1234\") // returns \"1234\"\n * Hex.hexInputToStringWithoutPrefix(new Uint8Array([0x12, 0x34])) // returns \"1234\"\n * ```\n */\n static hexInputToStringWithoutPrefix(hexInput: HexInput): string {\n return Hex.fromHexInput(hexInput).toStringWithoutPrefix();\n }\n\n // ===\n // Methods for checking validity.\n // ===\n\n /**\n * Check if the provided string is a valid hexadecimal representation.\n *\n * @param str - A hex string representing byte data.\n *\n * @returns An object containing:\n * - valid: A boolean indicating whether the string is valid.\n * - invalidReason: The reason for invalidity if the string is not valid.\n * - invalidReasonMessage: A message explaining why the string is invalid.\n * @group Implementation\n * @category Serialization\n */\n static isValid(str: string): ParsingResult<HexInvalidReason> {\n try {\n Hex.fromHexString(str);\n return { valid: true };\n } catch (error: any) {\n return {\n valid: false,\n invalidReason: error?.invalidReason,\n invalidReasonMessage: error?.message,\n };\n }\n }\n\n /**\n * Determine if two Hex instances are equal by comparing their underlying byte data.\n *\n * @param other The Hex instance to compare to.\n * @returns true if the Hex instances are equal, false if not.\n * @group Implementation\n * @category Serialization\n */\n equals(other: Hex): boolean {\n if (this.data.length !== other.data.length) return false;\n return this.data.every((value, index) => value === other.data[index]);\n }\n}\n\nexport const hexToAsciiString = (hex: string) => new TextDecoder().decode(Hex.fromHexInput(hex).toUint8Array());\n"],"mappings":"AAGA,OAAS,cAAAA,EAAY,cAAAC,MAAkB,sBACvC,OAAS,gBAAAC,MAAmC,WAQrC,IAAKC,OACVA,EAAA,UAAY,YACZA,EAAA,eAAiB,iBACjBA,EAAA,kBAAoB,oBAHVA,OAAA,IAgCL,MAAMC,CAAI,CAUf,YAAYC,EAAkB,CAC5B,KAAK,KAAOA,CACd,CAaA,cAA2B,CACzB,OAAO,KAAK,IACd,CASA,uBAAgC,CAC9B,OAAOL,EAAW,KAAK,IAAI,CAC7B,CASA,UAAmB,CACjB,MAAO,KAAK,KAAK,sBAAsB,CAAC,EAC1C,CAiBA,OAAO,cAAcM,EAAkB,CACrC,IAAIC,EAAQD,EAMZ,GAJIC,EAAM,WAAW,IAAI,IACvBA,EAAQA,EAAM,MAAM,CAAC,GAGnBA,EAAM,SAAW,EACnB,MAAM,IAAIL,EACR,4FACA,WACF,EAGF,GAAIK,EAAM,OAAS,IAAM,EACvB,MAAM,IAAIL,EAAa,uDAAwD,gBAA+B,EAGhH,GAAI,CACF,OAAO,IAAIE,EAAIH,EAAWM,CAAK,CAAC,CAClC,OAASC,EAAY,CACnB,MAAM,IAAIN,EACR,+CAA+CM,GAAO,OAAO,GAC7D,mBACF,CACF,CACF,CAWA,OAAO,aAAaC,EAAyB,CAC3C,OAAIA,aAAoB,WAAmB,IAAIL,EAAIK,CAAQ,EACpDL,EAAI,cAAcK,CAAQ,CACnC,CAQA,OAAO,qBAAqBA,EAAgC,CAC1D,OAAIA,aAAoB,WAAmBA,EACpCL,EAAI,cAAcK,CAAQ,EAAE,aAAa,CAClD,CAeA,OAAO,iBAAiBA,EAA4B,CAClD,OAAOL,EAAI,aAAaK,CAAQ,EAAE,SAAS,CAC7C,CAeA,OAAO,8BAA8BA,EAA4B,CAC/D,OAAOL,EAAI,aAAaK,CAAQ,EAAE,sBAAsB,CAC1D,CAkBA,OAAO,QAAQH,EAA8C,CAC3D,GAAI,CACF,OAAAF,EAAI,cAAcE,CAAG,EACd,CAAE,MAAO,EAAK,CACvB,OAASE,EAAY,CACnB,MAAO,CACL,MAAO,GACP,cAAeA,GAAO,cACtB,qBAAsBA,GAAO,OAC/B,CACF,CACF,CAUA,OAAOE,EAAqB,CAC1B,OAAI,KAAK,KAAK,SAAWA,EAAM,KAAK,OAAe,GAC5C,KAAK,KAAK,MAAM,CAACC,EAAOC,IAAUD,IAAUD,EAAM,KAAKE,CAAK,CAAC,CACtE,CACF,CAEO,MAAMC,EAAoBC,GAAgB,IAAI,YAAY,EAAE,OAAOV,EAAI,aAAaU,CAAG,EAAE,aAAa,CAAC","names":["bytesToHex","hexToBytes","ParsingError","HexInvalidReason","Hex","data","str","input","error","hexInput","other","value","index","hexToAsciiString","hex"]}
@@ -1,11 +1,12 @@
1
- export { createObjectAddress, createResourceAddress, createTokenAddress } from './account/utils/address.mjs';
2
- export { w as AbstractMultiKey, n as AccountAddress, m as AccountAddressInput, G as AccountPublicKey, l as AddressInvalidReason, N as AnyPublicKey, O as AnySignature, p as AuthenticationKey, r as Ed25519PrivateKey, E as Ed25519PublicKey, s as Ed25519Signature, R as Hex, Q as HexInvalidReason, t as MultiEd25519PublicKey, u as MultiEd25519Signature, x as MultiKey, y as MultiKeySignature, P as PrivateKey, L as PrivateKeyInput, C as PublicKey, I as Secp256k1PrivateKey, H as Secp256k1PublicKey, J as Secp256k1Signature, K as Signature, V as VerifySignatureArgs, z as VerifySignatureAsyncArgs, T as hexToAsciiString, q as isCanonicalEd25519Signature } from '../account-ClxOwjdh.mjs';
1
+ export { createObjectAddress, createResourceAddress, createTokenAddress, createUserDerivedObjectAddress } from './account/utils/address.mjs';
2
+ export { w as AbstractMultiKey, n as AccountAddress, m as AccountAddressInput, G as AccountPublicKey, l as AddressInvalidReason, N as AnyPublicKey, O as AnySignature, p as AuthenticationKey, r as Ed25519PrivateKey, E as Ed25519PublicKey, s as Ed25519Signature, R as Hex, Q as HexInvalidReason, t as MultiEd25519PublicKey, u as MultiEd25519Signature, x as MultiKey, y as MultiKeySignature, P as PrivateKey, L as PrivateKeyInput, C as PublicKey, I as Secp256k1PrivateKey, H as Secp256k1PublicKey, J as Secp256k1Signature, K as Signature, V as VerifySignatureArgs, z as VerifySignatureAsyncArgs, T as hexToAsciiString, q as isCanonicalEd25519Signature } from '../account-BortO8g2.mjs';
3
3
  export { ParsingError, ParsingResult } from './common.mjs';
4
4
  export { AbstractPublicKey, AbstractSignature } from './crypto/abstraction.mjs';
5
5
  export { EphemeralPublicKey, EphemeralSignature } from './crypto/ephemeral.mjs';
6
- export { E as EPK_HORIZON_SECS, j as EphemeralCertificate, F as FederatedKeylessPublicKey, k as Groth16ProofAndStatement, n as Groth16VerificationKey, G as Groth16Zkp, m as KeylessConfiguration, K as KeylessPublicKey, i as KeylessSignature, M as MAX_AUD_VAL_BYTES, f as MAX_COMMITED_EPK_BYTES, d as MAX_EXTRA_FIELD_BYTES, c as MAX_ISS_VAL_BYTES, e as MAX_JWT_HEADER_B64_BYTES, a as MAX_UID_KEY_BYTES, b as MAX_UID_VAL_BYTES, r as MoveJWK, l as ZeroKnowledgeSig, Z as ZkProof, h as fetchJWK, p as getIssAudAndUidVal, o as getKeylessConfig, q as getKeylessJWKs, s as parseJwtHeader, v as verifyKeylessSignature, g as verifyKeylessSignatureWithJwkAndConfig } from '../federatedKeyless-CUPEnP-W.mjs';
6
+ export { E as EPK_HORIZON_SECS, j as EphemeralCertificate, F as FederatedKeylessPublicKey, k as Groth16ProofAndStatement, n as Groth16VerificationKey, G as Groth16Zkp, m as KeylessConfiguration, K as KeylessPublicKey, i as KeylessSignature, M as MAX_AUD_VAL_BYTES, f as MAX_COMMITED_EPK_BYTES, d as MAX_EXTRA_FIELD_BYTES, c as MAX_ISS_VAL_BYTES, e as MAX_JWT_HEADER_B64_BYTES, a as MAX_UID_KEY_BYTES, b as MAX_UID_VAL_BYTES, r as MoveJWK, l as ZeroKnowledgeSig, Z as ZkProof, h as fetchJWK, p as getIssAudAndUidVal, o as getKeylessConfig, q as getKeylessJWKs, s as parseJwtHeader, v as verifyKeylessSignature, g as verifyKeylessSignatureWithJwkAndConfig } from '../federatedKeyless-CTzDAQTu.mjs';
7
7
  export { APTOS_BIP44_REGEX, APTOS_HARDENED_REGEX, CKDPriv, DerivedKeys, HARDENED_OFFSET, KeyType, deriveKey, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, splitPath } from './crypto/hdKey.mjs';
8
8
  export { bigIntToBytesLE, bytesToBigIntLE, hashStrToField, padAndPackBytesWithLen, poseidonHash } from './crypto/poseidon.mjs';
9
+ export { Secp256r1PrivateKey, Secp256r1PublicKey, Secp256r1Signature, WebAuthnSignature } from './crypto/secp256r1.mjs';
9
10
  export { BaseAccountPublicKey } from './crypto/types.mjs';
10
11
  export { deserializePublicKey, deserializeSignature } from './crypto/deserializationUtils.mjs';
11
12
  import '../types/indexer.mjs';
@@ -1,2 +1,2 @@
1
- import{A as da,B as ea,C as fa,D as ga,E as ha,F as ia,G as ja,H as ka,I as la,J as ma,K as na,L as oa,P as pa,Q as qa,R as ra,S as sa,T as ta,U as ua,a as x,b as y,c as H,d as I,e as J,f as K,g as L,h as M,i as N,j as O,k as P,l as Q,m as R,n as S,o as T,p as U,q as V,r as W,s as X,t as Y,u as Z,v as _,w as $,x as aa,y as ba,z as ca}from"../chunk-DIGP2ALY.mjs";import"../chunk-5HXLZHDW.mjs";import{a as z,b as A,c as B,d as C,e as D}from"../chunk-GOXRBEIJ.mjs";import{a as w}from"../chunk-ROT6S6BM.mjs";import"../chunk-XJJVJOX5.mjs";import{a as m,b as n,c as o,d as p,e as q,f as r,g as s,h as t,i as u,j as v}from"../chunk-C3Q23D22.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import{a as k,b as l}from"../chunk-RQX6JOEN.mjs";import{a as h,b as i}from"../chunk-WSR5EBJM.mjs";import{a as j}from"../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{a as g}from"../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{a as E,b as F,c as G}from"../chunk-HNBVYE3N.mjs";import{a as e,b as f}from"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-EBMEXURY.mjs";import{a as b,b as c,c as d}from"../chunk-STY74NUA.mjs";import{a}from"../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{n as APTOS_BIP44_REGEX,m as APTOS_HARDENED_REGEX,ka as AbstractMultiKey,l as AbstractPublicKey,k as AbstractSignature,f as AccountAddress,i as AccountPublicKey,e as AddressInvalidReason,ia as AnyPublicKey,ja as AnySignature,g as AuthenticationKey,t as CKDPriv,H as EPK_HORIZON_SECS,ra as Ed25519PrivateKey,qa as Ed25519PublicKey,sa as Ed25519Signature,U as EphemeralCertificate,x as EphemeralPublicKey,y as EphemeralSignature,ea as FederatedKeylessPublicKey,W as Groth16ProofAndStatement,_ as Groth16VerificationKey,V as Groth16Zkp,p as HARDENED_OFFSET,c as Hex,b as HexInvalidReason,o as KeyType,Z as KeylessConfiguration,P as KeylessPublicKey,T as KeylessSignature,I as MAX_AUD_VAL_BYTES,O as MAX_COMMITED_EPK_BYTES,M as MAX_EXTRA_FIELD_BYTES,L as MAX_ISS_VAL_BYTES,N as MAX_JWT_HEADER_B64_BYTES,J as MAX_UID_KEY_BYTES,K as MAX_UID_VAL_BYTES,ca as MoveJWK,na as MultiEd25519PublicKey,oa as MultiEd25519Signature,la as MultiKey,ma as MultiKeySignature,a as ParsingError,w as PrivateKey,h as PublicKey,ga as Secp256k1PrivateKey,fa as Secp256k1PublicKey,ha as Secp256k1Signature,j as Signature,Y as ZeroKnowledgeSig,X as ZkProof,C as bigIntToBytesLE,B as bytesToBigIntLE,E as createObjectAddress,F as createResourceAddress,G as createTokenAddress,s as deriveKey,ta as deserializePublicKey,ua as deserializeSignature,S as fetchJWK,aa as getIssAudAndUidVal,$ as getKeylessConfig,ba as getKeylessJWKs,z as hashStrToField,d as hexToAsciiString,pa as isCanonicalEd25519Signature,q as isValidBIP44Path,r as isValidHardenedPath,v as mnemonicToSeed,A as padAndPackBytesWithLen,da as parseJwtHeader,D as poseidonHash,u as splitPath,Q as verifyKeylessSignature,R as verifyKeylessSignatureWithJwkAndConfig};
1
+ export*from"./account";export*from"./accountAddress";export*from"./authenticationKey";export*from"./common";export*from"./crypto";export*from"./hex";
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/core/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from \"./account\";\nexport * from \"./accountAddress\";\nexport * from \"./authenticationKey\";\nexport * from \"./common\";\nexport * from \"./crypto\";\nexport * from \"./hex\";\n"],"mappings":"AAGA,WAAc,YACd,WAAc,mBACd,WAAc,sBACd,WAAc,WACd,WAAc,WACd,WAAc","names":[]}
@@ -1,5 +1,5 @@
1
1
  import { AptosApiType } from '../utils/const.mjs';
2
- import { c4 as AptosRequest, c5 as AptosResponse } from '../account-ClxOwjdh.mjs';
2
+ import { c4 as AptosRequest, c5 as AptosResponse } from '../account-BortO8g2.mjs';
3
3
  import '../types/indexer.mjs';
4
4
  import '../types/generated/operations.mjs';
5
5
  import '../types/generated/types.mjs';