@aptos-labs/ts-sdk 5.1.0 → 5.1.1-side-effect-free.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/dist/common/{account-BW99GTa5.d.ts → account-Dr4y1uZG.d.ts} +1 -0
  2. package/dist/common/chunk-AWFAHZSB.js +4 -0
  3. package/dist/common/{chunk-A2XB7TVI.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 +94 -16
  8. package/dist/common/index.js +34 -34
  9. package/dist/common/index.js.map +1 -1
  10. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  11. package/dist/esm/account/AbstractKeylessAccount.mjs.map +1 -1
  12. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  13. package/dist/esm/account/AbstractedAccount.mjs.map +1 -1
  14. package/dist/esm/account/Account.mjs +1 -1
  15. package/dist/esm/account/Account.mjs.map +1 -1
  16. package/dist/esm/account/AccountUtils.mjs +1 -1
  17. package/dist/esm/account/AccountUtils.mjs.map +1 -1
  18. package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
  19. package/dist/esm/account/DerivableAbstractedAccount.mjs.map +1 -1
  20. package/dist/esm/account/Ed25519Account.mjs +1 -1
  21. package/dist/esm/account/Ed25519Account.mjs.map +1 -1
  22. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  23. package/dist/esm/account/EphemeralKeyPair.mjs.map +1 -1
  24. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  25. package/dist/esm/account/FederatedKeylessAccount.mjs.map +1 -1
  26. package/dist/esm/account/KeylessAccount.mjs +1 -1
  27. package/dist/esm/account/KeylessAccount.mjs.map +1 -1
  28. package/dist/esm/account/MultiEd25519Account.mjs +1 -1
  29. package/dist/esm/account/MultiEd25519Account.mjs.map +1 -1
  30. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  31. package/dist/esm/account/MultiKeyAccount.mjs.map +1 -1
  32. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  33. package/dist/esm/account/SingleKeyAccount.mjs.map +1 -1
  34. package/dist/esm/account/index.mjs +1 -1
  35. package/dist/esm/account/index.mjs.map +1 -1
  36. package/dist/esm/account/utils.mjs +1 -1
  37. package/dist/esm/account/utils.mjs.map +1 -1
  38. package/dist/esm/api/account/abstraction.mjs +1 -1
  39. package/dist/esm/api/account/abstraction.mjs.map +1 -1
  40. package/dist/esm/api/account.d.mts +1 -1
  41. package/dist/esm/api/account.mjs +1 -1
  42. package/dist/esm/api/account.mjs.map +1 -1
  43. package/dist/esm/api/ans.mjs +1 -1
  44. package/dist/esm/api/ans.mjs.map +1 -1
  45. package/dist/esm/api/aptos.d.mts +81 -14
  46. package/dist/esm/api/aptos.mjs +1 -1
  47. package/dist/esm/api/aptos.mjs.map +1 -1
  48. package/dist/esm/api/aptosConfig.mjs +1 -1
  49. package/dist/esm/api/aptosConfig.mjs.map +1 -1
  50. package/dist/esm/api/coin.mjs +1 -1
  51. package/dist/esm/api/coin.mjs.map +1 -1
  52. package/dist/esm/api/digitalAsset.mjs +1 -1
  53. package/dist/esm/api/digitalAsset.mjs.map +1 -1
  54. package/dist/esm/api/faucet.mjs +1 -1
  55. package/dist/esm/api/faucet.mjs.map +1 -1
  56. package/dist/esm/api/fungibleAsset.mjs +1 -1
  57. package/dist/esm/api/fungibleAsset.mjs.map +1 -1
  58. package/dist/esm/api/general.mjs +1 -1
  59. package/dist/esm/api/general.mjs.map +1 -1
  60. package/dist/esm/api/index.d.mts +2 -2
  61. package/dist/esm/api/index.mjs +1 -1
  62. package/dist/esm/api/index.mjs.map +1 -1
  63. package/dist/esm/api/keyless.mjs +1 -1
  64. package/dist/esm/api/keyless.mjs.map +1 -1
  65. package/dist/esm/api/object.mjs +1 -1
  66. package/dist/esm/api/object.mjs.map +1 -1
  67. package/dist/esm/api/staking.mjs +1 -1
  68. package/dist/esm/api/staking.mjs.map +1 -1
  69. package/dist/esm/api/table.mjs +1 -1
  70. package/dist/esm/api/table.mjs.map +1 -1
  71. package/dist/esm/api/transaction.mjs +1 -1
  72. package/dist/esm/api/transaction.mjs.map +1 -1
  73. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  74. package/dist/esm/api/transactionSubmission/build.mjs.map +1 -1
  75. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  76. package/dist/esm/api/transactionSubmission/helpers.mjs.map +1 -1
  77. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  78. package/dist/esm/api/transactionSubmission/management.mjs.map +1 -1
  79. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  80. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  81. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  82. package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -1
  83. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  84. package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -1
  85. package/dist/esm/api/utils.mjs +1 -1
  86. package/dist/esm/api/utils.mjs.map +1 -1
  87. package/dist/esm/bcs/consts.mjs +1 -1
  88. package/dist/esm/bcs/consts.mjs.map +1 -1
  89. package/dist/esm/bcs/deserializer.mjs +1 -1
  90. package/dist/esm/bcs/deserializer.mjs.map +1 -1
  91. package/dist/esm/bcs/index.mjs +1 -1
  92. package/dist/esm/bcs/index.mjs.map +1 -1
  93. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  94. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +1 -1
  95. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  96. package/dist/esm/bcs/serializable/fixedBytes.mjs.map +1 -1
  97. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  98. package/dist/esm/bcs/serializable/movePrimitives.mjs.map +1 -1
  99. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  100. package/dist/esm/bcs/serializable/moveStructs.mjs.map +1 -1
  101. package/dist/esm/bcs/serializer.mjs +1 -1
  102. package/dist/esm/bcs/serializer.mjs.map +1 -1
  103. package/dist/esm/cli/index.mjs +1 -1
  104. package/dist/esm/cli/index.mjs.map +1 -1
  105. package/dist/esm/cli/localNode.mjs +1 -1
  106. package/dist/esm/cli/localNode.mjs.map +1 -1
  107. package/dist/esm/cli/move.mjs +1 -1
  108. package/dist/esm/cli/move.mjs.map +1 -1
  109. package/dist/esm/client/core.mjs +1 -1
  110. package/dist/esm/client/core.mjs.map +1 -1
  111. package/dist/esm/client/get.mjs +1 -1
  112. package/dist/esm/client/get.mjs.map +1 -1
  113. package/dist/esm/client/index.mjs +1 -1
  114. package/dist/esm/client/index.mjs.map +1 -1
  115. package/dist/esm/client/post.mjs +1 -1
  116. package/dist/esm/client/post.mjs.map +1 -1
  117. package/dist/esm/core/account/index.d.mts +1 -1
  118. package/dist/esm/core/account/index.mjs +1 -1
  119. package/dist/esm/core/account/index.mjs.map +1 -1
  120. package/dist/esm/core/account/utils/address.d.mts +12 -1
  121. package/dist/esm/core/account/utils/address.mjs +1 -1
  122. package/dist/esm/core/account/utils/address.mjs.map +1 -1
  123. package/dist/esm/core/account/utils/index.d.mts +1 -1
  124. package/dist/esm/core/account/utils/index.mjs +1 -1
  125. package/dist/esm/core/account/utils/index.mjs.map +1 -1
  126. package/dist/esm/core/accountAddress.mjs +3 -1
  127. package/dist/esm/core/accountAddress.mjs.map +1 -1
  128. package/dist/esm/core/authenticationKey.mjs +1 -1
  129. package/dist/esm/core/authenticationKey.mjs.map +1 -1
  130. package/dist/esm/core/common.mjs +1 -1
  131. package/dist/esm/core/common.mjs.map +1 -1
  132. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  133. package/dist/esm/core/crypto/abstraction.mjs.map +1 -1
  134. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  135. package/dist/esm/core/crypto/deserializationUtils.mjs.map +1 -1
  136. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  137. package/dist/esm/core/crypto/ed25519.mjs.map +1 -1
  138. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  139. package/dist/esm/core/crypto/ephemeral.mjs.map +1 -1
  140. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  141. package/dist/esm/core/crypto/federatedKeyless.mjs.map +1 -1
  142. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  143. package/dist/esm/core/crypto/hdKey.mjs.map +1 -1
  144. package/dist/esm/core/crypto/index.mjs +1 -1
  145. package/dist/esm/core/crypto/index.mjs.map +1 -1
  146. package/dist/esm/core/crypto/keyless.mjs +1 -1
  147. package/dist/esm/core/crypto/keyless.mjs.map +1 -1
  148. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  149. package/dist/esm/core/crypto/multiEd25519.mjs.map +1 -1
  150. package/dist/esm/core/crypto/multiKey.mjs +3 -1
  151. package/dist/esm/core/crypto/multiKey.mjs.map +1 -1
  152. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  153. package/dist/esm/core/crypto/poseidon.mjs.map +1 -1
  154. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  155. package/dist/esm/core/crypto/privateKey.mjs.map +1 -1
  156. package/dist/esm/core/crypto/proof.mjs +1 -1
  157. package/dist/esm/core/crypto/proof.mjs.map +1 -1
  158. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  159. package/dist/esm/core/crypto/publicKey.mjs.map +1 -1
  160. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  161. package/dist/esm/core/crypto/secp256k1.mjs.map +1 -1
  162. package/dist/esm/core/crypto/secp256r1.mjs +1 -1
  163. package/dist/esm/core/crypto/secp256r1.mjs.map +1 -1
  164. package/dist/esm/core/crypto/signature.mjs +1 -1
  165. package/dist/esm/core/crypto/signature.mjs.map +1 -1
  166. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  167. package/dist/esm/core/crypto/singleKey.mjs.map +1 -1
  168. package/dist/esm/core/crypto/types.mjs +0 -1
  169. package/dist/esm/core/crypto/utils.mjs +1 -1
  170. package/dist/esm/core/crypto/utils.mjs.map +1 -1
  171. package/dist/esm/core/hex.mjs +1 -1
  172. package/dist/esm/core/hex.mjs.map +1 -1
  173. package/dist/esm/core/index.d.mts +1 -1
  174. package/dist/esm/core/index.mjs +1 -1
  175. package/dist/esm/core/index.mjs.map +1 -1
  176. package/dist/esm/errors/index.mjs +6 -1
  177. package/dist/esm/errors/index.mjs.map +1 -1
  178. package/dist/esm/index.d.mts +2 -2
  179. package/dist/esm/index.mjs +1 -1
  180. package/dist/esm/index.mjs.map +1 -1
  181. package/dist/esm/internal/abstraction.mjs +1 -1
  182. package/dist/esm/internal/abstraction.mjs.map +1 -1
  183. package/dist/esm/internal/account.mjs +1 -1
  184. package/dist/esm/internal/account.mjs.map +1 -1
  185. package/dist/esm/internal/ans.mjs +1 -1
  186. package/dist/esm/internal/ans.mjs.map +1 -1
  187. package/dist/esm/internal/coin.mjs +1 -1
  188. package/dist/esm/internal/coin.mjs.map +1 -1
  189. package/dist/esm/internal/digitalAsset.mjs +1 -1
  190. package/dist/esm/internal/digitalAsset.mjs.map +1 -1
  191. package/dist/esm/internal/faucet.mjs +1 -1
  192. package/dist/esm/internal/faucet.mjs.map +1 -1
  193. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  194. package/dist/esm/internal/fungibleAsset.mjs.map +1 -1
  195. package/dist/esm/internal/general.mjs +1 -1
  196. package/dist/esm/internal/general.mjs.map +1 -1
  197. package/dist/esm/internal/keyless.mjs +1 -1
  198. package/dist/esm/internal/keyless.mjs.map +1 -1
  199. package/dist/esm/internal/object.mjs +1 -1
  200. package/dist/esm/internal/object.mjs.map +1 -1
  201. package/dist/esm/internal/staking.mjs +1 -1
  202. package/dist/esm/internal/staking.mjs.map +1 -1
  203. package/dist/esm/internal/table.mjs +1 -1
  204. package/dist/esm/internal/table.mjs.map +1 -1
  205. package/dist/esm/internal/transaction.mjs +1 -1
  206. package/dist/esm/internal/transaction.mjs.map +1 -1
  207. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  208. package/dist/esm/internal/transactionSubmission.mjs.map +1 -1
  209. package/dist/esm/internal/utils/index.mjs +1 -1
  210. package/dist/esm/internal/utils/index.mjs.map +1 -1
  211. package/dist/esm/internal/utils/utils.mjs +1 -1
  212. package/dist/esm/internal/utils/utils.mjs.map +1 -1
  213. package/dist/esm/internal/view.mjs +1 -1
  214. package/dist/esm/internal/view.mjs.map +1 -1
  215. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  216. package/dist/esm/transactions/authenticator/account.mjs.map +1 -1
  217. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  218. package/dist/esm/transactions/authenticator/index.mjs.map +1 -1
  219. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  220. package/dist/esm/transactions/authenticator/transaction.mjs.map +1 -1
  221. package/dist/esm/transactions/index.mjs +1 -1
  222. package/dist/esm/transactions/index.mjs.map +1 -1
  223. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  224. package/dist/esm/transactions/instances/chainId.mjs.map +1 -1
  225. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  226. package/dist/esm/transactions/instances/identifier.mjs.map +1 -1
  227. package/dist/esm/transactions/instances/index.mjs +1 -1
  228. package/dist/esm/transactions/instances/index.mjs.map +1 -1
  229. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  230. package/dist/esm/transactions/instances/moduleId.mjs.map +1 -1
  231. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  232. package/dist/esm/transactions/instances/multiAgentTransaction.mjs.map +1 -1
  233. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  234. package/dist/esm/transactions/instances/rawTransaction.mjs.map +1 -1
  235. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  236. package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +1 -1
  237. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  238. package/dist/esm/transactions/instances/signedTransaction.mjs.map +1 -1
  239. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  240. package/dist/esm/transactions/instances/simpleTransaction.mjs.map +1 -1
  241. package/dist/esm/transactions/instances/transactionArgument.mjs +0 -1
  242. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  243. package/dist/esm/transactions/instances/transactionPayload.mjs.map +1 -1
  244. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  245. package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +1 -1
  246. package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
  247. package/dist/esm/transactions/management/asyncQueue.mjs.map +1 -1
  248. package/dist/esm/transactions/management/index.mjs +1 -1
  249. package/dist/esm/transactions/management/index.mjs.map +1 -1
  250. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  251. package/dist/esm/transactions/management/transactionWorker.mjs.map +1 -1
  252. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  253. package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +1 -1
  254. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  255. package/dist/esm/transactions/transactionBuilder/index.mjs.map +1 -1
  256. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  257. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +1 -1
  258. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  259. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -1
  260. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
  261. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  262. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +1 -1
  263. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  264. package/dist/esm/transactions/typeTag/index.mjs.map +1 -1
  265. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  266. package/dist/esm/transactions/typeTag/parser.mjs.map +1 -1
  267. package/dist/esm/transactions/types.mjs +0 -1
  268. package/dist/esm/types/abstraction.mjs +1 -1
  269. package/dist/esm/types/abstraction.mjs.map +1 -1
  270. package/dist/esm/types/generated/queries.mjs +493 -1
  271. package/dist/esm/types/generated/queries.mjs.map +1 -1
  272. package/dist/esm/types/generated/types.mjs +1 -1
  273. package/dist/esm/types/generated/types.mjs.map +1 -1
  274. package/dist/esm/types/index.mjs +1 -1
  275. package/dist/esm/types/index.mjs.map +1 -1
  276. package/dist/esm/types/indexer.mjs +0 -1
  277. package/dist/esm/types/types.mjs +1 -1
  278. package/dist/esm/types/types.mjs.map +1 -1
  279. package/dist/esm/utils/apiEndpoints.d.mts +1 -0
  280. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  281. package/dist/esm/utils/apiEndpoints.mjs.map +1 -1
  282. package/dist/esm/utils/const.mjs +1 -1
  283. package/dist/esm/utils/const.mjs.map +1 -1
  284. package/dist/esm/utils/helpers.mjs +1 -1
  285. package/dist/esm/utils/helpers.mjs.map +1 -1
  286. package/dist/esm/utils/index.mjs +1 -1
  287. package/dist/esm/utils/index.mjs.map +1 -1
  288. package/dist/esm/utils/memoize.mjs +1 -1
  289. package/dist/esm/utils/memoize.mjs.map +1 -1
  290. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  291. package/dist/esm/utils/normalizeBundle.mjs.map +1 -1
  292. package/dist/esm/version.d.mts +1 -1
  293. package/dist/esm/version.mjs +1 -1
  294. package/dist/esm/version.mjs.map +1 -1
  295. package/package.json +39 -20
  296. package/src/api/aptos.ts +193 -51
  297. package/src/core/account/utils/address.ts +22 -0
  298. package/src/internal/ans.ts +1 -0
  299. package/src/utils/apiEndpoints.ts +7 -0
  300. package/src/version.ts +1 -1
  301. package/dist/common/chunk-A2XB7TVI.js +0 -4
  302. package/dist/esm/chunk-2PASUPUO.mjs +0 -2
  303. package/dist/esm/chunk-2PASUPUO.mjs.map +0 -1
  304. package/dist/esm/chunk-2XQKGWHQ.mjs +0 -2
  305. package/dist/esm/chunk-2XQKGWHQ.mjs.map +0 -1
  306. package/dist/esm/chunk-35DKMW7Q.mjs +0 -2
  307. package/dist/esm/chunk-35DKMW7Q.mjs.map +0 -1
  308. package/dist/esm/chunk-4AI7KQQ7.mjs +0 -2
  309. package/dist/esm/chunk-4AI7KQQ7.mjs.map +0 -1
  310. package/dist/esm/chunk-4QMXOWHP.mjs +0 -1
  311. package/dist/esm/chunk-4QMXOWHP.mjs.map +0 -1
  312. package/dist/esm/chunk-4RXKALLC.mjs +0 -2
  313. package/dist/esm/chunk-4RXKALLC.mjs.map +0 -1
  314. package/dist/esm/chunk-4WPQQPUF.mjs +0 -1
  315. package/dist/esm/chunk-4WPQQPUF.mjs.map +0 -1
  316. package/dist/esm/chunk-56CNRT2K.mjs +0 -2
  317. package/dist/esm/chunk-56CNRT2K.mjs.map +0 -1
  318. package/dist/esm/chunk-5HXLZHDW.mjs +0 -1
  319. package/dist/esm/chunk-5HXLZHDW.mjs.map +0 -1
  320. package/dist/esm/chunk-6OWBKU7N.mjs +0 -2
  321. package/dist/esm/chunk-6OWBKU7N.mjs.map +0 -1
  322. package/dist/esm/chunk-6WDVDEQZ.mjs +0 -7
  323. package/dist/esm/chunk-6WDVDEQZ.mjs.map +0 -1
  324. package/dist/esm/chunk-7DQDJ2SA.mjs +0 -2
  325. package/dist/esm/chunk-7DQDJ2SA.mjs.map +0 -1
  326. package/dist/esm/chunk-7ECCT6PK.mjs +0 -1
  327. package/dist/esm/chunk-7ECCT6PK.mjs.map +0 -1
  328. package/dist/esm/chunk-7EER7GWV.mjs +0 -2
  329. package/dist/esm/chunk-7EER7GWV.mjs.map +0 -1
  330. package/dist/esm/chunk-A5L76YP7.mjs +0 -2
  331. package/dist/esm/chunk-A5L76YP7.mjs.map +0 -1
  332. package/dist/esm/chunk-AMXZQPUQ.mjs +0 -2
  333. package/dist/esm/chunk-AMXZQPUQ.mjs.map +0 -1
  334. package/dist/esm/chunk-B563XRSZ.mjs +0 -2
  335. package/dist/esm/chunk-B563XRSZ.mjs.map +0 -1
  336. package/dist/esm/chunk-C3Q23D22.mjs +0 -2
  337. package/dist/esm/chunk-C3Q23D22.mjs.map +0 -1
  338. package/dist/esm/chunk-CIJA7ONS.mjs +0 -2
  339. package/dist/esm/chunk-CIJA7ONS.mjs.map +0 -1
  340. package/dist/esm/chunk-CW35YAMN.mjs +0 -2
  341. package/dist/esm/chunk-CW35YAMN.mjs.map +0 -1
  342. package/dist/esm/chunk-EBMEXURY.mjs +0 -2
  343. package/dist/esm/chunk-EBMEXURY.mjs.map +0 -1
  344. package/dist/esm/chunk-EF4FA5I6.mjs +0 -2
  345. package/dist/esm/chunk-EF4FA5I6.mjs.map +0 -1
  346. package/dist/esm/chunk-FD6FGKYY.mjs +0 -1
  347. package/dist/esm/chunk-FD6FGKYY.mjs.map +0 -1
  348. package/dist/esm/chunk-FGFLPH5K.mjs +0 -2
  349. package/dist/esm/chunk-FGFLPH5K.mjs.map +0 -1
  350. package/dist/esm/chunk-FLZPUYXQ.mjs +0 -2
  351. package/dist/esm/chunk-FLZPUYXQ.mjs.map +0 -1
  352. package/dist/esm/chunk-FZY4PMEE.mjs +0 -1
  353. package/dist/esm/chunk-FZY4PMEE.mjs.map +0 -1
  354. package/dist/esm/chunk-G3MHXDYA.mjs +0 -1
  355. package/dist/esm/chunk-G3MHXDYA.mjs.map +0 -1
  356. package/dist/esm/chunk-GOXRBEIJ.mjs +0 -2
  357. package/dist/esm/chunk-GOXRBEIJ.mjs.map +0 -1
  358. package/dist/esm/chunk-HGLO5LDS.mjs +0 -1
  359. package/dist/esm/chunk-HGLO5LDS.mjs.map +0 -1
  360. package/dist/esm/chunk-HNBVYE3N.mjs +0 -2
  361. package/dist/esm/chunk-HNBVYE3N.mjs.map +0 -1
  362. package/dist/esm/chunk-I7XT6L7S.mjs +0 -2
  363. package/dist/esm/chunk-I7XT6L7S.mjs.map +0 -1
  364. package/dist/esm/chunk-IF4UU2MT.mjs +0 -2
  365. package/dist/esm/chunk-IF4UU2MT.mjs.map +0 -1
  366. package/dist/esm/chunk-JABP65XD.mjs +0 -2
  367. package/dist/esm/chunk-JABP65XD.mjs.map +0 -1
  368. package/dist/esm/chunk-KDMSOCZY.mjs +0 -2
  369. package/dist/esm/chunk-KDMSOCZY.mjs.map +0 -1
  370. package/dist/esm/chunk-L72TIN7T.mjs +0 -4
  371. package/dist/esm/chunk-L72TIN7T.mjs.map +0 -1
  372. package/dist/esm/chunk-M3AO73ZL.mjs +0 -2
  373. package/dist/esm/chunk-M3AO73ZL.mjs.map +0 -1
  374. package/dist/esm/chunk-MCFQE4GC.mjs +0 -2
  375. package/dist/esm/chunk-MCFQE4GC.mjs.map +0 -1
  376. package/dist/esm/chunk-MT2RJ7H3.mjs +0 -2
  377. package/dist/esm/chunk-MT2RJ7H3.mjs.map +0 -1
  378. package/dist/esm/chunk-N6YTF76Q.mjs +0 -2
  379. package/dist/esm/chunk-N6YTF76Q.mjs.map +0 -1
  380. package/dist/esm/chunk-NECL5FCQ.mjs +0 -1
  381. package/dist/esm/chunk-NECL5FCQ.mjs.map +0 -1
  382. package/dist/esm/chunk-OLILO7VD.mjs +0 -2
  383. package/dist/esm/chunk-OLILO7VD.mjs.map +0 -1
  384. package/dist/esm/chunk-ORMOQWWH.mjs +0 -2
  385. package/dist/esm/chunk-ORMOQWWH.mjs.map +0 -1
  386. package/dist/esm/chunk-Q4W3WJ2U.mjs +0 -2
  387. package/dist/esm/chunk-Q4W3WJ2U.mjs.map +0 -1
  388. package/dist/esm/chunk-QP2BY4PK.mjs +0 -2
  389. package/dist/esm/chunk-QP2BY4PK.mjs.map +0 -1
  390. package/dist/esm/chunk-QREVMGQZ.mjs +0 -2
  391. package/dist/esm/chunk-QREVMGQZ.mjs.map +0 -1
  392. package/dist/esm/chunk-RCSJFTST.mjs +0 -2
  393. package/dist/esm/chunk-RCSJFTST.mjs.map +0 -1
  394. package/dist/esm/chunk-RGKRCZ36.mjs +0 -4
  395. package/dist/esm/chunk-RGKRCZ36.mjs.map +0 -1
  396. package/dist/esm/chunk-SJDCGNWU.mjs +0 -2
  397. package/dist/esm/chunk-SJDCGNWU.mjs.map +0 -1
  398. package/dist/esm/chunk-STY74NUA.mjs +0 -2
  399. package/dist/esm/chunk-STY74NUA.mjs.map +0 -1
  400. package/dist/esm/chunk-TOBQ5UE6.mjs +0 -2
  401. package/dist/esm/chunk-TOBQ5UE6.mjs.map +0 -1
  402. package/dist/esm/chunk-UL777LTI.mjs +0 -494
  403. package/dist/esm/chunk-UL777LTI.mjs.map +0 -1
  404. package/dist/esm/chunk-UYVPNUH3.mjs +0 -1
  405. package/dist/esm/chunk-UYVPNUH3.mjs.map +0 -1
  406. package/dist/esm/chunk-V3MBJJTL.mjs +0 -1
  407. package/dist/esm/chunk-V3MBJJTL.mjs.map +0 -1
  408. package/dist/esm/chunk-WCMW2L3P.mjs +0 -2
  409. package/dist/esm/chunk-WCMW2L3P.mjs.map +0 -1
  410. package/dist/esm/chunk-WHSTLR3F.mjs +0 -2
  411. package/dist/esm/chunk-WHSTLR3F.mjs.map +0 -1
  412. package/dist/esm/chunk-WSR5EBJM.mjs +0 -2
  413. package/dist/esm/chunk-WSR5EBJM.mjs.map +0 -1
  414. package/dist/esm/chunk-XJJVJOX5.mjs +0 -2
  415. package/dist/esm/chunk-XJJVJOX5.mjs.map +0 -1
  416. package/dist/esm/chunk-XKUIMGKU.mjs +0 -2
  417. package/dist/esm/chunk-XKUIMGKU.mjs.map +0 -1
  418. package/dist/esm/chunk-YOZBVVKL.mjs +0 -2
  419. package/dist/esm/chunk-YOZBVVKL.mjs.map +0 -1
  420. package/dist/esm/chunk-ZP4DWSQA.mjs +0 -2
  421. package/dist/esm/chunk-ZP4DWSQA.mjs.map +0 -1
package/src/api/aptos.ts CHANGED
@@ -44,29 +44,23 @@ import { AccountAbstraction } from "./account/abstraction";
44
44
  export class Aptos {
45
45
  readonly config: AptosConfig;
46
46
 
47
- readonly account: Account;
47
+ // Private fields to store lazy-loaded instances
48
+ private _account?: Account;
49
+ private _abstraction?: AccountAbstraction;
50
+ private _ans?: ANS;
51
+ private _coin?: Coin;
52
+ private _digitalAsset?: DigitalAsset;
53
+ private _faucet?: Faucet;
54
+ private _fungibleAsset?: FungibleAsset;
55
+ private _general?: General;
56
+ private _staking?: Staking;
57
+ private _transaction?: Transaction;
58
+ private _table?: Table;
59
+ private _keyless?: Keyless;
60
+ private _object?: AptosObject;
48
61
 
49
- readonly ans: ANS;
50
-
51
- readonly coin: Coin;
52
-
53
- readonly digitalAsset: DigitalAsset;
54
-
55
- readonly faucet: Faucet;
56
-
57
- readonly fungibleAsset: FungibleAsset;
58
-
59
- readonly general: General;
60
-
61
- readonly staking: Staking;
62
-
63
- readonly transaction: Transaction;
64
-
65
- readonly table: Table;
66
-
67
- readonly keyless: Keyless;
68
-
69
- readonly object: AptosObject;
62
+ // Track which mixins have been applied
63
+ static mixinsApplied = new Set<string>();
70
64
 
71
65
  /**
72
66
  * Initializes a new instance of the Aptos client with the provided configuration settings.
@@ -91,19 +85,162 @@ export class Aptos {
91
85
  */
92
86
  constructor(config?: AptosConfig) {
93
87
  this.config = config ?? new AptosConfig();
94
- this.account = new Account(this.config);
95
- this.abstraction = new AccountAbstraction(this.config);
96
- this.ans = new ANS(this.config);
97
- this.coin = new Coin(this.config);
98
- this.digitalAsset = new DigitalAsset(this.config);
99
- this.faucet = new Faucet(this.config);
100
- this.fungibleAsset = new FungibleAsset(this.config);
101
- this.general = new General(this.config);
102
- this.staking = new Staking(this.config);
103
- this.transaction = new Transaction(this.config);
104
- this.table = new Table(this.config);
105
- this.keyless = new Keyless(this.config);
106
- this.object = new AptosObject(this.config);
88
+ }
89
+
90
+ /**
91
+ * Lazy-loaded getter for Account functionality.
92
+ * Only instantiates and applies mixin when first accessed.
93
+ */
94
+ get account(): Account {
95
+ if (!this._account) {
96
+ ensureMixinApplied(Aptos, Account, "account");
97
+ this._account = new Account(this.config);
98
+ }
99
+ return this._account;
100
+ }
101
+
102
+ /**
103
+ * Lazy-loaded getter for AccountAbstraction functionality.
104
+ * Only instantiates and applies mixin when first accessed.
105
+ */
106
+ get abstraction(): AccountAbstraction {
107
+ if (!this._abstraction) {
108
+ ensureMixinApplied(Aptos, AccountAbstraction, "abstraction");
109
+ this._abstraction = new AccountAbstraction(this.config);
110
+ }
111
+ return this._abstraction;
112
+ }
113
+
114
+ /**
115
+ * Lazy-loaded getter for ANS functionality.
116
+ * Only instantiates and applies mixin when first accessed.
117
+ */
118
+ get ans(): ANS {
119
+ if (!this._ans) {
120
+ ensureMixinApplied(Aptos, ANS, "ans");
121
+ this._ans = new ANS(this.config);
122
+ }
123
+ return this._ans;
124
+ }
125
+
126
+ /**
127
+ * Lazy-loaded getter for Coin functionality.
128
+ * Only instantiates and applies mixin when first accessed.
129
+ */
130
+ get coin(): Coin {
131
+ if (!this._coin) {
132
+ ensureMixinApplied(Aptos, Coin, "coin");
133
+ this._coin = new Coin(this.config);
134
+ }
135
+ return this._coin;
136
+ }
137
+
138
+ /**
139
+ * Lazy-loaded getter for DigitalAsset functionality.
140
+ * Only instantiates and applies mixin when first accessed.
141
+ */
142
+ get digitalAsset(): DigitalAsset {
143
+ if (!this._digitalAsset) {
144
+ ensureMixinApplied(Aptos, DigitalAsset, "digitalAsset");
145
+ this._digitalAsset = new DigitalAsset(this.config);
146
+ }
147
+ return this._digitalAsset;
148
+ }
149
+
150
+ /**
151
+ * Lazy-loaded getter for Faucet functionality.
152
+ * Only instantiates and applies mixin when first accessed.
153
+ */
154
+ get faucet(): Faucet {
155
+ if (!this._faucet) {
156
+ ensureMixinApplied(Aptos, Faucet, "faucet");
157
+ this._faucet = new Faucet(this.config);
158
+ }
159
+ return this._faucet;
160
+ }
161
+
162
+ /**
163
+ * Lazy-loaded getter for FungibleAsset functionality.
164
+ * Only instantiates and applies mixin when first accessed.
165
+ */
166
+ get fungibleAsset(): FungibleAsset {
167
+ if (!this._fungibleAsset) {
168
+ ensureMixinApplied(Aptos, FungibleAsset, "fungibleAsset");
169
+ this._fungibleAsset = new FungibleAsset(this.config);
170
+ }
171
+ return this._fungibleAsset;
172
+ }
173
+
174
+ /**
175
+ * Lazy-loaded getter for General functionality.
176
+ * Only instantiates and applies mixin when first accessed.
177
+ */
178
+ get general(): General {
179
+ if (!this._general) {
180
+ ensureMixinApplied(Aptos, General, "general");
181
+ this._general = new General(this.config);
182
+ }
183
+ return this._general;
184
+ }
185
+
186
+ /**
187
+ * Lazy-loaded getter for Staking functionality.
188
+ * Only instantiates and applies mixin when first accessed.
189
+ */
190
+ get staking(): Staking {
191
+ if (!this._staking) {
192
+ ensureMixinApplied(Aptos, Staking, "staking");
193
+ this._staking = new Staking(this.config);
194
+ }
195
+ return this._staking;
196
+ }
197
+
198
+ /**
199
+ * Lazy-loaded getter for Transaction functionality.
200
+ * Only instantiates and applies mixin when first accessed.
201
+ */
202
+ get transaction(): Transaction {
203
+ if (!this._transaction) {
204
+ ensureMixinApplied(Aptos, Transaction, "transaction");
205
+ this._transaction = new Transaction(this.config);
206
+ }
207
+ return this._transaction;
208
+ }
209
+
210
+ /**
211
+ * Lazy-loaded getter for Table functionality.
212
+ * Only instantiates and applies mixin when first accessed.
213
+ */
214
+ get table(): Table {
215
+ if (!this._table) {
216
+ ensureMixinApplied(Aptos, Table, "table");
217
+ this._table = new Table(this.config);
218
+ }
219
+ return this._table;
220
+ }
221
+
222
+ /**
223
+ * Lazy-loaded getter for Keyless functionality.
224
+ * Only instantiates and applies mixin when first accessed.
225
+ */
226
+ get keyless(): Keyless {
227
+ if (!this._keyless) {
228
+ ensureMixinApplied(Aptos, Keyless, "keyless");
229
+ this._keyless = new Keyless(this.config);
230
+ }
231
+ return this._keyless;
232
+ }
233
+
234
+ /**
235
+ * Lazy-loaded getter for AptosObject functionality.
236
+ * Only instantiates and applies mixin when first accessed.
237
+ */
238
+ get object(): AptosObject {
239
+ if (!this._object) {
240
+ ensureMixinApplied(Aptos, AptosObject, "object");
241
+ this._object = new AptosObject(this.config);
242
+ }
243
+ return this._object;
107
244
  }
108
245
 
109
246
  setIgnoreTransactionSubmitter(ignore: boolean) {
@@ -113,12 +250,13 @@ export class Aptos {
113
250
 
114
251
  // extends Aptos interface so all the methods and properties
115
252
  // from the other classes will be recognized by typescript.
253
+ // Note: Mixins are applied lazily when the corresponding property is first accessed.
116
254
  export interface Aptos
117
255
  extends Account,
256
+ AccountAbstraction,
118
257
  ANS,
119
258
  Coin,
120
259
  DigitalAsset,
121
- Event,
122
260
  Faucet,
123
261
  FungibleAsset,
124
262
  General,
@@ -129,7 +267,7 @@ export interface Aptos
129
267
  Omit<Transaction, "build" | "simulate" | "submit" | "batch"> {}
130
268
 
131
269
  /**
132
- In TypeScript, we cant inherit or extend from more than one class,
270
+ In TypeScript, we can't inherit or extend from more than one class,
133
271
  Mixins helps us to get around that by creating a partial classes
134
272
  that we can combine to form a single class that contains all the methods and properties from the partial classes.
135
273
  {@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}
@@ -143,6 +281,11 @@ function applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {
143
281
  const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);
144
282
  if (!propertyDescriptor) return;
145
283
 
284
+ // Skip constructor and properties that already exist
285
+ if (propertyName === "constructor" || targetClass.prototype[propertyName]) {
286
+ return;
287
+ }
288
+
146
289
  // Define new method that calls through baseClassProp
147
290
  Object.defineProperty(targetClass.prototype, propertyName, {
148
291
  value: function (...args: any[]) {
@@ -155,17 +298,16 @@ function applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {
155
298
  });
156
299
  }
157
300
 
158
- applyMixin(Aptos, Account, "account");
159
- applyMixin(Aptos, AccountAbstraction, "abstraction");
160
- applyMixin(Aptos, ANS, "ans");
161
- applyMixin(Aptos, Coin, "coin");
162
- applyMixin(Aptos, DigitalAsset, "digitalAsset");
163
- applyMixin(Aptos, Event, "event");
164
- applyMixin(Aptos, Faucet, "faucet");
165
- applyMixin(Aptos, FungibleAsset, "fungibleAsset");
166
- applyMixin(Aptos, General, "general");
167
- applyMixin(Aptos, Staking, "staking");
168
- applyMixin(Aptos, Transaction, "transaction");
169
- applyMixin(Aptos, Table, "table");
170
- applyMixin(Aptos, Keyless, "keyless");
171
- applyMixin(Aptos, AptosObject, "object");
301
+ /**
302
+ * Ensures a mixin is applied only once when the corresponding functionality is first accessed.
303
+ * This enables lazy loading - mixins are only applied when their functionality is actually used.
304
+ */
305
+ function ensureMixinApplied(targetClass: any, baseClass: any, baseClassProp: string) {
306
+ const mixinKey = `${targetClass.name}-${baseClass.name}-${baseClassProp}`;
307
+ if (Aptos.mixinsApplied.has(mixinKey)) {
308
+ return;
309
+ }
310
+
311
+ applyMixin(targetClass, baseClass, baseClassProp);
312
+ Aptos.mixinsApplied.add(mixinKey);
313
+ }
@@ -42,6 +42,28 @@ export const createResourceAddress = (creatorAddress: AccountAddress, seed: Uint
42
42
  return new AccountAddress(sha3_256(bytes));
43
43
  };
44
44
 
45
+ /**
46
+ * Creates a user derived object address from source address and derive_from address
47
+ *
48
+ * @param sourceAddress The source account address
49
+ * @param deriveFromAddress The address to derive from
50
+ *
51
+ * @returns The user derived object address
52
+ * @group Implementation
53
+ * @category Account (On-Chain Model)
54
+ */
55
+ export const createUserDerivedObjectAddress = (
56
+ sourceAddress: AccountAddress,
57
+ deriveFromAddress: AccountAddress,
58
+ ): AccountAddress => {
59
+ const sourceBytes = sourceAddress.bcsToBytes();
60
+ const deriveFromBytes = deriveFromAddress.bcsToBytes();
61
+
62
+ const bytes = new Uint8Array([...sourceBytes, ...deriveFromBytes, DeriveScheme.DeriveObjectAddressFromObject]);
63
+
64
+ return new AccountAddress(sha3_256(bytes));
65
+ };
66
+
45
67
  /**
46
68
  * Creates a token object address from creator address, collection name and token name
47
69
  *
@@ -122,6 +122,7 @@ const NetworkToAnsContract: Record<Network, string | null> = {
122
122
  [Network.LOCAL]: LOCAL_ANS_ACCOUNT_ADDRESS,
123
123
  [Network.CUSTOM]: null,
124
124
  [Network.DEVNET]: null,
125
+ [Network.SHELBYNET]: null,
125
126
  };
126
127
 
127
128
  /**
@@ -9,6 +9,7 @@ export const NetworkToIndexerAPI: Record<string, string> = {
9
9
  mainnet: "https://api.mainnet.aptoslabs.com/v1/graphql",
10
10
  testnet: "https://api.testnet.aptoslabs.com/v1/graphql",
11
11
  devnet: "https://api.devnet.aptoslabs.com/v1/graphql",
12
+ shelbynet: "https://api.shelbynet.shelby.xyz/v1/graphql",
12
13
  local: "http://127.0.0.1:8090/v1/graphql",
13
14
  };
14
15
 
@@ -20,6 +21,7 @@ export const NetworkToNodeAPI: Record<string, string> = {
20
21
  mainnet: "https://api.mainnet.aptoslabs.com/v1",
21
22
  testnet: "https://api.testnet.aptoslabs.com/v1",
22
23
  devnet: "https://api.devnet.aptoslabs.com/v1",
24
+ shelbynet: "https://api.shelbynet.shelby.xyz/v1",
23
25
  local: "http://127.0.0.1:8080/v1",
24
26
  };
25
27
 
@@ -29,6 +31,7 @@ export const NetworkToNodeAPI: Record<string, string> = {
29
31
  */
30
32
  export const NetworkToFaucetAPI: Record<string, string> = {
31
33
  devnet: "https://faucet.devnet.aptoslabs.com",
34
+ shelbynet: "https://faucet.shelbynet.shelby.xyz",
32
35
  local: "http://127.0.0.1:8081",
33
36
  };
34
37
 
@@ -40,6 +43,7 @@ export const NetworkToPepperAPI: Record<string, string> = {
40
43
  mainnet: "https://api.mainnet.aptoslabs.com/keyless/pepper/v0",
41
44
  testnet: "https://api.testnet.aptoslabs.com/keyless/pepper/v0",
42
45
  devnet: "https://api.devnet.aptoslabs.com/keyless/pepper/v0",
46
+ shelbynet: "https://api.devnet.aptoslabs.com/keyless/pepper/v0",
43
47
  // Use the devnet service for local environment
44
48
  local: "https://api.devnet.aptoslabs.com/keyless/pepper/v0",
45
49
  };
@@ -52,6 +56,7 @@ export const NetworkToProverAPI: Record<string, string> = {
52
56
  mainnet: "https://api.mainnet.aptoslabs.com/keyless/prover/v0",
53
57
  testnet: "https://api.testnet.aptoslabs.com/keyless/prover/v0",
54
58
  devnet: "https://api.devnet.aptoslabs.com/keyless/prover/v0",
59
+ shelbynet: "https://api.devnet.aptoslabs.com/keyless/prover/v0",
55
60
  // Use the devnet service for local environment
56
61
  local: "https://api.devnet.aptoslabs.com/keyless/prover/v0",
57
62
  };
@@ -65,6 +70,7 @@ export enum Network {
65
70
  MAINNET = "mainnet",
66
71
  TESTNET = "testnet",
67
72
  DEVNET = "devnet",
73
+ SHELBYNET = "shelbynet",
68
74
  LOCAL = "local",
69
75
  CUSTOM = "custom",
70
76
  }
@@ -87,6 +93,7 @@ export const NetworkToNetworkName: Record<string, Network> = {
87
93
  mainnet: Network.MAINNET,
88
94
  testnet: Network.TESTNET,
89
95
  devnet: Network.DEVNET,
96
+ shelbynet: Network.SHELBYNET,
90
97
  local: Network.LOCAL,
91
98
  custom: Network.CUSTOM,
92
99
  };
package/src/version.ts CHANGED
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * hardcoded for now, we would want to have it injected dynamically
8
8
  */
9
- export const VERSION = "5.1.0";
9
+ export const VERSION = "5.1.1";
@@ -1,4 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var N=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var h=(t,e,r,n)=>{for(var s=n>1?void 0:n?C(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(s=(n?u(e,r,s):u(s))||s);return n&&s&&N(e,r,s),s};var c=class extends Error{constructor(e,r){super(e),this.invalidReason=r}};var _utils = require('@noble/hashes/utils');var O=(n=>(n.TOO_SHORT="too_short",n.INVALID_LENGTH="invalid_length",n.INVALID_HEX_CHARS="invalid_hex_chars",n))(O||{}),_= exports.j =class t{constructor(e){this.data=e}toUint8Array(){return this.data}toStringWithoutPrefix(){return _utils.bytesToHex.call(void 0, this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(e){let r=e;if(r.startsWith("0x")&&(r=r.slice(2)),r.length===0)throw new c("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 c("Hex string must be an even number of hex characters.","invalid_length");try{return new t(_utils.hexToBytes.call(void 0, r))}catch(n){throw new c(`Hex string contains invalid hex characters: ${_optionalChain([n, 'optionalAccess', _2 => _2.message])}`,"invalid_hex_chars")}}static fromHexInput(e){return e instanceof Uint8Array?new t(e):t.fromHexString(e)}static hexInputToUint8Array(e){return e instanceof Uint8Array?e:t.fromHexString(e).toUint8Array()}static hexInputToString(e){return t.fromHexInput(e).toString()}static hexInputToStringWithoutPrefix(e){return t.fromHexInput(e).toStringWithoutPrefix()}static isValid(e){try{return t.fromHexString(e),{valid:!0}}catch(r){return{valid:!1,invalidReason:_optionalChain([r, 'optionalAccess', _3 => _3.invalidReason]),invalidReasonMessage:_optionalChain([r, 'optionalAccess', _4 => _4.message])}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((r,n)=>r===e.data[n])}},_e= exports.k =t=>new TextDecoder().decode(_.fromHexInput(t).toUint8Array());var R=255,U= exports.c =65535,x= exports.d =4294967295,S= exports.e =18446744073709551615n,b= exports.f =340282366920938463463374607431768211455n,v= exports.g =115792089237316195423570985008687907853269984665640564039457584007913129639935n;var m=class{bcsToBytes(){let e=new l;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return _.fromHexInput(e)}toStringWithoutPrefix(){return this.bcsToHex().toStringWithoutPrefix()}toString(){return`0x${this.toStringWithoutPrefix()}`}},l= exports.m =class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let r=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(r).set(new Uint8Array(this.buffer)),this.buffer=r}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,r,n){this.ensureBufferWillHandleSize(r);let s=new DataView(this.buffer,this.offset);e.apply(s,[0,n,!0]),this.offset+=r}serializeStr(e){let r=new TextEncoder;this.serializeBytes(r.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){H(e);let r=e?1:0;this.appendToBuffer(new Uint8Array([r]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let r=BigInt(e)&BigInt(x),n=BigInt(e)>>BigInt(32);this.serializeU32(Number(r)),this.serializeU32(Number(n))}serializeU128(e){let r=BigInt(e)&S,n=BigInt(e)>>BigInt(64);this.serializeU64(r),this.serializeU64(n)}serializeU256(e){let r=BigInt(e)&b,n=BigInt(e)>>BigInt(128);this.serializeU128(r),this.serializeU128(n)}serializeU32AsUleb128(e){let r=e,n=[];for(;r>>>7;)n.push(r&127|128),r>>>=7;n.push(r),this.appendToBuffer(new Uint8Array(n))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(r=>{r.serialize(this)})}serializeOption(e,r){let n=e!==void 0;this.serializeBool(n),n&&(typeof e=="string"?this.serializeStr(e):e instanceof Uint8Array?r!==void 0?this.serializeFixedBytes(e):this.serializeBytes(e):e.serialize(this))}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};h([f(0,R)],l.prototype,"serializeU8",1),h([f(0,U)],l.prototype,"serializeU16",1),h([f(0,x)],l.prototype,"serializeU32",1),h([f(BigInt(0),S)],l.prototype,"serializeU64",1),h([f(BigInt(0),b)],l.prototype,"serializeU128",1),h([f(BigInt(0),v)],l.prototype,"serializeU256",1),h([f(0,x)],l.prototype,"serializeU32AsUleb128",1);function H(t){if(typeof t!="boolean")throw new Error(`${t} is not a boolean value`)}var D=(t,e,r)=>`${t} is out of range: [${e}, ${r}]`;function F(t,e,r){let n=BigInt(t);if(n>BigInt(r)||n<BigInt(e))throw new Error(D(t,e,r))}function f(t,e){return(r,n,s)=>{let i=s.value;return s.value=function(d){return F(d,t,e),i.apply(this,[d])},s}}var P=(s=>(s.JSON="application/json",s.BCS="application/x-bcs",s.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",s.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",s))(P||{}),W= exports.r =(a=>(a[a.Bool=0]="Bool",a[a.U8=1]="U8",a[a.U64=2]="U64",a[a.U128=3]="U128",a[a.Address=4]="Address",a[a.Signer=5]="Signer",a[a.Vector=6]="Vector",a[a.Struct=7]="Struct",a[a.U16=8]="U16",a[a.U32=9]="U32",a[a.U256=10]="U256",a[a.Reference=254]="Reference",a[a.Generic=255]="Generic",a))(W||{}),I= exports.s =(p=>(p[p.U8=0]="U8",p[p.U64=1]="U64",p[p.U128=2]="U128",p[p.Address=3]="Address",p[p.U8Vector=4]="U8Vector",p[p.Bool=5]="Bool",p[p.U16=6]="U16",p[p.U32=7]="U32",p[p.U256=8]="U256",p[p.Serialized=9]="Serialized",p))(I||{}),z= exports.t =(s=>(s[s.Script=0]="Script",s[s.EntryFunction=2]="EntryFunction",s[s.Multisig=3]="Multisig",s[s.Payload=4]="Payload",s))(z||{}),G= exports.u =(e=>(e[e.V1=0]="V1",e))(G||{}),L= exports.v =(n=>(n[n.Script=0]="Script",n[n.EntryFunction=1]="EntryFunction",n[n.Empty=2]="Empty",n))(L||{}),$= exports.w =(e=>(e[e.V1=0]="V1",e))($||{}),q= exports.x =(r=>(r[r.MultiAgentTransaction=0]="MultiAgentTransaction",r[r.FeePayerTransaction=1]="FeePayerTransaction",r))(q||{}),X= exports.y =(i=>(i[i.Ed25519=0]="Ed25519",i[i.MultiEd25519=1]="MultiEd25519",i[i.MultiAgent=2]="MultiAgent",i[i.FeePayer=3]="FeePayer",i[i.SingleSender=4]="SingleSender",i))(X||{}),K= exports.z =(u=>(u[u.Ed25519=0]="Ed25519",u[u.MultiEd25519=1]="MultiEd25519",u[u.SingleKey=2]="SingleKey",u[u.MultiKey=3]="MultiKey",u[u.NoAccountAuthenticator=4]="NoAccountAuthenticator",u[u.Abstraction=5]="Abstraction",u))(K||{}),Y= exports.A =(n=>(n.Ed25519="ed25519",n.Secp256k1="secp256k1",n.Secp256r1="secp256r1",n))(Y||{}),j= exports.B =(i=>(i[i.Ed25519=0]="Ed25519",i[i.Secp256k1=1]="Secp256k1",i[i.Secp256r1=2]="Secp256r1",i[i.Keyless=3]="Keyless",i[i.FederatedKeyless=4]="FederatedKeyless",i))(j||{});function Re(t){switch(t){case 0:return"ed25519";case 1:return"secp256k1";case 2:return"secp256r1";case 3:return"keyless";case 4:return"federated_keyless";default:throw new Error("Unknown public key variant")}}var Z=(s=>(s[s.Ed25519=0]="Ed25519",s[s.Secp256k1=1]="Secp256k1",s[s.WebAuthn=2]="WebAuthn",s[s.Keyless=3]="Keyless",s))(Z||{}),Q= exports.E =(e=>(e[e.Ed25519=0]="Ed25519",e))(Q||{}),J= exports.F =(e=>(e[e.Ed25519=0]="Ed25519",e))(J||{}),V= exports.G =(e=>(e[e.ZkProof=0]="ZkProof",e))(V||{}),ee= exports.H =(e=>(e[e.Groth16=0]="Groth16",e))(ee||{}),te= exports.I =(d=>(d.Pending="pending_transaction",d.User="user_transaction",d.Genesis="genesis_transaction",d.BlockMetadata="block_metadata_transaction",d.StateCheckpoint="state_checkpoint_transaction",d.Validator="validator_transaction",d.BlockEpilogue="block_epilogue_transaction",d))(te||{});function Ue(t){return t.type==="pending_transaction"}function ve(t){return t.type==="user_transaction"}function Ie(t){return t.type==="genesis_transaction"}function Me(t){return t.type==="block_metadata_transaction"}function Ee(t){return t.type==="state_checkpoint_transaction"}function Be(t){return t.type==="validator_transaction"}function Ne(t){return t.type==="block_epilogue_transaction"}function Ce(t){return"signature"in t&&t.type==="ed25519_signature"}function ke(t){return"signature"in t&&t.signature==="secp256k1_ecdsa_signature"}function we(t){return t.type==="multi_agent_signature"}function Oe(t){return t.type==="fee_payer_signature"}function He(t){return t.type==="multi_ed25519_signature"}function De(t){return t.type==="single_sender"}var re=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(re||{}),ne= exports.X =(s=>(s.STORE="store",s.DROP="drop",s.KEY="key",s.COPY="copy",s))(ne||{}),se= exports.Y =(r=>(r.VALIDATOR="validator",r.FULL_NODE="full_node",r))(se||{}),ie= exports.Z =(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.SingleKey=2]="SingleKey",s[s.MultiKey=3]="MultiKey",s))(ie||{}),oe= exports._ =(r=>(r[r.Ed25519=0]="Ed25519",r[r.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",r))(oe||{}),M= exports.$ =(i=>(i[i.DeriveAuid=251]="DeriveAuid",i[i.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",i[i.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",i[i.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",i[i.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",i))(M||{});var pe=(y=>(y.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",y.INVALID_HEX_CHARS="invalid_hex_chars",y.TOO_SHORT="too_short",y.TOO_LONG="too_long",y.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",y.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",y.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",y.INVALID_PADDING_STRICTNESS="INVALID_PADDING_STRICTNESS",y))(pe||{}),o=class o extends m{constructor(e){if(super(),e.length!==o.LENGTH)throw new c("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=_utils.bytesToHex.call(void 0, this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return _utils.bytesToHex.call(void 0, this.data)}toStringShort(){return`0x${this.toStringShortWithoutPrefix()}`}toStringShortWithoutPrefix(){let e=_utils.bytesToHex.call(void 0, this.data).replace(/^0+/,"");return e===""?"0":e}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let r=e.deserializeFixedBytes(o.LENGTH);return new o(r)}static fromStringStrict(e){if(!e.startsWith("0x"))throw new c("Hex string must start with a leading 0x.","leading_zero_x_required");let r=o.fromString(e);if(e.length!==o.LONG_STRING_LENGTH+2)if(r.isSpecial()){if(e.length!==3)throw new c(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new c(`The given hex string ${e} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return r}static fromString(e,{maxMissingChars:r=4}={}){let n=e;if(e.startsWith("0x")&&(n=e.slice(2)),n.length===0)throw new c("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new c("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");if(r>63||r<0)throw new c(`maxMissingChars must be between or equal to 0 and 63. Received ${r}`,"INVALID_PADDING_STRICTNESS");let s;try{s=_utils.hexToBytes.call(void 0, n.padStart(64,"0"))}catch(u){throw new c(`Hex characters are invalid: ${_optionalChain([u, 'optionalAccess', _5 => _5.message])}`,"invalid_hex_chars")}let i=new o(s);if(n.length<64-r&&!i.isSpecial())throw new c(`Hex string is too short, must be ${64-r} to 64 chars long, excluding the leading 0x. You may need to fix
2
- the addresss by padding it with 0s before passing it to \`fromString\` (e.g. <addressString>.padStart(64, '0')).
3
- Received ${e}`,"too_short");return i}static from(e,{maxMissingChars:r=4}={}){return typeof e=="string"?o.fromString(e,{maxMissingChars:r}):e instanceof Uint8Array?new o(e):e}static fromStrict(e){return typeof e=="string"?o.fromStringStrict(e):e instanceof Uint8Array?new o(e):e}static isValid(e){try{return e.strict?o.fromStrict(e.input):o.from(e.input),{valid:!0}}catch(r){return{valid:!1,invalidReason:_optionalChain([r, 'optionalAccess', _6 => _6.invalidReason]),invalidReasonMessage:_optionalChain([r, 'optionalAccess', _7 => _7.message])}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((r,n)=>r===e.data[n])}};o.LENGTH=32,o.LONG_STRING_LENGTH=64,o.ZERO=o.from("0x0"),o.ONE=o.from("0x1"),o.TWO=o.from("0x2"),o.THREE=o.from("0x3"),o.FOUR=o.from("0x4"),o.A=o.from("0xA");var g=o;var _sha3 = require('@noble/hashes/sha3');var T=(t,e)=>{let r=t.bcsToBytes(),n=typeof e=="string"?Buffer.from(e,"utf8"):e,s=new Uint8Array([...r,...n,254]);return new g(_sha3.sha3_256.call(void 0, s))},Ve= exports.da =(t,e)=>{let r=t.bcsToBytes(),n=typeof e=="string"?Buffer.from(e,"utf8"):e,s=new Uint8Array([...r,...n,255]);return new g(_sha3.sha3_256.call(void 0, s))},et= exports.ea =(t,e,r)=>{let n=`${e}::${r}`;return T(t,n)};var _jsbase64 = require('js-base64');async function it(t){return new Promise(e=>{setTimeout(e,t)})}function ot(t){return t instanceof Error?t.message:String(t)}var at=()=>Math.floor(Date.now()/1e3);function pt(t){let e=new Date(t*1e3);return e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),Math.floor(e.getTime()/1e3)}function ut(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r=e+"==".substring(0,(3-e.length%3)%3);return _jsbase64.decode.call(void 0, r)}function ct(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4!==0;)e+="=";return new Uint8Array(Buffer.from(e,"base64"))}var gt=(t,e)=>t*10**e,dt= exports.ma =(t,e)=>t/10**e,B=t=>{let e="";for(let r=2;r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substring(r,r+2),16));return e},lt= exports.na =t=>{let{account_address:e,module_name:r,struct_name:n}=t,s=B(r),i=B(n);return`${e}::${s}::${i}`},yt= exports.oa =t=>typeof t=="object"&&!Array.isArray(t)&&t!==null&&"account_address"in t&&"module_name"in t&&"struct_name"in t&&typeof t.account_address=="string"&&typeof t.module_name=="string"&&typeof t.struct_name=="string";function ht(t){let e=t.split("::");if(e.length!==3)throw new Error(`Invalid function ${t}`);let r=e[0],n=e[1],s=e[2];return{moduleAddress:r,moduleName:n,functionName:s}}function ft(t){let e=t.split("::");return e.length===3&&g.isValid({input:e[0]}).valid}function _t(t,e=6,r=5){return`${t.slice(0,e)}...${t.slice(-r)}`}var ce="0x1::aptos_coin::AptosCoin",xt=g.A.toStringLong();function ge(t){let e=/0x[0-9a-fA-F]+/g;return t.replace(e,r=>g.from(r,{maxMissingChars:63}).toStringShort())}function mt(t){let e=ge(t);return e===ce?g.A:T(g.A,e)}exports.a = h; exports.b = R; exports.c = U; exports.d = x; exports.e = S; exports.f = b; exports.g = v; exports.h = c; exports.i = O; exports.j = _; exports.k = _e; exports.l = m; exports.m = l; exports.n = H; exports.o = D; exports.p = F; exports.q = P; exports.r = W; exports.s = I; exports.t = z; exports.u = G; exports.v = L; exports.w = $; exports.x = q; exports.y = X; exports.z = K; exports.A = Y; exports.B = j; exports.C = Re; exports.D = Z; exports.E = Q; exports.F = J; exports.G = V; exports.H = ee; exports.I = te; exports.J = Ue; exports.K = ve; exports.L = Ie; exports.M = Me; exports.N = Ee; exports.O = Be; exports.P = Ne; exports.Q = Ce; exports.R = ke; exports.S = we; exports.T = Oe; exports.U = He; exports.V = De; exports.W = re; exports.X = ne; exports.Y = se; exports.Z = ie; exports._ = oe; exports.$ = M; exports.aa = pe; exports.ba = g; exports.ca = T; exports.da = Ve; exports.ea = et; exports.fa = it; exports.ga = ot; exports.ha = at; exports.ia = pt; exports.ja = ut; exports.ka = ct; exports.la = gt; exports.ma = dt; exports.na = lt; exports.oa = yt; exports.pa = ht; exports.qa = ft; exports.ra = _t; exports.sa = mt;
4
- //# sourceMappingURL=chunk-A2XB7TVI.js.map
@@ -1,2 +0,0 @@
1
- import{b as r}from"./chunk-STY74NUA.mjs";var a=class a{static formatPrivateKey(e,n){let i=a.AIP80_PREFIXES[n],t=e;return typeof t=="string"&&t.startsWith(i)&&(t=t.split("-")[2]),`${i}${r.fromHexInput(t).toString()}`}static parseHexInput(e,n,i){let t,p=a.AIP80_PREFIXES[n];if(typeof e=="string")if(!i&&!e.startsWith(p))t=r.fromHexInput(e),i!==!1&&console.warn("[Aptos SDK] It is recommended that private keys are AIP-80 compliant (https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md). You can fix the private key by formatting it with `PrivateKey.formatPrivateKey(privateKey: string, type: 'ed25519' | 'secp256k1'): string`.");else if(e.startsWith(p))t=r.fromHexString(e.split("-")[2]);else throw i?new Error("Invalid HexString input while parsing private key. Must AIP-80 compliant string."):new Error("Invalid HexString input while parsing private key.");else t=r.fromHexInput(e);return t}};a.AIP80_PREFIXES={ed25519:"ed25519-priv-",secp256k1:"secp256k1-priv-",secp256r1:"secp256r1-priv-"};var s=a;export{s as a};
2
- //# sourceMappingURL=chunk-2PASUPUO.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/crypto/privateKey.ts"],"sourcesContent":["/* eslint-disable max-len */\n\nimport { HexInput, PrivateKeyVariants } from \"../../types\";\nimport { Hex } from \"../hex\";\nimport { PublicKey } from \"./publicKey\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents a private key used for signing messages and deriving the associated public key.\n * @group Implementation\n * @category Serialization\n */\nexport interface PrivateKey {\n /**\n * Sign the given message with the private key to create a signature.\n * @param message - The message to be signed, provided in HexInput format.\n * @returns A Signature object representing the signed message.\n * @group Implementation\n * @category Serialization\n */\n sign(message: HexInput): Signature;\n\n /**\n * Derive the public key associated with the private key.\n * @group Implementation\n * @category Serialization\n */\n publicKey(): PublicKey;\n\n /**\n * Get the private key in bytes (Uint8Array).\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array;\n}\n\nexport class PrivateKey {\n /**\n * The AIP-80 compliant prefixes for each private key type. Append this to a private key's hex representation\n * to get an AIP-80 compliant string.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n */\n public static readonly AIP80_PREFIXES = {\n [PrivateKeyVariants.Ed25519]: \"ed25519-priv-\",\n [PrivateKeyVariants.Secp256k1]: \"secp256k1-priv-\",\n [PrivateKeyVariants.Secp256r1]: \"secp256r1-priv-\",\n };\n\n /**\n * Format a HexInput to an AIP-80 compliant string.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @param privateKey - The HexString or Uint8Array format of the private key.\n * @param privateKeyType - The private key type\n */\n public static formatPrivateKey(privateKey: HexInput, type: PrivateKeyVariants): string {\n const aip80Prefix = PrivateKey.AIP80_PREFIXES[type];\n\n // Remove the prefix if it exists\n let formattedPrivateKey = privateKey;\n if (typeof formattedPrivateKey === \"string\" && formattedPrivateKey.startsWith(aip80Prefix)) {\n // eslint-disable-next-line prefer-destructuring\n formattedPrivateKey = formattedPrivateKey.split(\"-\")[2];\n }\n\n return `${aip80Prefix}${Hex.fromHexInput(formattedPrivateKey).toString()}`;\n }\n\n /**\n * Parse a HexInput that may be a HexString, Uint8Array, or a AIP-80 compliant string to a Hex instance.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @param value - A HexString, Uint8Array, or a AIP-80 compliant string.\n * @param privateKeyType - The private key type\n * @param strict - If true, the value MUST be compliant with AIP-80.\n */\n public static parseHexInput(value: HexInput, type: PrivateKeyVariants, strict?: boolean): Hex {\n let data: Hex;\n\n const aip80Prefix = PrivateKey.AIP80_PREFIXES[type];\n if (typeof value === \"string\") {\n if (!strict && !value.startsWith(aip80Prefix)) {\n // HexString input\n data = Hex.fromHexInput(value);\n // If the strictness is false, the user has opted into non-AIP-80 compliant private keys.\n if (strict !== false) {\n // eslint-disable-next-line no-console\n console.warn(\n \"[Aptos SDK] It is recommended that private keys are AIP-80 compliant (https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md). You can fix the private key by formatting it with `PrivateKey.formatPrivateKey(privateKey: string, type: 'ed25519' | 'secp256k1'): string`.\",\n );\n }\n } else if (value.startsWith(aip80Prefix)) {\n // AIP-80 Compliant String input\n data = Hex.fromHexString(value.split(\"-\")[2]);\n } else {\n if (strict) {\n // The value does not start with the AIP-80 prefix, and strict is true.\n throw new Error(\"Invalid HexString input while parsing private key. Must AIP-80 compliant string.\");\n }\n\n // This condition should never be reached.\n throw new Error(\"Invalid HexString input while parsing private key.\");\n }\n } else {\n // The value is an Uint8Array\n data = Hex.fromHexInput(value);\n }\n\n return data;\n }\n}\n"],"mappings":"yCAqCO,IAAMA,EAAN,MAAMA,CAAW,CAqBtB,OAAc,iBAAiBC,EAAsBC,EAAkC,CACrF,IAAMC,EAAcH,EAAW,eAAeE,CAAI,EAG9CE,EAAsBH,EAC1B,OAAI,OAAOG,GAAwB,UAAYA,EAAoB,WAAWD,CAAW,IAEvFC,EAAsBA,EAAoB,MAAM,GAAG,EAAE,CAAC,GAGjD,GAAGD,CAAW,GAAGE,EAAI,aAAaD,CAAmB,EAAE,SAAS,CAAC,EAC1E,CAWA,OAAc,cAAcE,EAAiBJ,EAA0BK,EAAuB,CAC5F,IAAIC,EAEEL,EAAcH,EAAW,eAAeE,CAAI,EAClD,GAAI,OAAOI,GAAU,SACnB,GAAI,CAACC,GAAU,CAACD,EAAM,WAAWH,CAAW,EAE1CK,EAAOH,EAAI,aAAaC,CAAK,EAEzBC,IAAW,IAEb,QAAQ,KACN,uRACF,UAEOD,EAAM,WAAWH,CAAW,EAErCK,EAAOH,EAAI,cAAcC,EAAM,MAAM,GAAG,EAAE,CAAC,CAAC,MAE5C,OAAIC,EAEI,IAAI,MAAM,kFAAkF,EAI9F,IAAI,MAAM,oDAAoD,OAItEC,EAAOH,EAAI,aAAaC,CAAK,EAG/B,OAAOE,CACT,CACF,EA7EaR,EAOY,eAAiB,CACrC,QAA6B,gBAC7B,UAA+B,kBAC/B,UAA+B,iBAClC,EAXK,IAAMS,EAANT","names":["_PrivateKey","privateKey","type","aip80Prefix","formattedPrivateKey","Hex","value","strict","data","PrivateKey"]}
@@ -1,2 +0,0 @@
1
- import{b as o}from"./chunk-RGKRCZ36.mjs";import{a as u,c as r}from"./chunk-Q4W3WJ2U.mjs";import{e as t}from"./chunk-ORMOQWWH.mjs";import{a as i}from"./chunk-EBMEXURY.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
2
- //# sourceMappingURL=chunk-2XQKGWHQ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/transactions/instances/rotationProofChallenge.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Serializer, Serializable } from \"../../bcs/serializer\";\nimport { AccountAddress } from \"../../core/accountAddress\";\nimport { AnyNumber } from \"../../types\";\nimport { PublicKey } from \"../../core/crypto\";\nimport { MoveString, MoveVector, U64, U8 } from \"../../bcs\";\n\n/**\n * Represents a challenge required for the account owner to sign in order to rotate the authentication key.\n * @group Implementation\n * @category Transactions\n */\nexport class RotationProofChallenge extends Serializable {\n // Resource account address\n public readonly accountAddress: AccountAddress = AccountAddress.ONE;\n\n // Module name, i.e: 0x1::account\n public readonly moduleName: MoveString = new MoveString(\"account\");\n\n // The rotation proof challenge struct name that live under the module\n public readonly structName: MoveString = new MoveString(\"RotationProofChallenge\");\n\n // Signer's address\n public readonly originator: AccountAddress;\n\n // Signer's current authentication key\n public readonly currentAuthKey: AccountAddress;\n\n // New public key to rotate to\n public readonly newPublicKey: MoveVector<U8>;\n\n // Sequence number of the account\n public readonly sequenceNumber: U64;\n\n /**\n * Initializes a new instance of the class with the specified parameters.\n * This constructor sets up the necessary attributes for managing account keys.\n *\n * @param args - The parameters required to create the instance.\n * @param args.sequenceNumber - The sequence number associated with the transaction.\n * @param args.originator - The account address of the originator.\n * @param args.currentAuthKey - The current authentication key of the account.\n * @param args.newPublicKey - The new public key to be set for the account.\n * @group Implementation\n * @category Transactions\n */\n constructor(args: {\n sequenceNumber: AnyNumber;\n originator: AccountAddress;\n currentAuthKey: AccountAddress;\n newPublicKey: PublicKey;\n }) {\n super();\n this.sequenceNumber = new U64(args.sequenceNumber);\n this.originator = args.originator;\n this.currentAuthKey = args.currentAuthKey;\n this.newPublicKey = MoveVector.U8(args.newPublicKey.toUint8Array());\n }\n\n /**\n * Serializes the properties of the current instance for transmission or storage.\n * This function helps in converting the instance data into a format suitable for serialization.\n *\n * @param serializer - The serializer used to serialize the instance properties.\n * @param serializer.accountAddress - The account address to serialize.\n * @param serializer.moduleName - The module name to serialize.\n * @param serializer.structName - The struct name to serialize.\n * @param serializer.sequenceNumber - The sequence number to serialize.\n * @param serializer.originator - The originator to serialize.\n * @param serializer.currentAuthKey - The current authentication key to serialize.\n * @param serializer.newPublicKey - The new public key to serialize.\n * @group Implementation\n * @category Transactions\n */\n serialize(serializer: Serializer): void {\n serializer.serialize(this.accountAddress);\n serializer.serialize(this.moduleName);\n serializer.serialize(this.structName);\n serializer.serialize(this.sequenceNumber);\n serializer.serialize(this.originator);\n serializer.serialize(this.currentAuthKey);\n serializer.serialize(this.newPublicKey);\n }\n}\n"],"mappings":"2KAcO,IAAMA,EAAN,cAAqCC,CAAa,CAkCvD,YAAYC,EAKT,CACD,MAAM,EAtCR,KAAgB,eAAiCC,EAAe,IAGhE,KAAgB,WAAyB,IAAIC,EAAW,SAAS,EAGjE,KAAgB,WAAyB,IAAIA,EAAW,wBAAwB,EAiC9E,KAAK,eAAiB,IAAIC,EAAIH,EAAK,cAAc,EACjD,KAAK,WAAaA,EAAK,WACvB,KAAK,eAAiBA,EAAK,eAC3B,KAAK,aAAeI,EAAW,GAAGJ,EAAK,aAAa,aAAa,CAAC,CACpE,CAiBA,UAAUK,EAA8B,CACtCA,EAAW,UAAU,KAAK,cAAc,EACxCA,EAAW,UAAU,KAAK,UAAU,EACpCA,EAAW,UAAU,KAAK,UAAU,EACpCA,EAAW,UAAU,KAAK,cAAc,EACxCA,EAAW,UAAU,KAAK,UAAU,EACpCA,EAAW,UAAU,KAAK,cAAc,EACxCA,EAAW,UAAU,KAAK,YAAY,CACxC,CACF","names":["RotationProofChallenge","Serializable","args","AccountAddress","MoveString","U64","MoveVector","serializer"]}
@@ -1,2 +0,0 @@
1
- import{spawn as p}from"child_process";import{platform as g}from"os";var u=class{async init(t){let{network:o,profile:e,extraArguments:r,showStdout:a}=t,s=["aptos","init",`--network=${o??"local"}`,`--profile=${e??"default"}`];return r&&s.push(...r),this.runCommand(s,a)}async compile(t){let{packageDirectoryPath:o,namedAddresses:e,extraArguments:r,showStdout:a}=t,s=["aptos","move","compile","--package-dir",o],n=this.parseNamedAddresses(e);return s.push(...this.prepareNamedAddresses(n)),r&&s.push(...r),this.runCommand(s,a)}async test(t){let{packageDirectoryPath:o,namedAddresses:e,extraArguments:r,showStdout:a}=t,s=["aptos","move","test","--package-dir",o],n=this.parseNamedAddresses(e);return s.push(...this.prepareNamedAddresses(n)),r&&s.push(...r),this.runCommand(s,a)}async publish(t){let{packageDirectoryPath:o,namedAddresses:e,profile:r,extraArguments:a,showStdout:s}=t,n=["aptos","move","publish","--package-dir",o,`--profile=${r??"default"}`],d=this.parseNamedAddresses(e);return n.push(...this.prepareNamedAddresses(d)),a&&n.push(...a),this.runCommand(n,s)}async createObjectAndPublishPackage(t){let{packageDirectoryPath:o,addressName:e,namedAddresses:r,profile:a,extraArguments:s,showStdout:n}=t,d=["aptos","move","create-object-and-publish-package","--package-dir",o,"--address-name",e,`--profile=${a??"default"}`],i=this.parseNamedAddresses(r);d.push(...this.prepareNamedAddresses(i)),s&&d.push(...s);let{output:c}=await this.runCommand(d,n);return{objectAddress:this.extractAddressFromOutput(c)}}async upgradeObjectPackage(t){let{packageDirectoryPath:o,objectAddress:e,namedAddresses:r,profile:a,extraArguments:s,showStdout:n}=t,d=["aptos","move","upgrade-object-package","--package-dir",o,"--object-address",e,`--profile=${a??"default"}`],i=this.parseNamedAddresses(r);return d.push(...this.prepareNamedAddresses(i)),s&&d.push(...s),this.runCommand(d,n)}async buildPublishPayload(t){let{outputFile:o,packageDirectoryPath:e,namedAddresses:r,extraArguments:a,showStdout:s}=t,n=["aptos","move","build-publish-payload","--json-output-file",o,"--package-dir",e],d=this.parseNamedAddresses(r);return n.push(...this.prepareNamedAddresses(d)),a&&n.push(...a),this.runCommand(n,s)}async runScript(t){let{compiledScriptPath:o,profile:e,extraArguments:r,showStdout:a}=t,s=["aptos","move","run-script","--compiled-script-path",o,`--profile=${e??"default"}`];return r&&s.push(...r),this.runCommand(s,a)}async gasProfile(t){let{network:o,transactionId:e,extraArguments:r,showStdout:a}=t,s=["aptos","move","replay","--profile-gas","--network",o,"--txn-id",e];return r&&s.push(...r),this.runCommand(s,a)}async runCommand(t,o=!0){return new Promise((e,r)=>{let a=g(),s,n="",d="";a==="win32"?s=p("npx",t,{shell:!0}):s=p("npx",t),s.stdout.on("data",i=>{d=i.toString(),n+=i.toString()}),o&&(s.stdout.pipe(process.stdout),s.stderr.pipe(process.stderr)),process.stdin.pipe(s.stdin),s.on("close",i=>{if(i===0)try{let c=JSON.parse(d);c.Error?r(new Error(`Error: ${c.Error}`)):c.Result&&e({result:c.Result,output:n})}catch{e({output:n})}else r(new Error(`Child process exited with code ${i}`))})})}prepareNamedAddresses(t){let o=t.size,e=[];if(o===0)return e;e.push("--named-addresses");let r=[];return t.forEach((a,s)=>{let n=`${s}=${a.toString()}`;r.push(n)}),e.push(r.join(",")),e}parseNamedAddresses(t){let o=new Map;return Object.keys(t).forEach(e=>{let r=t[e];o.set(e,r)}),o}extractAddressFromOutput(t){let o=t.match("Code was successfully deployed to object address (0x[0-9a-fA-F]+)");if(o)return o[1];throw new Error("Failed to extract object address from output")}};export{u as a};
2
- //# sourceMappingURL=chunk-35DKMW7Q.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/cli/move.ts"],"sourcesContent":["import { spawn } from \"child_process\";\nimport { platform } from \"os\";\n\nimport { AccountAddress } from \"../core\";\nimport { Network } from \"../utils\";\n\n/**\n * Class representing a Move package management utility for the Aptos blockchain.\n * This class provides methods to initialize directories, compile packages, run tests, publish modules, create objects, upgrade\n * packages, build transaction payloads, and run scripts.\n * @group Implementation\n * @category CLI\n */\nexport class Move {\n /**\n * Initialize the current directory for Aptos by configuring the necessary settings.\n * Configuration will be pushed into .aptos/config.yaml.\n *\n * @param args - The arguments for initialization.\n * @param args.network - Optional Network type argument to use for default settings; defaults to local.\n * @param args.profile - Optional Profile to use from the config file; defaults to 'default'. This will override associated\n * settings such as the REST URL, the Faucet URL, and the private key arguments.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n * @group Implementation\n * @category CLI\n */\n async init(args: {\n network?: Network;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { network, profile, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"init\", `--network=${network ?? \"local\"}`, `--profile=${profile ?? \"default\"}`];\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Compile a Move package located at the specified directory path.\n * This function helps in preparing the Move package for deployment or further processing.\n *\n * @param args - The arguments for compiling the package.\n * @param args.packageDirectoryPath - Path to a Move package (the folder with a Move.toml file).\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n * @group Implementation\n * @category CLI\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"move\", \"compile\", \"--package-dir\", packageDirectoryPath];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Run Move unit tests for a specified package.\n *\n * @param args - The arguments for running the tests.\n * @param args.packageDirectoryPath - The path to a Move package (the folder containing a Move.toml file).\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns The stdout output from running the tests.\n * @group Implementation\n * @category CLI\n */\n async test(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"move\", \"test\", \"--package-dir\", packageDirectoryPath];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Publishes the modules to the publisher account on the Aptos blockchain.\n *\n * @param args - The arguments for publishing the modules.\n * @param args.packageDirectoryPath - The path to a move package (the folder with a Move.toml file).\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n * @group Implementation\n * @category CLI\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"publish\",\n \"--package-dir\",\n packageDirectoryPath,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Create a new object and publish the Move package to it on the Aptos blockchain.\n *\n * @param args - The arguments for creating the object and publishing the package.\n * @param args.packageDirectoryPath - Path to a Move package (the folder with a Move.toml file).\n * @param args.addressName - Address name for the Move package.\n * @param args.namedAddresses - Named addresses for the Move binary.\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns The object address.\n *\n * A complete example in CLI:\n * aptos move create-object-and-publish-package \\\n * --package-dir path_to_directory_that_has_move.toml \\\n * --address-name launchpad_addr \\\n * --named-addresses \"launchpad_addr=0x123,initial_creator_addr=0x456\" \\\n * --profile my_profile \\\n * --assume-yes\n * @group Implementation\n * @category CLI\n */\n async createObjectAndPublishPackage(args: {\n packageDirectoryPath: string;\n addressName: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ objectAddress: string }> {\n const { packageDirectoryPath, addressName, namedAddresses, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"create-object-and-publish-package\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--address-name\",\n addressName,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n const { output } = await this.runCommand(cliArgs, showStdout);\n return { objectAddress: this.extractAddressFromOutput(output) };\n }\n\n /**\n * Upgrade a Move package previously published to an object on the Aptos blockchain.\n * The caller must be the object owner to execute this function.\n *\n * @param args - The arguments for upgrading the object package.\n * @param args.packageDirectoryPath - Path to a Move package (the folder with a Move.toml file).\n * @param args.objectAddress - Address of the object that the Move package published to. Ex. 0x1000\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n * @group Implementation\n * @category CLI\n */\n async upgradeObjectPackage(args: {\n packageDirectoryPath: string;\n objectAddress: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, objectAddress, namedAddresses, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"upgrade-object-package\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--object-address\",\n objectAddress,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Build a publication transaction payload and store it in a JSON output file.\n *\n * @param args - The arguments for building the publishing payload.\n * @param args.packageDirectoryPath - Path to a move package (the folder with a Move.toml file).\n * @param args.outputFile - Output file to write the publication transaction to.\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"] *\n * @returns stdout\n * @group Implementation\n * @category CLI\n */\n async buildPublishPayload(args: {\n packageDirectoryPath: string;\n outputFile: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { outputFile, packageDirectoryPath, namedAddresses, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"build-publish-payload\",\n \"--json-output-file\",\n outputFile,\n \"--package-dir\",\n packageDirectoryPath,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Runs a Move script using the provided compiled script path and optional parameters. Ensure that the script is compiled\n * before executing this function.\n *\n * @param args - The arguments for running the script.\n * @param args.compiledScriptPath - Path to a compiled Move script bytecode file.\n * Ex. \"build/my_package/bytecode_scripts/my_move_script.mv\"\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns The standard output from running the script.\n * @group Implementation\n * @category CLI\n */\n async runScript(args: {\n compiledScriptPath: string;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { compiledScriptPath, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"run-script\",\n \"--compiled-script-path\",\n compiledScriptPath,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n async gasProfile(args: {\n network: string;\n transactionId: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string; result?: any }> {\n const { network, transactionId, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"move\", \"replay\", \"--profile-gas\", \"--network\", network, \"--txn-id\", transactionId];\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Run a command with the specified arguments and return the output.\n *\n * @param args - An array of strings representing the command-line arguments to be passed to the command.\n * @param showStdout - Show the standard output generated by the command.\n * @returns The standard output generated by the command.\n * @group Implementation\n * @category CLI\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>, showStdout: boolean = true): Promise<{ result?: any; output: string }> {\n return new Promise((resolve, reject) => {\n const currentPlatform = platform();\n let childProcess;\n let stdout = \"\";\n // CLI final stdout is the Result/Error JSON string output\n // so we need to keep track of the last stdout\n let lastStdout = \"\";\n\n // Check if current OS is windows\n if (currentPlatform === \"win32\") {\n childProcess = spawn(\"npx\", args, { shell: true });\n } else {\n childProcess = spawn(\"npx\", args);\n }\n\n childProcess.stdout.on(\"data\", (data) => {\n lastStdout = data.toString();\n stdout += data.toString();\n });\n\n if (showStdout) {\n childProcess.stdout.pipe(process.stdout);\n childProcess.stderr.pipe(process.stderr);\n }\n process.stdin.pipe(childProcess.stdin);\n\n childProcess.on(\"close\", (code) => {\n if (code === 0) {\n try {\n // parse the last stdout as it might be the result\n const parsed = JSON.parse(lastStdout);\n if (parsed.Error) {\n reject(new Error(`Error: ${parsed.Error}`)); // Reject if the \"Error\" key exists\n } else if (parsed.Result) {\n resolve({ result: parsed.Result, output: stdout }); // Resolve if the \"Result\" key exists\n }\n } catch (error: any) {\n // resolve the stdout as it might be just a stdout\n resolve({ output: stdout });\n }\n } else {\n reject(new Error(`Child process exited with code ${code}`)); // Reject with an error if the child process exits with an error code\n }\n });\n });\n }\n\n /**\n * Convert named addresses from a Map into an array separated by a comma.\n *\n * @param namedAddresses - A Map where the key is a string representing the name and the value is an AccountAddress.\n * Ex. {'alice' => '0x123', 'bob' => '0x456'}\n * @returns An array of named addresses formatted as strings separated by a comma. Ex. \"alice=0x123,bob=0x456\"\n * @group Implementation\n * @category CLI\n */\n // eslint-disable-next-line class-methods-use-this\n private prepareNamedAddresses(namedAddresses: Map<string, AccountAddress>): Array<string> {\n const totalNames = namedAddresses.size;\n const newArgs: Array<string> = [];\n\n if (totalNames === 0) {\n return newArgs;\n }\n\n newArgs.push(\"--named-addresses\");\n\n const names: Array<string> = [];\n namedAddresses.forEach((value, key) => {\n const toAppend = `${key}=${value.toString()}`;\n names.push(toAppend);\n });\n newArgs.push(names.join(\",\"));\n return newArgs;\n }\n\n /**\n * Parse named addresses from a Record type into a Map.\n *\n * This function transforms a collection of named addresses into a more accessible format by mapping each name to its\n * corresponding address.\n *\n * @param namedAddresses - A record containing named addresses where the key is the name and the value is the AccountAddress.\n * @returns A Map where each key is a name and each value is the corresponding address.\n * @group Implementation\n * @category CLI\n */\n // eslint-disable-next-line class-methods-use-this\n private parseNamedAddresses(namedAddresses: Record<string, AccountAddress>): Map<string, AccountAddress> {\n const addressesMap = new Map();\n\n Object.keys(namedAddresses).forEach((key) => {\n const address = namedAddresses[key];\n addressesMap.set(key, address);\n });\n\n return addressesMap;\n }\n\n /**\n * Extracts the object address from the provided output string.\n *\n * @param output - The output string containing the object address.\n * @returns The extracted object address.\n * @throws Error if the object address cannot be extracted from the output.\n * @group Implementation\n * @category CLI\n */\n // eslint-disable-next-line class-methods-use-this\n private extractAddressFromOutput(output: string): string {\n const match = output.match(\"Code was successfully deployed to object address (0x[0-9a-fA-F]+)\");\n if (match) {\n return match[1];\n }\n throw new Error(\"Failed to extract object address from output\");\n }\n}\n"],"mappings":"AAAA,OAAS,SAAAA,MAAa,gBACtB,OAAS,YAAAC,MAAgB,KAYlB,IAAMC,EAAN,KAAW,CAehB,MAAM,KAAKC,EAKqB,CAC9B,GAAM,CAAE,QAAAC,EAAS,QAAAC,EAAS,eAAAC,EAAgB,WAAAC,CAAW,EAAIJ,EACnDK,EAAU,CAAC,QAAS,OAAQ,aAAaJ,GAAW,OAAO,GAAI,aAAaC,GAAW,SAAS,EAAE,EAExG,OAAIC,GACFE,EAAQ,KAAK,GAAGF,CAAc,EAGzB,KAAK,WAAWE,EAASD,CAAU,CAC5C,CAeA,MAAM,QAAQJ,EAKkB,CAC9B,GAAM,CAAE,qBAAAM,EAAsB,eAAAC,EAAgB,eAAAJ,EAAgB,WAAAC,CAAW,EAAIJ,EACvEK,EAAU,CAAC,QAAS,OAAQ,UAAW,gBAAiBC,CAAoB,EAE5EE,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEpDL,GACFE,EAAQ,KAAK,GAAGF,CAAc,EAGzB,KAAK,WAAWE,EAASD,CAAU,CAC5C,CAcA,MAAM,KAAKJ,EAKqB,CAC9B,GAAM,CAAE,qBAAAM,EAAsB,eAAAC,EAAgB,eAAAJ,EAAgB,WAAAC,CAAW,EAAIJ,EACvEK,EAAU,CAAC,QAAS,OAAQ,OAAQ,gBAAiBC,CAAoB,EAEzEE,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEpDL,GACFE,EAAQ,KAAK,GAAGF,CAAc,EAGzB,KAAK,WAAWE,EAASD,CAAU,CAC5C,CAeA,MAAM,QAAQJ,EAMkB,CAC9B,GAAM,CAAE,qBAAAM,EAAsB,eAAAC,EAAgB,QAAAL,EAAS,eAAAC,EAAgB,WAAAC,CAAW,EAAIJ,EAChFK,EAAU,CACd,QACA,OACA,UACA,gBACAC,EACA,aAAaJ,GAAW,SAAS,EACnC,EAEMM,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEpDL,GACFE,EAAQ,KAAK,GAAGF,CAAc,EAGzB,KAAK,WAAWE,EAASD,CAAU,CAC5C,CAwBA,MAAM,8BAA8BJ,EAOG,CACrC,GAAM,CAAE,qBAAAM,EAAsB,YAAAG,EAAa,eAAAF,EAAgB,QAAAL,EAAS,eAAAC,EAAgB,WAAAC,CAAW,EAAIJ,EAC7FK,EAAU,CACd,QACA,OACA,oCACA,gBACAC,EACA,iBACAG,EACA,aAAaP,GAAW,SAAS,EACnC,EAEMM,EAAe,KAAK,oBAAoBD,CAAc,EAE5DF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEpDL,GACFE,EAAQ,KAAK,GAAGF,CAAc,EAGhC,GAAM,CAAE,OAAAO,CAAO,EAAI,MAAM,KAAK,WAAWL,EAASD,CAAU,EAC5D,MAAO,CAAE,cAAe,KAAK,yBAAyBM,CAAM,CAAE,CAChE,CAiBA,MAAM,qBAAqBV,EAOK,CAC9B,GAAM,CAAE,qBAAAM,EAAsB,cAAAK,EAAe,eAAAJ,EAAgB,QAAAL,EAAS,eAAAC,EAAgB,WAAAC,CAAW,EAAIJ,EAC/FK,EAAU,CACd,QACA,OACA,yBACA,gBACAC,EACA,mBACAK,EACA,aAAaT,GAAW,SAAS,EACnC,EAEMM,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEpDL,GACFE,EAAQ,KAAK,GAAGF,CAAc,EAGzB,KAAK,WAAWE,EAASD,CAAU,CAC5C,CAeA,MAAM,oBAAoBJ,EAMM,CAC9B,GAAM,CAAE,WAAAY,EAAY,qBAAAN,EAAsB,eAAAC,EAAgB,eAAAJ,EAAgB,WAAAC,CAAW,EAAIJ,EACnFK,EAAU,CACd,QACA,OACA,wBACA,qBACAO,EACA,gBACAN,CACF,EAEME,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEpDL,GACFE,EAAQ,KAAK,GAAGF,CAAc,EAGzB,KAAK,WAAWE,EAASD,CAAU,CAC5C,CAiBA,MAAM,UAAUJ,EAKgB,CAC9B,GAAM,CAAE,mBAAAa,EAAoB,QAAAX,EAAS,eAAAC,EAAgB,WAAAC,CAAW,EAAIJ,EAC9DK,EAAU,CACd,QACA,OACA,aACA,yBACAQ,EACA,aAAaX,GAAW,SAAS,EACnC,EAEA,OAAIC,GACFE,EAAQ,KAAK,GAAGF,CAAc,EAGzB,KAAK,WAAWE,EAASD,CAAU,CAC5C,CAEA,MAAM,WAAWJ,EAK6B,CAC5C,GAAM,CAAE,QAAAC,EAAS,cAAAa,EAAe,eAAAX,EAAgB,WAAAC,CAAW,EAAIJ,EACzDK,EAAU,CAAC,QAAS,OAAQ,SAAU,gBAAiB,YAAaJ,EAAS,WAAYa,CAAa,EAE5G,OAAIX,GACFE,EAAQ,KAAK,GAAGF,CAAc,EAGzB,KAAK,WAAWE,EAASD,CAAU,CAC5C,CAYA,MAAc,WAAWJ,EAAqBI,EAAsB,GAAiD,CACnH,OAAO,IAAI,QAAQ,CAACW,EAASC,IAAW,CACtC,IAAMC,EAAkBnB,EAAS,EAC7BoB,EACAC,EAAS,GAGTC,EAAa,GAGbH,IAAoB,QACtBC,EAAerB,EAAM,MAAOG,EAAM,CAAE,MAAO,EAAK,CAAC,EAEjDkB,EAAerB,EAAM,MAAOG,CAAI,EAGlCkB,EAAa,OAAO,GAAG,OAASG,GAAS,CACvCD,EAAaC,EAAK,SAAS,EAC3BF,GAAUE,EAAK,SAAS,CAC1B,CAAC,EAEGjB,IACFc,EAAa,OAAO,KAAK,QAAQ,MAAM,EACvCA,EAAa,OAAO,KAAK,QAAQ,MAAM,GAEzC,QAAQ,MAAM,KAAKA,EAAa,KAAK,EAErCA,EAAa,GAAG,QAAUI,GAAS,CACjC,GAAIA,IAAS,EACX,GAAI,CAEF,IAAMC,EAAS,KAAK,MAAMH,CAAU,EAChCG,EAAO,MACTP,EAAO,IAAI,MAAM,UAAUO,EAAO,KAAK,EAAE,CAAC,EACjCA,EAAO,QAChBR,EAAQ,CAAE,OAAQQ,EAAO,OAAQ,OAAQJ,CAAO,CAAC,CAErD,MAAqB,CAEnBJ,EAAQ,CAAE,OAAQI,CAAO,CAAC,CAC5B,MAEAH,EAAO,IAAI,MAAM,kCAAkCM,CAAI,EAAE,CAAC,CAE9D,CAAC,CACH,CAAC,CACH,CAYQ,sBAAsBf,EAA4D,CACxF,IAAMiB,EAAajB,EAAe,KAC5BkB,EAAyB,CAAC,EAEhC,GAAID,IAAe,EACjB,OAAOC,EAGTA,EAAQ,KAAK,mBAAmB,EAEhC,IAAMC,EAAuB,CAAC,EAC9B,OAAAnB,EAAe,QAAQ,CAACoB,EAAOC,IAAQ,CACrC,IAAMC,EAAW,GAAGD,CAAG,IAAID,EAAM,SAAS,CAAC,GAC3CD,EAAM,KAAKG,CAAQ,CACrB,CAAC,EACDJ,EAAQ,KAAKC,EAAM,KAAK,GAAG,CAAC,EACrBD,CACT,CAcQ,oBAAoBlB,EAA6E,CACvG,IAAMC,EAAe,IAAI,IAEzB,cAAO,KAAKD,CAAc,EAAE,QAASqB,GAAQ,CAC3C,IAAME,EAAUvB,EAAeqB,CAAG,EAClCpB,EAAa,IAAIoB,EAAKE,CAAO,CAC/B,CAAC,EAEMtB,CACT,CAYQ,yBAAyBE,EAAwB,CACvD,IAAMqB,EAAQrB,EAAO,MAAM,mEAAmE,EAC9F,GAAIqB,EACF,OAAOA,EAAM,CAAC,EAEhB,MAAM,IAAI,MAAM,8CAA8C,CAChE,CACF","names":["spawn","platform","Move","args","network","profile","extraArguments","showStdout","cliArgs","packageDirectoryPath","namedAddresses","addressesMap","addressName","output","objectAddress","outputFile","compiledScriptPath","transactionId","resolve","reject","currentPlatform","childProcess","stdout","lastStdout","data","code","parsed","totalNames","newArgs","names","value","key","toAppend","address","match"]}
@@ -1,2 +0,0 @@
1
- import{b as p}from"./chunk-QP2BY4PK.mjs";async function o(e){let{type:t,originMethod:s,path:i,body:r,acceptType:R,contentType:f,params:c,aptosConfig:n,overrides:A}=e,d=n.getRequestUrl(t);return p({url:d,method:"POST",originMethod:s,path:i,body:r,contentType:f,acceptType:R,params:c,overrides:A},n,e.type)}async function q(e){let{aptosConfig:t}=e;return o({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function C(e){let{aptosConfig:t}=e;return o({...e,type:"Indexer",overrides:{...t.clientConfig,...t.indexerConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.indexerConfig?.HEADERS}}})}async function E(e){let{aptosConfig:t}=e,s={...t,clientConfig:{...t.clientConfig}};return delete s?.clientConfig?.API_KEY,o({...e,type:"Faucet",overrides:{...s.clientConfig,...s.faucetConfig,...e.overrides,HEADERS:{...s.clientConfig?.HEADERS,...s.faucetConfig?.HEADERS}}})}async function a(e){return o({...e,type:"Pepper"})}async function m(e){return o({...e,type:"Prover"})}export{o as a,q as b,C as c,E as d,a as e,m as f};
2
- //# sourceMappingURL=chunk-4AI7KQQ7.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/client/post.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { aptosRequest } from \"./core\";\nimport { AptosResponse, AnyNumber, ClientConfig, MimeType } from \"../types\";\nimport { AptosApiType } from \"../utils/const\";\n\n/**\n * Options for making a POST request, including the API client configuration.\n * @group Implementation\n * @category Client\n */\nexport type PostRequestOptions = {\n /**\n * The config for the API client\n * @group Implementation\n * @category Client\n */\n aptosConfig: AptosConfig;\n /**\n * The type of API endpoint to call e.g. fullnode, indexer, etc\n * @group Implementation\n * @category Client\n */\n type: AptosApiType;\n /**\n * The name of the API method\n * @group Implementation\n * @category Client\n */\n originMethod: string;\n /**\n * The URL path to the API method\n * @group Implementation\n * @category Client\n */\n path: string;\n /**\n * The content type of the request body\n * @group Implementation\n * @category Client\n */\n contentType?: MimeType;\n /**\n * The accepted content type of the response of the API\n * @group Implementation\n * @category Client\n */\n acceptType?: MimeType;\n /**\n * The query parameters for the request\n * @group Implementation\n * @category Client\n */\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n /**\n * The body of the request, should match the content type of the request\n * @group Implementation\n * @category Client\n */\n body?: any;\n /**\n * Specific client overrides for this request to override aptosConfig\n * @group Implementation\n * @category Client\n */\n overrides?: ClientConfig;\n};\n\n/**\n * Options for posting a request to Aptos, excluding the type field.\n * @group Implementation\n * @category Client\n */\nexport type PostAptosRequestOptions = Omit<PostRequestOptions, \"type\">;\n\n/**\n * Executes a POST request to the specified URL with the provided options.\n *\n * @param options - The options for the POST request.\n * @param options.type - The type of the request.\n * @param options.originMethod - The original method that initiated the request.\n * @param options.path - The path for the request.\n * @param options.body - The body content to be sent with the request.\n * @param options.acceptType - The type of response expected from the server.\n * @param options.contentType - The content type of the request body.\n * @param options.params - Additional parameters to include in the request.\n * @param options.aptosConfig - Configuration settings for the Aptos request.\n * @param options.overrides - Any overrides for the default request behavior.\n * @returns The response from the POST request.\n * @group Implementation\n * @category Client\n */\nexport async function post<Req extends {}, Res extends {}>(\n options: PostRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n const { type, originMethod, path, body, acceptType, contentType, params, aptosConfig, overrides } = options;\n const url = aptosConfig.getRequestUrl(type);\n\n return aptosRequest<Req, Res>(\n {\n url,\n method: \"POST\",\n originMethod,\n path,\n body,\n contentType,\n acceptType,\n params,\n overrides,\n },\n aptosConfig,\n options.type,\n );\n}\n\n/**\n * Sends a request to the Aptos full node using the specified options.\n * This function allows you to interact with the Aptos blockchain by sending requests to the full node.\n *\n * @param options - The options for the request.\n * @param options.aptosConfig - Configuration settings for the Aptos client.\n * @param options.aptosConfig.clientConfig - Client-specific configuration settings.\n * @param options.aptosConfig.fullnodeConfig - Full node-specific configuration settings.\n * @param options.overrides - Additional overrides for the request.\n * @group Implementation\n * @category Client\n */\nexport async function postAptosFullNode<Req extends {}, Res extends {}>(\n options: PostAptosRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n const { aptosConfig } = options;\n\n return post<Req, Res>({\n ...options,\n type: AptosApiType.FULLNODE,\n overrides: {\n ...aptosConfig.clientConfig,\n ...aptosConfig.fullnodeConfig,\n ...options.overrides,\n HEADERS: { ...aptosConfig.clientConfig?.HEADERS, ...aptosConfig.fullnodeConfig?.HEADERS },\n },\n });\n}\n\n/**\n * Sends a request to the Aptos indexer with the specified options.\n * This function allows you to interact with the Aptos indexer and customize the request using various configurations.\n *\n * @param options - The options for the request to the Aptos indexer.\n * @param options.aptosConfig - Configuration settings specific to the Aptos client and indexer.\n * @param options.aptosConfig.clientConfig - The client configuration settings.\n * @param options.aptosConfig.indexerConfig - The indexer configuration settings.\n * @param options.overrides - Additional overrides for the request.\n * @param options.overrides.HEADERS - Custom headers to include in the request.\n * @group Implementation\n * @category Client\n */\nexport async function postAptosIndexer<Req extends {}, Res extends {}>(\n options: PostAptosRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n const { aptosConfig } = options;\n\n return post<Req, Res>({\n ...options,\n type: AptosApiType.INDEXER,\n overrides: {\n ...aptosConfig.clientConfig,\n ...aptosConfig.indexerConfig,\n ...options.overrides,\n HEADERS: { ...aptosConfig.clientConfig?.HEADERS, ...aptosConfig.indexerConfig?.HEADERS },\n },\n });\n}\n\n/**\n * Sends a request to the Aptos faucet to obtain test tokens.\n * This function modifies the provided configuration to ensure that the API_KEY is not included in the request.\n *\n * Note that only devnet has a publicly accessible faucet. For testnet, you must use\n * the minting page at https://aptos.dev/network/faucet.\n *\n * @param options - The options for the request.\n * @param options.aptosConfig - The configuration settings for the Aptos client.\n * @param options.aptosConfig.clientConfig - The client-specific configuration settings.\n * @param options.aptosConfig.clientConfig.HEADERS - Optional headers to include in the request.\n * @param options.aptosConfig.faucetConfig - The configuration settings specific to the faucet.\n * @param options.overrides - Additional overrides for the request configuration.\n * @group Implementation\n * @category Client\n */\nexport async function postAptosFaucet<Req extends {}, Res extends {}>(\n options: PostAptosRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n const { aptosConfig } = options;\n // Faucet does not support API_KEY\n // Create a new object with the desired modification\n const modifiedAptosConfig = {\n ...aptosConfig,\n clientConfig: { ...aptosConfig.clientConfig },\n };\n // Delete API_KEY config\n delete modifiedAptosConfig?.clientConfig?.API_KEY;\n\n return post<Req, Res>({\n ...options,\n type: AptosApiType.FAUCET,\n overrides: {\n ...modifiedAptosConfig.clientConfig,\n ...modifiedAptosConfig.faucetConfig,\n ...options.overrides,\n HEADERS: { ...modifiedAptosConfig.clientConfig?.HEADERS, ...modifiedAptosConfig.faucetConfig?.HEADERS },\n },\n });\n}\n\n/**\n * Makes a post request to the pepper service.\n *\n * @param options - The options for the request.\n * @param options.url - The URL to which the request is sent.\n * @param options.headers - The headers to include in the request.\n * @param options.body - The body of the request.\n * @returns A promise that resolves to the response from the pepper service.\n * @group Implementation\n * @category Client\n */\nexport async function postAptosPepperService<Req extends {}, Res extends {}>(\n options: PostAptosRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n return post<Req, Res>({ ...options, type: AptosApiType.PEPPER });\n}\n\n/**\n * Sends a request to the Aptos proving service with the specified options.\n *\n * @param options - The options for the request to the Aptos proving service.\n * @param options.type - The type of the request, which should be set to AptosApiType.PROVER.\n * @param options.data - The data to be included in the request.\n * @group Implementation\n * @category Client\n */\nexport async function postAptosProvingService<Req extends {}, Res extends {}>(\n options: PostAptosRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n return post<Req, Res>({ ...options, type: AptosApiType.PROVER });\n}\n"],"mappings":"yCA8FA,eAAsBA,EACpBC,EACkC,CAClC,GAAM,CAAE,KAAAC,EAAM,aAAAC,EAAc,KAAAC,EAAM,KAAAC,EAAM,WAAAC,EAAY,YAAAC,EAAa,OAAAC,EAAQ,YAAAC,EAAa,UAAAC,CAAU,EAAIT,EAC9FU,EAAMF,EAAY,cAAcP,CAAI,EAE1C,OAAOU,EACL,CACE,IAAAD,EACA,OAAQ,OACR,aAAAR,EACA,KAAAC,EACA,KAAAC,EACA,YAAAE,EACA,WAAAD,EACA,OAAAE,EACA,UAAAE,CACF,EACAD,EACAR,EAAQ,IACV,CACF,CAcA,eAAsBY,EACpBZ,EACkC,CAClC,GAAM,CAAE,YAAAQ,CAAY,EAAIR,EAExB,OAAOD,EAAe,CACpB,GAAGC,EACH,gBACA,UAAW,CACT,GAAGQ,EAAY,aACf,GAAGA,EAAY,eACf,GAAGR,EAAQ,UACX,QAAS,CAAE,GAAGQ,EAAY,cAAc,QAAS,GAAGA,EAAY,gBAAgB,OAAQ,CAC1F,CACF,CAAC,CACH,CAeA,eAAsBK,EACpBb,EACkC,CAClC,GAAM,CAAE,YAAAQ,CAAY,EAAIR,EAExB,OAAOD,EAAe,CACpB,GAAGC,EACH,eACA,UAAW,CACT,GAAGQ,EAAY,aACf,GAAGA,EAAY,cACf,GAAGR,EAAQ,UACX,QAAS,CAAE,GAAGQ,EAAY,cAAc,QAAS,GAAGA,EAAY,eAAe,OAAQ,CACzF,CACF,CAAC,CACH,CAkBA,eAAsBM,EACpBd,EACkC,CAClC,GAAM,CAAE,YAAAQ,CAAY,EAAIR,EAGlBe,EAAsB,CAC1B,GAAGP,EACH,aAAc,CAAE,GAAGA,EAAY,YAAa,CAC9C,EAEA,cAAOO,GAAqB,cAAc,QAEnChB,EAAe,CACpB,GAAGC,EACH,cACA,UAAW,CACT,GAAGe,EAAoB,aACvB,GAAGA,EAAoB,aACvB,GAAGf,EAAQ,UACX,QAAS,CAAE,GAAGe,EAAoB,cAAc,QAAS,GAAGA,EAAoB,cAAc,OAAQ,CACxG,CACF,CAAC,CACH,CAaA,eAAsBC,EACpBhB,EACkC,CAClC,OAAOD,EAAe,CAAE,GAAGC,EAAS,aAA0B,CAAC,CACjE,CAWA,eAAsBiB,EACpBjB,EACkC,CAClC,OAAOD,EAAe,CAAE,GAAGC,EAAS,aAA0B,CAAC,CACjE","names":["post","options","type","originMethod","path","body","acceptType","contentType","params","aptosConfig","overrides","url","aptosRequest","postAptosFullNode","postAptosIndexer","postAptosFaucet","modifiedAptosConfig","postAptosPepperService","postAptosProvingService"]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-4QMXOWHP.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +0,0 @@
1
- var s={mainnet:"https://api.mainnet.aptoslabs.com/v1/graphql",testnet:"https://api.testnet.aptoslabs.com/v1/graphql",devnet:"https://api.devnet.aptoslabs.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},o={mainnet:"https://api.mainnet.aptoslabs.com/v1",testnet:"https://api.testnet.aptoslabs.com/v1",devnet:"https://api.devnet.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},p={devnet:"https://faucet.devnet.aptoslabs.com",local:"http://127.0.0.1:8081"},a={mainnet:"https://api.mainnet.aptoslabs.com/keyless/pepper/v0",testnet:"https://api.testnet.aptoslabs.com/keyless/pepper/v0",devnet:"https://api.devnet.aptoslabs.com/keyless/pepper/v0",local:"https://api.devnet.aptoslabs.com/keyless/pepper/v0"},n={mainnet:"https://api.mainnet.aptoslabs.com/keyless/prover/v0",testnet:"https://api.testnet.aptoslabs.com/keyless/prover/v0",devnet:"https://api.devnet.aptoslabs.com/keyless/prover/v0",local:"https://api.devnet.aptoslabs.com/keyless/prover/v0"},e=(t=>(t.MAINNET="mainnet",t.TESTNET="testnet",t.DEVNET="devnet",t.LOCAL="local",t.CUSTOM="custom",t))(e||{}),r={mainnet:1,testnet:2,local:4},l={mainnet:"mainnet",testnet:"testnet",devnet:"devnet",local:"local",custom:"custom"};export{s as a,o as b,p as c,a as d,n as e,e as f,r as g,l as h};
2
- //# sourceMappingURL=chunk-4RXKALLC.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/apiEndpoints.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * @group Implementation\n * @category Network\n */\nexport const NetworkToIndexerAPI: Record<string, string> = {\n mainnet: \"https://api.mainnet.aptoslabs.com/v1/graphql\",\n testnet: \"https://api.testnet.aptoslabs.com/v1/graphql\",\n devnet: \"https://api.devnet.aptoslabs.com/v1/graphql\",\n local: \"http://127.0.0.1:8090/v1/graphql\",\n};\n\n/**\n * @group Implementation\n * @category Network\n */\nexport const NetworkToNodeAPI: Record<string, string> = {\n mainnet: \"https://api.mainnet.aptoslabs.com/v1\",\n testnet: \"https://api.testnet.aptoslabs.com/v1\",\n devnet: \"https://api.devnet.aptoslabs.com/v1\",\n local: \"http://127.0.0.1:8080/v1\",\n};\n\n/**\n * @group Implementation\n * @category Network\n */\nexport const NetworkToFaucetAPI: Record<string, string> = {\n devnet: \"https://faucet.devnet.aptoslabs.com\",\n local: \"http://127.0.0.1:8081\",\n};\n\n/**\n * @group Implementation\n * @category Network\n */\nexport const NetworkToPepperAPI: Record<string, string> = {\n mainnet: \"https://api.mainnet.aptoslabs.com/keyless/pepper/v0\",\n testnet: \"https://api.testnet.aptoslabs.com/keyless/pepper/v0\",\n devnet: \"https://api.devnet.aptoslabs.com/keyless/pepper/v0\",\n // Use the devnet service for local environment\n local: \"https://api.devnet.aptoslabs.com/keyless/pepper/v0\",\n};\n\n/**\n * @group Implementation\n * @category Network\n */\nexport const NetworkToProverAPI: Record<string, string> = {\n mainnet: \"https://api.mainnet.aptoslabs.com/keyless/prover/v0\",\n testnet: \"https://api.testnet.aptoslabs.com/keyless/prover/v0\",\n devnet: \"https://api.devnet.aptoslabs.com/keyless/prover/v0\",\n // Use the devnet service for local environment\n local: \"https://api.devnet.aptoslabs.com/keyless/prover/v0\",\n};\n\n/**\n * Different network environments for connecting to services, ranging from production to development setups.\n * @group Implementation\n * @category Network\n */\nexport enum Network {\n MAINNET = \"mainnet\",\n TESTNET = \"testnet\",\n DEVNET = \"devnet\",\n LOCAL = \"local\",\n CUSTOM = \"custom\",\n}\n\n/**\n * @group Implementation\n * @category Network\n */\nexport const NetworkToChainId: Record<string, number> = {\n mainnet: 1,\n testnet: 2,\n local: 4,\n};\n\n/**\n * @group Implementation\n * @category Network\n */\nexport const NetworkToNetworkName: Record<string, Network> = {\n mainnet: Network.MAINNET,\n testnet: Network.TESTNET,\n devnet: Network.DEVNET,\n local: Network.LOCAL,\n custom: Network.CUSTOM,\n};\n"],"mappings":"AAOO,IAAMA,EAA8C,CACzD,QAAS,+CACT,QAAS,+CACT,OAAQ,8CACR,MAAO,kCACT,EAMaC,EAA2C,CACtD,QAAS,uCACT,QAAS,uCACT,OAAQ,sCACR,MAAO,0BACT,EAMaC,EAA6C,CACxD,OAAQ,sCACR,MAAO,uBACT,EAMaC,EAA6C,CACxD,QAAS,sDACT,QAAS,sDACT,OAAQ,qDAER,MAAO,oDACT,EAMaC,EAA6C,CACxD,QAAS,sDACT,QAAS,sDACT,OAAQ,qDAER,MAAO,oDACT,EAOYC,OACVA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,OAAS,SALCA,OAAA,IAYCC,EAA2C,CACtD,QAAS,EACT,QAAS,EACT,MAAO,CACT,EAMaC,EAAgD,CAC3D,QAAS,UACT,QAAS,UACT,OAAQ,SACR,MAAO,QACP,OAAQ,QACV","names":["NetworkToIndexerAPI","NetworkToNodeAPI","NetworkToFaucetAPI","NetworkToPepperAPI","NetworkToProverAPI","Network","NetworkToChainId","NetworkToNetworkName"]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-4WPQQPUF.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +0,0 @@
1
- var t=255,n=65535,U=4294967295,_=18446744073709551615n,o=340282366920938463463374607431768211455n,i=115792089237316195423570985008687907853269984665640564039457584007913129639935n;export{t as a,n as b,U as c,_ as d,o as e,i as f};
2
- //# sourceMappingURL=chunk-56CNRT2K.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/bcs/consts.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256 } from \"../types\";\n\n// Upper bound values for uint8, uint16, uint64 etc. These are all derived as\n// 2^N - 1, where N is the number of bits in the type.\nexport const MAX_U8_NUMBER: Uint8 = 255;\nexport const MAX_U16_NUMBER: Uint16 = 65535;\nexport const MAX_U32_NUMBER: Uint32 = 4294967295;\nexport const MAX_U64_BIG_INT: Uint64 = 18446744073709551615n;\nexport const MAX_U128_BIG_INT: Uint128 = 340282366920938463463374607431768211455n;\nexport const MAX_U256_BIG_INT: Uint256 =\n 115792089237316195423570985008687907853269984665640564039457584007913129639935n;\n"],"mappings":"AAOO,IAAMA,EAAuB,IACvBC,EAAyB,MACzBC,EAAyB,WACzBC,EAA0B,sBAC1BC,EAA4B,yCAC5BC,EACX","names":["MAX_U8_NUMBER","MAX_U16_NUMBER","MAX_U32_NUMBER","MAX_U64_BIG_INT","MAX_U128_BIG_INT","MAX_U256_BIG_INT"]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-5HXLZHDW.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +0,0 @@
1
- import{h as e}from"./chunk-AMXZQPUQ.mjs";async function i(o){o.minimumLedgerVersion!==void 0&&await e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:o.processorType})}export{i as a};
2
- //# sourceMappingURL=chunk-6OWBKU7N.mjs.map