@aptos-labs/ts-sdk 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.d.ts +1131 -989
- package/dist/browser/index.global.js +30 -30
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +1131 -989
- package/dist/common/index.js +25 -25
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/account.d.mts +12 -6
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +11 -12
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +13 -14
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +13 -13
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +20 -10
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +9 -10
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +13 -14
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +5 -6
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +8 -8
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +11 -12
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +11 -12
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +11 -11
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +6 -6
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/{chunk-S64WKSMI.mjs → chunk-2E2JOGE5.mjs} +2 -2
- package/dist/esm/chunk-3EUOBVCT.mjs +2 -0
- package/dist/esm/{chunk-SRZTA6QH.mjs.map → chunk-3EUOBVCT.mjs.map} +1 -1
- package/dist/esm/{chunk-4OI7MPFH.mjs → chunk-52RTAMN7.mjs} +2 -2
- package/dist/esm/chunk-7BDYKJXX.mjs +2 -0
- package/dist/esm/chunk-7BDYKJXX.mjs.map +1 -0
- package/dist/esm/{chunk-R56OJ4XC.mjs → chunk-7U36LMP4.mjs} +2 -2
- package/dist/esm/{chunk-NWRKJFHV.mjs → chunk-ARIC32W7.mjs} +2 -2
- package/dist/esm/{chunk-SPOHAEHR.mjs → chunk-B7M3OWHV.mjs} +2 -2
- package/dist/esm/{chunk-6SRENFWH.mjs → chunk-BBUAAJRA.mjs} +2 -2
- package/dist/esm/chunk-C3HM7HQP.mjs +2 -0
- package/dist/esm/chunk-C3HM7HQP.mjs.map +1 -0
- package/dist/esm/{chunk-PMWH5IGI.mjs → chunk-CHA5DSSD.mjs} +2 -2
- package/dist/esm/chunk-DE5OOOVY.mjs +2 -0
- package/dist/esm/{chunk-MEPX7Z2Z.mjs.map → chunk-DE5OOOVY.mjs.map} +1 -1
- package/dist/esm/{chunk-JJ6Y35DF.mjs → chunk-DGOT2VR5.mjs} +2 -2
- package/dist/esm/{chunk-EUHPML5E.mjs → chunk-EF2F7NWO.mjs} +2 -2
- package/dist/esm/{chunk-FRLPX47J.mjs → chunk-EQZ757ES.mjs} +2 -2
- package/dist/esm/{chunk-Y4AKS4CY.mjs → chunk-F67Y7YH6.mjs} +2 -2
- package/dist/esm/{chunk-KJGQ4ILY.mjs → chunk-FVMVV4V3.mjs} +2 -2
- package/dist/esm/chunk-FWDKABRW.mjs +2 -0
- package/dist/esm/chunk-FWDKABRW.mjs.map +1 -0
- package/dist/esm/chunk-G62HQC77.mjs +2 -0
- package/dist/esm/chunk-G62HQC77.mjs.map +1 -0
- package/dist/esm/{chunk-V2FPYAK7.mjs → chunk-GQOOXOTN.mjs} +2 -2
- package/dist/esm/chunk-GRJJBGHT.mjs +2 -0
- package/dist/esm/chunk-GRJJBGHT.mjs.map +1 -0
- package/dist/esm/chunk-HEPV52CH.mjs +2 -0
- package/dist/esm/chunk-HEPV52CH.mjs.map +1 -0
- package/dist/esm/{chunk-GD4ULEBC.mjs → chunk-I3TCHVQQ.mjs} +2 -2
- package/dist/esm/{chunk-JQVT2K7G.mjs → chunk-ILJWEPDW.mjs} +2 -2
- package/dist/esm/{chunk-Q3HAJVCM.mjs → chunk-INORE66K.mjs} +2 -2
- package/dist/esm/{chunk-PIXE7MN5.mjs → chunk-J6MWD4XN.mjs} +2 -2
- package/dist/esm/{chunk-ENKMOALS.mjs → chunk-JEHR6GKW.mjs} +2 -2
- package/dist/esm/chunk-JEHR6GKW.mjs.map +1 -0
- package/dist/esm/chunk-KUX6GQ2E.mjs +1 -0
- package/dist/esm/{chunk-ENDUXRTK.mjs → chunk-KWJTVJ7C.mjs} +2 -2
- package/dist/esm/{chunk-W4UDMBMU.mjs → chunk-LLL2LFYH.mjs} +2 -2
- package/dist/esm/chunk-LMXP3JUU.mjs +2 -0
- package/dist/esm/chunk-LMXP3JUU.mjs.map +1 -0
- package/dist/esm/{chunk-2WFMD6C6.mjs → chunk-N65SOKJQ.mjs} +2 -2
- package/dist/esm/{chunk-Q5HK3U64.mjs → chunk-NL3XVNS5.mjs} +2 -2
- package/dist/esm/{chunk-M3WNE7MU.mjs → chunk-NURFZOR4.mjs} +2 -2
- package/dist/esm/{chunk-AFPJ2XXN.mjs → chunk-OG56TYZE.mjs} +2 -2
- package/dist/esm/chunk-Q6WOHF4A.mjs +2 -0
- package/dist/esm/chunk-Q6WOHF4A.mjs.map +1 -0
- package/dist/esm/chunk-QA4XWNIH.mjs +2 -0
- package/dist/esm/chunk-QA4XWNIH.mjs.map +1 -0
- package/dist/esm/chunk-QE4ASJ5K.mjs +1 -0
- package/dist/esm/chunk-QR72RXBS.mjs +2 -0
- package/dist/esm/chunk-QR72RXBS.mjs.map +1 -0
- package/dist/esm/{chunk-XBVORX5O.mjs → chunk-R4VJDSIP.mjs} +2 -2
- package/dist/esm/{chunk-O57QZZF2.mjs → chunk-S2F6CSH4.mjs} +2 -2
- package/dist/esm/chunk-S2F6CSH4.mjs.map +1 -0
- package/dist/esm/{chunk-2H5Z5EHH.mjs → chunk-TN5BUH4F.mjs} +2 -2
- package/dist/esm/chunk-TNVR7SNR.mjs +2 -0
- package/dist/esm/chunk-TNVR7SNR.mjs.map +1 -0
- package/dist/esm/chunk-TX7UK75Q.mjs +2 -0
- package/dist/esm/chunk-TX7UK75Q.mjs.map +1 -0
- package/dist/esm/{chunk-VPQ46CAO.mjs → chunk-UIUSDBCL.mjs} +2 -2
- package/dist/esm/{chunk-4M46AWXX.mjs → chunk-UMLDKLDL.mjs} +2 -2
- package/dist/esm/chunk-UVSRX4SV.mjs +1 -0
- package/dist/esm/{chunk-2DNPRIS5.mjs → chunk-VEVBHH3M.mjs} +2 -2
- package/dist/esm/{chunk-QGIJNA37.mjs → chunk-VMXBMAYK.mjs} +2 -2
- package/dist/esm/chunk-WKUXBIYB.mjs +2 -0
- package/dist/esm/chunk-WKUXBIYB.mjs.map +1 -0
- package/dist/esm/chunk-WME5D6YR.mjs +2 -0
- package/dist/esm/chunk-WME5D6YR.mjs.map +1 -0
- package/dist/esm/chunk-WTHNSNAX.mjs +2 -0
- package/dist/esm/chunk-WTHNSNAX.mjs.map +1 -0
- package/dist/esm/{chunk-GD5TZLBF.mjs → chunk-X5C3LYI7.mjs} +2 -2
- package/dist/esm/chunk-XKD7W5NO.mjs +2 -0
- package/dist/esm/{chunk-XZYPAQCU.mjs.map → chunk-XKD7W5NO.mjs.map} +1 -1
- package/dist/esm/{chunk-QRQAR6XO.mjs → chunk-XTPFQ4MH.mjs} +2 -2
- package/dist/esm/{chunk-LATJGGVX.mjs → chunk-Y5AJLNUD.mjs} +2 -2
- package/dist/esm/chunk-YDAA4RG4.mjs +2 -0
- package/dist/esm/chunk-YDAA4RG4.mjs.map +1 -0
- package/dist/esm/{chunk-VKZCIGKY.mjs → chunk-YR2R3LW4.mjs} +2 -2
- package/dist/esm/chunk-YZZO6VDC.mjs +2 -0
- package/dist/esm/chunk-YZZO6VDC.mjs.map +1 -0
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/Account.d.mts +20 -0
- package/dist/esm/core/account/Account.mjs +2 -0
- package/dist/esm/core/account/Ed25519Account.d.mts +20 -0
- package/dist/esm/core/account/Ed25519Account.mjs +2 -0
- package/dist/esm/core/account/SingleKeyAccount.d.mts +20 -0
- package/dist/esm/core/account/SingleKeyAccount.mjs +2 -0
- package/dist/esm/core/account/SingleKeyAccount.mjs.map +1 -0
- package/dist/esm/core/account/index.d.mts +305 -0
- package/dist/esm/core/account/index.mjs +2 -0
- package/dist/esm/core/account/index.mjs.map +1 -0
- package/dist/esm/core/authenticationKey.d.mts +7 -68
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +49 -61
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +9 -6
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +17 -14
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +70 -17
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +35 -0
- package/dist/esm/core/crypto/privateKey.mjs +2 -0
- package/dist/esm/core/crypto/privateKey.mjs.map +1 -0
- package/dist/esm/core/crypto/publicKey.d.mts +13 -0
- package/dist/esm/core/crypto/publicKey.mjs +2 -0
- package/dist/esm/core/crypto/publicKey.mjs.map +1 -0
- package/dist/esm/core/crypto/secp256k1.d.mts +43 -67
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.d.mts +28 -0
- package/dist/esm/core/crypto/signature.mjs +2 -0
- package/dist/esm/core/crypto/signature.mjs.map +1 -0
- package/dist/esm/core/crypto/singleKey.d.mts +68 -0
- package/dist/esm/core/crypto/singleKey.mjs +2 -0
- package/dist/esm/core/crypto/singleKey.mjs.map +1 -0
- package/dist/esm/core/index.d.mts +9 -8
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +8 -8
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +10 -4
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +11 -12
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +12 -12
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +17 -14
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +2 -2
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +4 -4
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +10 -11
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +3 -3
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +12 -13
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/publicKey-lq5djCIY.d.mts +113 -0
- package/dist/esm/transactions/authenticator/account.d.mts +6 -4
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +6 -6
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +5 -5
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +6 -7
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +4 -4
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +2 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +8 -8
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +11 -5
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +11 -12
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +11 -12
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +10 -10
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -10
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +8 -8
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +9 -10
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +9 -9
- package/dist/esm/utils/const.d.mts +1 -2
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/src/api/aptosConfig.ts +2 -2
- package/src/api/digitalAsset.ts +20 -0
- package/src/core/account/Account.ts +245 -0
- package/src/core/account/Ed25519Account.ts +88 -0
- package/src/core/account/SingleKeyAccount.ts +120 -0
- package/src/core/account/index.ts +3 -0
- package/src/core/authenticationKey.ts +18 -52
- package/src/core/crypto/ed25519.ts +118 -104
- package/src/core/crypto/index.ts +6 -5
- package/src/core/crypto/multiEd25519.ts +98 -44
- package/src/core/crypto/multiKey.ts +192 -34
- package/src/core/crypto/privateKey.ts +25 -0
- package/src/core/crypto/publicKey.ts +52 -0
- package/src/core/crypto/secp256k1.ts +108 -111
- package/src/core/crypto/signature.ts +46 -0
- package/src/core/crypto/singleKey.ts +180 -0
- package/src/internal/account.ts +5 -3
- package/src/internal/digitalAsset.ts +26 -0
- package/src/transactions/authenticator/account.ts +1 -2
- package/src/transactions/instances/rotationProofChallenge.ts +1 -1
- package/src/transactions/transactionBuilder/transactionBuilder.ts +3 -21
- package/src/transactions/types.ts +1 -1
- package/src/utils/const.ts +0 -4
- package/src/version.ts +1 -1
- package/dist/esm/chunk-2QV6HI3M.mjs +0 -2
- package/dist/esm/chunk-2QV6HI3M.mjs.map +0 -1
- package/dist/esm/chunk-7IGH7N52.mjs +0 -2
- package/dist/esm/chunk-7IGH7N52.mjs.map +0 -1
- package/dist/esm/chunk-CCUD52OF.mjs +0 -2
- package/dist/esm/chunk-CCUD52OF.mjs.map +0 -1
- package/dist/esm/chunk-ENKMOALS.mjs.map +0 -1
- package/dist/esm/chunk-ERWQOVBF.mjs +0 -2
- package/dist/esm/chunk-ERWQOVBF.mjs.map +0 -1
- package/dist/esm/chunk-FBFMQZTM.mjs +0 -2
- package/dist/esm/chunk-FBFMQZTM.mjs.map +0 -1
- package/dist/esm/chunk-FP5DPRYL.mjs +0 -2
- package/dist/esm/chunk-FP5DPRYL.mjs.map +0 -1
- package/dist/esm/chunk-HHJBCGAQ.mjs +0 -2
- package/dist/esm/chunk-HHJBCGAQ.mjs.map +0 -1
- package/dist/esm/chunk-I7WRJY7K.mjs +0 -2
- package/dist/esm/chunk-I7WRJY7K.mjs.map +0 -1
- package/dist/esm/chunk-LHJSG5NE.mjs +0 -2
- package/dist/esm/chunk-LHJSG5NE.mjs.map +0 -1
- package/dist/esm/chunk-MEPX7Z2Z.mjs +0 -2
- package/dist/esm/chunk-O57QZZF2.mjs.map +0 -1
- package/dist/esm/chunk-S3FBGS3W.mjs +0 -2
- package/dist/esm/chunk-S3FBGS3W.mjs.map +0 -1
- package/dist/esm/chunk-SBMJNU2O.mjs +0 -2
- package/dist/esm/chunk-SBMJNU2O.mjs.map +0 -1
- package/dist/esm/chunk-SRZTA6QH.mjs +0 -2
- package/dist/esm/chunk-UCHGKGCF.mjs +0 -2
- package/dist/esm/chunk-UCHGKGCF.mjs.map +0 -1
- package/dist/esm/chunk-UIVJXLRM.mjs +0 -1
- package/dist/esm/chunk-V6JFR2CB.mjs +0 -2
- package/dist/esm/chunk-V6JFR2CB.mjs.map +0 -1
- package/dist/esm/chunk-XZYPAQCU.mjs +0 -2
- package/dist/esm/chunk-YL2EDK5M.mjs +0 -2
- package/dist/esm/chunk-YL2EDK5M.mjs.map +0 -1
- package/dist/esm/chunk-ZFIMVSCR.mjs +0 -2
- package/dist/esm/chunk-ZFIMVSCR.mjs.map +0 -1
- package/dist/esm/core/account.d.mts +0 -184
- package/dist/esm/core/account.mjs +0 -2
- package/dist/esm/core/crypto/anyPublicKey.d.mts +0 -59
- package/dist/esm/core/crypto/anyPublicKey.mjs +0 -2
- package/dist/esm/core/crypto/anySignature.d.mts +0 -31
- package/dist/esm/core/crypto/anySignature.mjs +0 -2
- package/dist/esm/core/crypto/asymmetricCrypto.d.mts +0 -74
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +0 -2
- package/src/core/account.ts +0 -282
- package/src/core/crypto/anyPublicKey.ts +0 -92
- package/src/core/crypto/anySignature.ts +0 -56
- package/src/core/crypto/asymmetricCrypto.ts +0 -77
- /package/dist/esm/{chunk-S64WKSMI.mjs.map → chunk-2E2JOGE5.mjs.map} +0 -0
- /package/dist/esm/{chunk-4OI7MPFH.mjs.map → chunk-52RTAMN7.mjs.map} +0 -0
- /package/dist/esm/{chunk-R56OJ4XC.mjs.map → chunk-7U36LMP4.mjs.map} +0 -0
- /package/dist/esm/{chunk-NWRKJFHV.mjs.map → chunk-ARIC32W7.mjs.map} +0 -0
- /package/dist/esm/{chunk-SPOHAEHR.mjs.map → chunk-B7M3OWHV.mjs.map} +0 -0
- /package/dist/esm/{chunk-6SRENFWH.mjs.map → chunk-BBUAAJRA.mjs.map} +0 -0
- /package/dist/esm/{chunk-PMWH5IGI.mjs.map → chunk-CHA5DSSD.mjs.map} +0 -0
- /package/dist/esm/{chunk-JJ6Y35DF.mjs.map → chunk-DGOT2VR5.mjs.map} +0 -0
- /package/dist/esm/{chunk-EUHPML5E.mjs.map → chunk-EF2F7NWO.mjs.map} +0 -0
- /package/dist/esm/{chunk-FRLPX47J.mjs.map → chunk-EQZ757ES.mjs.map} +0 -0
- /package/dist/esm/{chunk-Y4AKS4CY.mjs.map → chunk-F67Y7YH6.mjs.map} +0 -0
- /package/dist/esm/{chunk-KJGQ4ILY.mjs.map → chunk-FVMVV4V3.mjs.map} +0 -0
- /package/dist/esm/{chunk-V2FPYAK7.mjs.map → chunk-GQOOXOTN.mjs.map} +0 -0
- /package/dist/esm/{chunk-GD4ULEBC.mjs.map → chunk-I3TCHVQQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-JQVT2K7G.mjs.map → chunk-ILJWEPDW.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q3HAJVCM.mjs.map → chunk-INORE66K.mjs.map} +0 -0
- /package/dist/esm/{chunk-PIXE7MN5.mjs.map → chunk-J6MWD4XN.mjs.map} +0 -0
- /package/dist/esm/{chunk-UIVJXLRM.mjs.map → chunk-KUX6GQ2E.mjs.map} +0 -0
- /package/dist/esm/{chunk-ENDUXRTK.mjs.map → chunk-KWJTVJ7C.mjs.map} +0 -0
- /package/dist/esm/{chunk-W4UDMBMU.mjs.map → chunk-LLL2LFYH.mjs.map} +0 -0
- /package/dist/esm/{chunk-2WFMD6C6.mjs.map → chunk-N65SOKJQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q5HK3U64.mjs.map → chunk-NL3XVNS5.mjs.map} +0 -0
- /package/dist/esm/{chunk-M3WNE7MU.mjs.map → chunk-NURFZOR4.mjs.map} +0 -0
- /package/dist/esm/{chunk-AFPJ2XXN.mjs.map → chunk-OG56TYZE.mjs.map} +0 -0
- /package/dist/esm/{core/account.mjs.map → chunk-QE4ASJ5K.mjs.map} +0 -0
- /package/dist/esm/{chunk-XBVORX5O.mjs.map → chunk-R4VJDSIP.mjs.map} +0 -0
- /package/dist/esm/{chunk-2H5Z5EHH.mjs.map → chunk-TN5BUH4F.mjs.map} +0 -0
- /package/dist/esm/{chunk-VPQ46CAO.mjs.map → chunk-UIUSDBCL.mjs.map} +0 -0
- /package/dist/esm/{chunk-4M46AWXX.mjs.map → chunk-UMLDKLDL.mjs.map} +0 -0
- /package/dist/esm/{core/crypto/anyPublicKey.mjs.map → chunk-UVSRX4SV.mjs.map} +0 -0
- /package/dist/esm/{chunk-2DNPRIS5.mjs.map → chunk-VEVBHH3M.mjs.map} +0 -0
- /package/dist/esm/{chunk-QGIJNA37.mjs.map → chunk-VMXBMAYK.mjs.map} +0 -0
- /package/dist/esm/{chunk-GD5TZLBF.mjs.map → chunk-X5C3LYI7.mjs.map} +0 -0
- /package/dist/esm/{chunk-QRQAR6XO.mjs.map → chunk-XTPFQ4MH.mjs.map} +0 -0
- /package/dist/esm/{chunk-LATJGGVX.mjs.map → chunk-Y5AJLNUD.mjs.map} +0 -0
- /package/dist/esm/{chunk-VKZCIGKY.mjs.map → chunk-YR2R3LW4.mjs.map} +0 -0
- /package/dist/esm/core/{crypto/anySignature.mjs.map → account/Account.mjs.map} +0 -0
- /package/dist/esm/core/{crypto/asymmetricCrypto.mjs.map → account/Ed25519Account.mjs.map} +0 -0
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* This error is used to explain why parsing failed.
|
|
5
|
-
*/
|
|
6
|
-
declare class ParsingError<T> extends Error {
|
|
7
|
-
/**
|
|
8
|
-
* This provides a programmatic way to access why parsing failed. Downstream devs
|
|
9
|
-
* might want to use this to build their own error messages if the default error
|
|
10
|
-
* messages are not suitable for their use case. This should be an enum.
|
|
11
|
-
*/
|
|
12
|
-
invalidReason: T;
|
|
13
|
-
constructor(message: string, invalidReason: T);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function,
|
|
17
|
-
* this type is returned from "defensive" functions like isValid.
|
|
18
|
-
*/
|
|
19
|
-
type ParsingResult<T> = {
|
|
20
|
-
/**
|
|
21
|
-
* True if valid, false otherwise.
|
|
22
|
-
*/
|
|
23
|
-
valid: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* If valid is false, this will be a code explaining why parsing failed.
|
|
26
|
-
*/
|
|
27
|
-
invalidReason?: T;
|
|
28
|
-
/**
|
|
29
|
-
* If valid is false, this will be a string explaining why parsing failed.
|
|
30
|
-
*/
|
|
31
|
-
invalidReasonMessage?: string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
3
|
declare const NetworkToIndexerAPI: Record<string, string>;
|
|
35
4
|
declare const NetworkToNodeAPI: Record<string, string>;
|
|
36
5
|
declare const NetworkToFaucetAPI: Record<string, string>;
|
|
@@ -1731,6 +1700,180 @@ type GenerateAccountWithSingleSignerSecp256k1Key = {
|
|
|
1731
1700
|
};
|
|
1732
1701
|
type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;
|
|
1733
1702
|
|
|
1703
|
+
/**
|
|
1704
|
+
* This interface exists to define Deserializable<T> inputs for functions that
|
|
1705
|
+
* deserialize a byte buffer into a type T.
|
|
1706
|
+
* It is not intended to be implemented or extended, because Typescript has no support
|
|
1707
|
+
* for static methods in interfaces.
|
|
1708
|
+
*/
|
|
1709
|
+
interface Deserializable<T> {
|
|
1710
|
+
deserialize(deserializer: Deserializer): T;
|
|
1711
|
+
}
|
|
1712
|
+
declare class Deserializer {
|
|
1713
|
+
private buffer;
|
|
1714
|
+
private offset;
|
|
1715
|
+
constructor(data: Uint8Array);
|
|
1716
|
+
private read;
|
|
1717
|
+
/**
|
|
1718
|
+
* Deserializes a string. UTF8 string is supported. Reads the string's bytes length "l" first,
|
|
1719
|
+
* and then reads "l" bytes of content. Decodes the byte array into a string.
|
|
1720
|
+
*
|
|
1721
|
+
* BCS layout for "string": string_length | string_content
|
|
1722
|
+
* where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
|
|
1723
|
+
*
|
|
1724
|
+
* @example
|
|
1725
|
+
* ```ts
|
|
1726
|
+
* const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
1727
|
+
* assert(deserializer.deserializeStr() === "1234abcd");
|
|
1728
|
+
* ```
|
|
1729
|
+
*/
|
|
1730
|
+
deserializeStr(): string;
|
|
1731
|
+
/**
|
|
1732
|
+
* Deserializes an array of bytes.
|
|
1733
|
+
*
|
|
1734
|
+
* BCS layout for "bytes": bytes_length | bytes
|
|
1735
|
+
* where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.
|
|
1736
|
+
*/
|
|
1737
|
+
deserializeBytes(): Uint8Array;
|
|
1738
|
+
/**
|
|
1739
|
+
* Deserializes an array of bytes. The number of bytes to read is already known.
|
|
1740
|
+
*
|
|
1741
|
+
*/
|
|
1742
|
+
deserializeFixedBytes(len: number): Uint8Array;
|
|
1743
|
+
/**
|
|
1744
|
+
* Deserializes a boolean value.
|
|
1745
|
+
*
|
|
1746
|
+
* BCS layout for "boolean": One byte. "0x01" for true and "0x00" for false.
|
|
1747
|
+
*/
|
|
1748
|
+
deserializeBool(): boolean;
|
|
1749
|
+
/**
|
|
1750
|
+
* Deserializes a uint8 number.
|
|
1751
|
+
*
|
|
1752
|
+
* BCS layout for "uint8": One byte. Binary format in little-endian representation.
|
|
1753
|
+
*/
|
|
1754
|
+
deserializeU8(): Uint8;
|
|
1755
|
+
/**
|
|
1756
|
+
* Deserializes a uint16 number.
|
|
1757
|
+
*
|
|
1758
|
+
* BCS layout for "uint16": Two bytes. Binary format in little-endian representation.
|
|
1759
|
+
* @example
|
|
1760
|
+
* ```ts
|
|
1761
|
+
* const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));
|
|
1762
|
+
* assert(deserializer.deserializeU16() === 4660);
|
|
1763
|
+
* ```
|
|
1764
|
+
*/
|
|
1765
|
+
deserializeU16(): Uint16;
|
|
1766
|
+
/**
|
|
1767
|
+
* Deserializes a uint32 number.
|
|
1768
|
+
*
|
|
1769
|
+
* BCS layout for "uint32": Four bytes. Binary format in little-endian representation.
|
|
1770
|
+
* @example
|
|
1771
|
+
* ```ts
|
|
1772
|
+
* const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));
|
|
1773
|
+
* assert(deserializer.deserializeU32() === 305419896);
|
|
1774
|
+
* ```
|
|
1775
|
+
*/
|
|
1776
|
+
deserializeU32(): Uint32;
|
|
1777
|
+
/**
|
|
1778
|
+
* Deserializes a uint64 number.
|
|
1779
|
+
*
|
|
1780
|
+
* BCS layout for "uint64": Eight bytes. Binary format in little-endian representation.
|
|
1781
|
+
* @example
|
|
1782
|
+
* ```ts
|
|
1783
|
+
* const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
|
|
1784
|
+
* assert(deserializer.deserializeU64() === 1311768467750121216);
|
|
1785
|
+
* ```
|
|
1786
|
+
*/
|
|
1787
|
+
deserializeU64(): Uint64;
|
|
1788
|
+
/**
|
|
1789
|
+
* Deserializes a uint128 number.
|
|
1790
|
+
*
|
|
1791
|
+
* BCS layout for "uint128": Sixteen bytes. Binary format in little-endian representation.
|
|
1792
|
+
*/
|
|
1793
|
+
deserializeU128(): Uint128;
|
|
1794
|
+
/**
|
|
1795
|
+
* Deserializes a uint256 number.
|
|
1796
|
+
*
|
|
1797
|
+
* BCS layout for "uint256": Thirty-two bytes. Binary format in little-endian representation.
|
|
1798
|
+
*/
|
|
1799
|
+
deserializeU256(): Uint256;
|
|
1800
|
+
/**
|
|
1801
|
+
* Deserializes a uleb128 encoded uint32 number.
|
|
1802
|
+
*
|
|
1803
|
+
* BCS use uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values
|
|
1804
|
+
*/
|
|
1805
|
+
deserializeUleb128AsU32(): Uint32;
|
|
1806
|
+
/**
|
|
1807
|
+
* Helper function that primarily exists to support alternative syntax for deserialization.
|
|
1808
|
+
* That is, if we have a `const deserializer: new Deserializer(...)`, instead of having to use
|
|
1809
|
+
* `MyClass.deserialize(deserializer)`, we can call `deserializer.deserialize(MyClass)`.
|
|
1810
|
+
*
|
|
1811
|
+
* @example const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
|
|
1812
|
+
* const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function
|
|
1813
|
+
* // value is now an instance of MyClass
|
|
1814
|
+
* // equivalent to `const value = MyClass.deserialize(deserializer)`
|
|
1815
|
+
* @param cls The BCS-deserializable class to deserialize the buffered bytes into.
|
|
1816
|
+
*
|
|
1817
|
+
* @returns the deserialized value of class type T
|
|
1818
|
+
*/
|
|
1819
|
+
deserialize<T>(cls: Deserializable<T>): T;
|
|
1820
|
+
/**
|
|
1821
|
+
* Deserializes an array of BCS Deserializable values given an existing Deserializer
|
|
1822
|
+
* instance with a loaded byte buffer.
|
|
1823
|
+
*
|
|
1824
|
+
* @param cls The BCS-deserializable class to deserialize the buffered bytes into.
|
|
1825
|
+
* @example
|
|
1826
|
+
* // serialize a vector of addresses
|
|
1827
|
+
* const addresses = new Array<AccountAddress>(
|
|
1828
|
+
* AccountAddress.from("0x1"),
|
|
1829
|
+
* AccountAddress.from("0x2"),
|
|
1830
|
+
* AccountAddress.from("0xa"),
|
|
1831
|
+
* AccountAddress.from("0xb"),
|
|
1832
|
+
* );
|
|
1833
|
+
* const serializer = new Serializer();
|
|
1834
|
+
* serializer.serializeVector(addresses);
|
|
1835
|
+
* const serializedBytes = serializer.toUint8Array();
|
|
1836
|
+
*
|
|
1837
|
+
* // deserialize the bytes into an array of addresses
|
|
1838
|
+
* const deserializer = new Deserializer(serializedBytes);
|
|
1839
|
+
* const deserializedAddresses = deserializer.deserializeVector(AccountAddress);
|
|
1840
|
+
* // deserializedAddresses is now an array of AccountAddress instances
|
|
1841
|
+
* @returns an array of deserialized values of type T
|
|
1842
|
+
*/
|
|
1843
|
+
deserializeVector<T>(cls: Deserializable<T>): Array<T>;
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* This error is used to explain why parsing failed.
|
|
1848
|
+
*/
|
|
1849
|
+
declare class ParsingError<T> extends Error {
|
|
1850
|
+
/**
|
|
1851
|
+
* This provides a programmatic way to access why parsing failed. Downstream devs
|
|
1852
|
+
* might want to use this to build their own error messages if the default error
|
|
1853
|
+
* messages are not suitable for their use case. This should be an enum.
|
|
1854
|
+
*/
|
|
1855
|
+
invalidReason: T;
|
|
1856
|
+
constructor(message: string, invalidReason: T);
|
|
1857
|
+
}
|
|
1858
|
+
/**
|
|
1859
|
+
* Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function,
|
|
1860
|
+
* this type is returned from "defensive" functions like isValid.
|
|
1861
|
+
*/
|
|
1862
|
+
type ParsingResult<T> = {
|
|
1863
|
+
/**
|
|
1864
|
+
* True if valid, false otherwise.
|
|
1865
|
+
*/
|
|
1866
|
+
valid: boolean;
|
|
1867
|
+
/**
|
|
1868
|
+
* If valid is false, this will be a code explaining why parsing failed.
|
|
1869
|
+
*/
|
|
1870
|
+
invalidReason?: T;
|
|
1871
|
+
/**
|
|
1872
|
+
* If valid is false, this will be a string explaining why parsing failed.
|
|
1873
|
+
*/
|
|
1874
|
+
invalidReasonMessage?: string;
|
|
1875
|
+
};
|
|
1876
|
+
|
|
1734
1877
|
/**
|
|
1735
1878
|
* This enum is used to explain why parsing might have failed.
|
|
1736
1879
|
*/
|
|
@@ -2011,169 +2154,26 @@ declare function ensureBoolean(value: unknown): asserts value is boolean;
|
|
|
2011
2154
|
declare const outOfRangeErrorMessage: (value: AnyNumber, min: AnyNumber, max: AnyNumber) => string;
|
|
2012
2155
|
declare function validateNumberInRange<T extends AnyNumber>(value: T, minValue: T, maxValue: T): void;
|
|
2013
2156
|
|
|
2014
|
-
|
|
2015
|
-
* This interface exists to define Deserializable<T> inputs for functions that
|
|
2016
|
-
* deserialize a byte buffer into a type T.
|
|
2017
|
-
* It is not intended to be implemented or extended, because Typescript has no support
|
|
2018
|
-
* for static methods in interfaces.
|
|
2019
|
-
*/
|
|
2020
|
-
interface Deserializable<T> {
|
|
2021
|
-
deserialize(deserializer: Deserializer): T;
|
|
2157
|
+
interface TransactionArgument extends EntryFunctionArgument, ScriptFunctionArgument {
|
|
2022
2158
|
}
|
|
2023
|
-
|
|
2024
|
-
private buffer;
|
|
2025
|
-
private offset;
|
|
2026
|
-
constructor(data: Uint8Array);
|
|
2027
|
-
private read;
|
|
2159
|
+
interface EntryFunctionArgument {
|
|
2028
2160
|
/**
|
|
2029
|
-
*
|
|
2030
|
-
* and then reads "l" bytes of content. Decodes the byte array into a string.
|
|
2031
|
-
*
|
|
2032
|
-
* BCS layout for "string": string_length | string_content
|
|
2033
|
-
* where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
|
|
2034
|
-
*
|
|
2035
|
-
* @example
|
|
2036
|
-
* ```ts
|
|
2037
|
-
* const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
2038
|
-
* assert(deserializer.deserializeStr() === "1234abcd");
|
|
2039
|
-
* ```
|
|
2161
|
+
* Serialize an argument to BCS-serialized bytes.
|
|
2040
2162
|
*/
|
|
2041
|
-
|
|
2163
|
+
serialize(serializer: Serializer): void;
|
|
2042
2164
|
/**
|
|
2043
|
-
*
|
|
2044
|
-
*
|
|
2045
|
-
* BCS layout for "bytes": bytes_length | bytes
|
|
2046
|
-
* where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.
|
|
2165
|
+
* Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains
|
|
2166
|
+
* the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
|
|
2047
2167
|
*/
|
|
2048
|
-
|
|
2168
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
2169
|
+
bcsToBytes(): Uint8Array;
|
|
2170
|
+
bcsToHex(): Hex;
|
|
2171
|
+
}
|
|
2172
|
+
interface ScriptFunctionArgument {
|
|
2049
2173
|
/**
|
|
2050
|
-
*
|
|
2051
|
-
*
|
|
2174
|
+
* Serialize an argument to BCS-serialized bytes.
|
|
2052
2175
|
*/
|
|
2053
|
-
|
|
2054
|
-
/**
|
|
2055
|
-
* Deserializes a boolean value.
|
|
2056
|
-
*
|
|
2057
|
-
* BCS layout for "boolean": One byte. "0x01" for true and "0x00" for false.
|
|
2058
|
-
*/
|
|
2059
|
-
deserializeBool(): boolean;
|
|
2060
|
-
/**
|
|
2061
|
-
* Deserializes a uint8 number.
|
|
2062
|
-
*
|
|
2063
|
-
* BCS layout for "uint8": One byte. Binary format in little-endian representation.
|
|
2064
|
-
*/
|
|
2065
|
-
deserializeU8(): Uint8;
|
|
2066
|
-
/**
|
|
2067
|
-
* Deserializes a uint16 number.
|
|
2068
|
-
*
|
|
2069
|
-
* BCS layout for "uint16": Two bytes. Binary format in little-endian representation.
|
|
2070
|
-
* @example
|
|
2071
|
-
* ```ts
|
|
2072
|
-
* const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));
|
|
2073
|
-
* assert(deserializer.deserializeU16() === 4660);
|
|
2074
|
-
* ```
|
|
2075
|
-
*/
|
|
2076
|
-
deserializeU16(): Uint16;
|
|
2077
|
-
/**
|
|
2078
|
-
* Deserializes a uint32 number.
|
|
2079
|
-
*
|
|
2080
|
-
* BCS layout for "uint32": Four bytes. Binary format in little-endian representation.
|
|
2081
|
-
* @example
|
|
2082
|
-
* ```ts
|
|
2083
|
-
* const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));
|
|
2084
|
-
* assert(deserializer.deserializeU32() === 305419896);
|
|
2085
|
-
* ```
|
|
2086
|
-
*/
|
|
2087
|
-
deserializeU32(): Uint32;
|
|
2088
|
-
/**
|
|
2089
|
-
* Deserializes a uint64 number.
|
|
2090
|
-
*
|
|
2091
|
-
* BCS layout for "uint64": Eight bytes. Binary format in little-endian representation.
|
|
2092
|
-
* @example
|
|
2093
|
-
* ```ts
|
|
2094
|
-
* const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
|
|
2095
|
-
* assert(deserializer.deserializeU64() === 1311768467750121216);
|
|
2096
|
-
* ```
|
|
2097
|
-
*/
|
|
2098
|
-
deserializeU64(): Uint64;
|
|
2099
|
-
/**
|
|
2100
|
-
* Deserializes a uint128 number.
|
|
2101
|
-
*
|
|
2102
|
-
* BCS layout for "uint128": Sixteen bytes. Binary format in little-endian representation.
|
|
2103
|
-
*/
|
|
2104
|
-
deserializeU128(): Uint128;
|
|
2105
|
-
/**
|
|
2106
|
-
* Deserializes a uint256 number.
|
|
2107
|
-
*
|
|
2108
|
-
* BCS layout for "uint256": Thirty-two bytes. Binary format in little-endian representation.
|
|
2109
|
-
*/
|
|
2110
|
-
deserializeU256(): Uint256;
|
|
2111
|
-
/**
|
|
2112
|
-
* Deserializes a uleb128 encoded uint32 number.
|
|
2113
|
-
*
|
|
2114
|
-
* BCS use uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values
|
|
2115
|
-
*/
|
|
2116
|
-
deserializeUleb128AsU32(): Uint32;
|
|
2117
|
-
/**
|
|
2118
|
-
* Helper function that primarily exists to support alternative syntax for deserialization.
|
|
2119
|
-
* That is, if we have a `const deserializer: new Deserializer(...)`, instead of having to use
|
|
2120
|
-
* `MyClass.deserialize(deserializer)`, we can call `deserializer.deserialize(MyClass)`.
|
|
2121
|
-
*
|
|
2122
|
-
* @example const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
|
|
2123
|
-
* const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function
|
|
2124
|
-
* // value is now an instance of MyClass
|
|
2125
|
-
* // equivalent to `const value = MyClass.deserialize(deserializer)`
|
|
2126
|
-
* @param cls The BCS-deserializable class to deserialize the buffered bytes into.
|
|
2127
|
-
*
|
|
2128
|
-
* @returns the deserialized value of class type T
|
|
2129
|
-
*/
|
|
2130
|
-
deserialize<T>(cls: Deserializable<T>): T;
|
|
2131
|
-
/**
|
|
2132
|
-
* Deserializes an array of BCS Deserializable values given an existing Deserializer
|
|
2133
|
-
* instance with a loaded byte buffer.
|
|
2134
|
-
*
|
|
2135
|
-
* @param cls The BCS-deserializable class to deserialize the buffered bytes into.
|
|
2136
|
-
* @example
|
|
2137
|
-
* // serialize a vector of addresses
|
|
2138
|
-
* const addresses = new Array<AccountAddress>(
|
|
2139
|
-
* AccountAddress.from("0x1"),
|
|
2140
|
-
* AccountAddress.from("0x2"),
|
|
2141
|
-
* AccountAddress.from("0xa"),
|
|
2142
|
-
* AccountAddress.from("0xb"),
|
|
2143
|
-
* );
|
|
2144
|
-
* const serializer = new Serializer();
|
|
2145
|
-
* serializer.serializeVector(addresses);
|
|
2146
|
-
* const serializedBytes = serializer.toUint8Array();
|
|
2147
|
-
*
|
|
2148
|
-
* // deserialize the bytes into an array of addresses
|
|
2149
|
-
* const deserializer = new Deserializer(serializedBytes);
|
|
2150
|
-
* const deserializedAddresses = deserializer.deserializeVector(AccountAddress);
|
|
2151
|
-
* // deserializedAddresses is now an array of AccountAddress instances
|
|
2152
|
-
* @returns an array of deserialized values of type T
|
|
2153
|
-
*/
|
|
2154
|
-
deserializeVector<T>(cls: Deserializable<T>): Array<T>;
|
|
2155
|
-
}
|
|
2156
|
-
|
|
2157
|
-
interface TransactionArgument extends EntryFunctionArgument, ScriptFunctionArgument {
|
|
2158
|
-
}
|
|
2159
|
-
interface EntryFunctionArgument {
|
|
2160
|
-
/**
|
|
2161
|
-
* Serialize an argument to BCS-serialized bytes.
|
|
2162
|
-
*/
|
|
2163
|
-
serialize(serializer: Serializer): void;
|
|
2164
|
-
/**
|
|
2165
|
-
* Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains
|
|
2166
|
-
* the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
|
|
2167
|
-
*/
|
|
2168
|
-
serializeForEntryFunction(serializer: Serializer): void;
|
|
2169
|
-
bcsToBytes(): Uint8Array;
|
|
2170
|
-
bcsToHex(): Hex;
|
|
2171
|
-
}
|
|
2172
|
-
interface ScriptFunctionArgument {
|
|
2173
|
-
/**
|
|
2174
|
-
* Serialize an argument to BCS-serialized bytes.
|
|
2175
|
-
*/
|
|
2176
|
-
serialize(serializer: Serializer): void;
|
|
2176
|
+
serialize(serializer: Serializer): void;
|
|
2177
2177
|
/**
|
|
2178
2178
|
* Serialize an argument to BCS-serialized bytes as a type aware byte sequence.
|
|
2179
2179
|
* The byte sequence contains an enum variant index followed by the BCS-serialized
|
|
@@ -2184,238 +2184,6 @@ interface ScriptFunctionArgument {
|
|
|
2184
2184
|
bcsToHex(): Hex;
|
|
2185
2185
|
}
|
|
2186
2186
|
|
|
2187
|
-
/**
|
|
2188
|
-
* This enum is used to explain why an address was invalid.
|
|
2189
|
-
*/
|
|
2190
|
-
declare enum AddressInvalidReason {
|
|
2191
|
-
INCORRECT_NUMBER_OF_BYTES = "incorrect_number_of_bytes",
|
|
2192
|
-
INVALID_HEX_CHARS = "invalid_hex_chars",
|
|
2193
|
-
TOO_SHORT = "too_short",
|
|
2194
|
-
TOO_LONG = "too_long",
|
|
2195
|
-
LEADING_ZERO_X_REQUIRED = "leading_zero_x_required",
|
|
2196
|
-
LONG_FORM_REQUIRED_UNLESS_SPECIAL = "long_form_required_unless_special",
|
|
2197
|
-
INVALID_PADDING_ZEROES = "INVALID_PADDING_ZEROES"
|
|
2198
|
-
}
|
|
2199
|
-
type AccountAddressInput = HexInput | AccountAddress;
|
|
2200
|
-
/**
|
|
2201
|
-
* NOTE: Only use this class for account addresses. For other hex data, e.g. transaction
|
|
2202
|
-
* hashes, use the Hex class.
|
|
2203
|
-
*
|
|
2204
|
-
* AccountAddress is used for working with account addresses. Account addresses, when
|
|
2205
|
-
* represented as a string, generally look like these examples:
|
|
2206
|
-
* - 0x1
|
|
2207
|
-
* - 0xaa86fe99004361f747f91342ca13c426ca0cccb0c1217677180c9493bad6ef0c
|
|
2208
|
-
*
|
|
2209
|
-
* Proper formatting and parsing of account addresses is defined by AIP-40.
|
|
2210
|
-
* To learn more about the standard, read the AIP here:
|
|
2211
|
-
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2212
|
-
*
|
|
2213
|
-
* The comments in this class make frequent reference to the LONG and SHORT formats,
|
|
2214
|
-
* as well as "special" addresses. To learn what these refer to see AIP-40.
|
|
2215
|
-
*/
|
|
2216
|
-
declare class AccountAddress extends Serializable implements TransactionArgument {
|
|
2217
|
-
/**
|
|
2218
|
-
* This is the internal representation of an account address.
|
|
2219
|
-
*/
|
|
2220
|
-
readonly data: Uint8Array;
|
|
2221
|
-
/**
|
|
2222
|
-
* The number of bytes that make up an account address.
|
|
2223
|
-
*/
|
|
2224
|
-
static readonly LENGTH: number;
|
|
2225
|
-
/**
|
|
2226
|
-
* The length of an address string in LONG form without a leading 0x.
|
|
2227
|
-
*/
|
|
2228
|
-
static readonly LONG_STRING_LENGTH: number;
|
|
2229
|
-
static ZERO: AccountAddress;
|
|
2230
|
-
static ONE: AccountAddress;
|
|
2231
|
-
static TWO: AccountAddress;
|
|
2232
|
-
static THREE: AccountAddress;
|
|
2233
|
-
static FOUR: AccountAddress;
|
|
2234
|
-
/**
|
|
2235
|
-
* Creates an instance of AccountAddress from a Uint8Array.
|
|
2236
|
-
*
|
|
2237
|
-
* @param args.data A Uint8Array representing an account address.
|
|
2238
|
-
*/
|
|
2239
|
-
constructor(input: Uint8Array);
|
|
2240
|
-
/**
|
|
2241
|
-
* Returns whether an address is special, where special is defined as 0x0 to 0xf
|
|
2242
|
-
* inclusive. In other words, the last byte of the address must be < 0b10000 (16)
|
|
2243
|
-
* and every other byte must be zero.
|
|
2244
|
-
*
|
|
2245
|
-
* For more information on how special addresses are defined see AIP-40:
|
|
2246
|
-
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2247
|
-
*
|
|
2248
|
-
* @returns true if the address is special, false if not.
|
|
2249
|
-
*/
|
|
2250
|
-
isSpecial(): boolean;
|
|
2251
|
-
/**
|
|
2252
|
-
* Return the AccountAddress as a string as per AIP-40.
|
|
2253
|
-
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2254
|
-
*
|
|
2255
|
-
* In short, it means that special addresses are represented in SHORT form, meaning
|
|
2256
|
-
* 0x0 through to 0xf inclusive, and every other address is represented in LONG form,
|
|
2257
|
-
* meaning 0x + 64 hex characters.
|
|
2258
|
-
*
|
|
2259
|
-
* @returns AccountAddress as a string conforming to AIP-40.
|
|
2260
|
-
*/
|
|
2261
|
-
toString(): `0x${string}`;
|
|
2262
|
-
/**
|
|
2263
|
-
* NOTE: Prefer to use `toString` where possible.
|
|
2264
|
-
*
|
|
2265
|
-
* Return the AccountAddress as a string as per AIP-40 but without the leading 0x.
|
|
2266
|
-
*
|
|
2267
|
-
* Learn more by reading the docstring of `toString`.
|
|
2268
|
-
*
|
|
2269
|
-
* @returns AccountAddress as a string conforming to AIP-40 but without the leading 0x.
|
|
2270
|
-
*/
|
|
2271
|
-
toStringWithoutPrefix(): string;
|
|
2272
|
-
/**
|
|
2273
|
-
* NOTE: Prefer to use `toString` where possible.
|
|
2274
|
-
*
|
|
2275
|
-
* Whereas toString will format special addresses (as defined by isSpecial) using the
|
|
2276
|
-
* SHORT form (no leading 0s), this format the address in the LONG format
|
|
2277
|
-
* unconditionally.
|
|
2278
|
-
*
|
|
2279
|
-
* This means it will be 0x + 64 hex characters.
|
|
2280
|
-
*
|
|
2281
|
-
* @returns AccountAddress as a string in LONG form.
|
|
2282
|
-
*/
|
|
2283
|
-
toStringLong(): `0x${string}`;
|
|
2284
|
-
/**
|
|
2285
|
-
* NOTE: Prefer to use `toString` where possible.
|
|
2286
|
-
*
|
|
2287
|
-
* Whereas toString will format special addresses (as defined by isSpecial) using the
|
|
2288
|
-
* SHORT form (no leading 0s), this function will include leading zeroes. The string
|
|
2289
|
-
* will not have a leading zero.
|
|
2290
|
-
*
|
|
2291
|
-
* This means it will be 64 hex characters without a leading 0x.
|
|
2292
|
-
*
|
|
2293
|
-
* @returns AccountAddress as a string in LONG form without a leading 0x.
|
|
2294
|
-
*/
|
|
2295
|
-
toStringLongWithoutPrefix(): string;
|
|
2296
|
-
/**
|
|
2297
|
-
* Get the inner hex data. The inner data is already a Uint8Array so no conversion
|
|
2298
|
-
* is taking place here, it just returns the inner data.
|
|
2299
|
-
*
|
|
2300
|
-
* @returns Hex data as Uint8Array
|
|
2301
|
-
*/
|
|
2302
|
-
toUint8Array(): Uint8Array;
|
|
2303
|
-
/**
|
|
2304
|
-
* Serialize the AccountAddress to a Serializer instance's data buffer.
|
|
2305
|
-
* @param serializer The serializer to serialize the AccountAddress to.
|
|
2306
|
-
* @returns void
|
|
2307
|
-
* @example
|
|
2308
|
-
* const serializer = new Serializer();
|
|
2309
|
-
* const address = AccountAddress.fromString("0x1");
|
|
2310
|
-
* address.serialize(serializer);
|
|
2311
|
-
* const bytes = serializer.toUint8Array();
|
|
2312
|
-
* // `bytes` is now the BCS-serialized address.
|
|
2313
|
-
*/
|
|
2314
|
-
serialize(serializer: Serializer): void;
|
|
2315
|
-
serializeForEntryFunction(serializer: Serializer): void;
|
|
2316
|
-
serializeForScriptFunction(serializer: Serializer): void;
|
|
2317
|
-
/**
|
|
2318
|
-
* Deserialize an AccountAddress from the byte buffer in a Deserializer instance.
|
|
2319
|
-
* @param deserializer The deserializer to deserialize the AccountAddress from.
|
|
2320
|
-
* @returns An instance of AccountAddress.
|
|
2321
|
-
* @example
|
|
2322
|
-
* const bytes = hexToBytes("0x0102030405060708091011121314151617181920212223242526272829303132");
|
|
2323
|
-
* const deserializer = new Deserializer(bytes);
|
|
2324
|
-
* const address = AccountAddress.deserialize(deserializer);
|
|
2325
|
-
* // `address` is now an instance of AccountAddress.
|
|
2326
|
-
*/
|
|
2327
|
-
static deserialize(deserializer: Deserializer): AccountAddress;
|
|
2328
|
-
/**
|
|
2329
|
-
* NOTE: This function has strict parsing behavior. For relaxed behavior, please use
|
|
2330
|
-
* the `fromString` function.
|
|
2331
|
-
*
|
|
2332
|
-
* Creates an instance of AccountAddress from a hex string.
|
|
2333
|
-
*
|
|
2334
|
-
* This function allows only the strictest formats defined by AIP-40. In short this
|
|
2335
|
-
* means only the following formats are accepted:
|
|
2336
|
-
*
|
|
2337
|
-
* - LONG
|
|
2338
|
-
* - SHORT for special addresses
|
|
2339
|
-
*
|
|
2340
|
-
* Where:
|
|
2341
|
-
* - LONG is defined as 0x + 64 hex characters.
|
|
2342
|
-
* - SHORT for special addresses is 0x0 to 0xf inclusive without padding zeroes.
|
|
2343
|
-
*
|
|
2344
|
-
* This means the following are not accepted:
|
|
2345
|
-
* - SHORT for non-special addresses.
|
|
2346
|
-
* - Any address without a leading 0x.
|
|
2347
|
-
*
|
|
2348
|
-
* Learn more about the different address formats by reading AIP-40:
|
|
2349
|
-
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2350
|
-
*
|
|
2351
|
-
* @param input A hex string representing an account address.
|
|
2352
|
-
*
|
|
2353
|
-
* @returns An instance of AccountAddress.
|
|
2354
|
-
*/
|
|
2355
|
-
static fromStringStrict(input: string): AccountAddress;
|
|
2356
|
-
/**
|
|
2357
|
-
* NOTE: This function has relaxed parsing behavior. For strict behavior, please use
|
|
2358
|
-
* the `fromStringStrict` function. Where possible use `fromStringStrict` rather than this
|
|
2359
|
-
* function, `fromString` is only provided for backwards compatibility.
|
|
2360
|
-
*
|
|
2361
|
-
* Creates an instance of AccountAddress from a hex string.
|
|
2362
|
-
*
|
|
2363
|
-
* This function allows all formats defined by AIP-40. In short this means the
|
|
2364
|
-
* following formats are accepted:
|
|
2365
|
-
*
|
|
2366
|
-
* - LONG, with or without leading 0x
|
|
2367
|
-
* - SHORT, with or without leading 0x
|
|
2368
|
-
*
|
|
2369
|
-
* Where:
|
|
2370
|
-
* - LONG is 64 hex characters.
|
|
2371
|
-
* - SHORT is 1 to 63 hex characters inclusive.
|
|
2372
|
-
* - Padding zeroes are allowed, e.g. 0x0123 is valid.
|
|
2373
|
-
*
|
|
2374
|
-
* Learn more about the different address formats by reading AIP-40:
|
|
2375
|
-
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2376
|
-
*
|
|
2377
|
-
* @param input A hex string representing an account address.
|
|
2378
|
-
*
|
|
2379
|
-
* @returns An instance of AccountAddress.
|
|
2380
|
-
*/
|
|
2381
|
-
static fromString(input: string): AccountAddress;
|
|
2382
|
-
/**
|
|
2383
|
-
* Convenience method for creating an AccountAddress from all known inputs.
|
|
2384
|
-
*
|
|
2385
|
-
* This handles, Uint8array, string, and AccountAddress itself
|
|
2386
|
-
* @param input
|
|
2387
|
-
*/
|
|
2388
|
-
static from(input: AccountAddressInput): AccountAddress;
|
|
2389
|
-
/**
|
|
2390
|
-
* Convenience method for creating an AccountAddress from all known inputs.
|
|
2391
|
-
*
|
|
2392
|
-
* This handles, Uint8array, string, and AccountAddress itself
|
|
2393
|
-
* @param input
|
|
2394
|
-
*/
|
|
2395
|
-
static fromStrict(input: AccountAddressInput): AccountAddress;
|
|
2396
|
-
/**
|
|
2397
|
-
* Check if the string is a valid AccountAddress.
|
|
2398
|
-
*
|
|
2399
|
-
* @param args.input A hex string representing an account address.
|
|
2400
|
-
* @param args.strict If true, use strict parsing behavior. If false, use relaxed parsing behavior.
|
|
2401
|
-
*
|
|
2402
|
-
* @returns valid = true if the string is valid, valid = false if not. If the string
|
|
2403
|
-
* is not valid, invalidReason will be set explaining why it is invalid.
|
|
2404
|
-
*/
|
|
2405
|
-
static isValid(args: {
|
|
2406
|
-
input: AccountAddressInput;
|
|
2407
|
-
strict?: boolean;
|
|
2408
|
-
}): ParsingResult<AddressInvalidReason>;
|
|
2409
|
-
/**
|
|
2410
|
-
* Return whether AccountAddresses are equal. AccountAddresses are considered equal
|
|
2411
|
-
* if their underlying byte data is identical.
|
|
2412
|
-
*
|
|
2413
|
-
* @param other The AccountAddress to compare to.
|
|
2414
|
-
* @returns true if the AccountAddresses are equal, false if not.
|
|
2415
|
-
*/
|
|
2416
|
-
equals(other: AccountAddress): boolean;
|
|
2417
|
-
}
|
|
2418
|
-
|
|
2419
2187
|
/**
|
|
2420
2188
|
* This class exists to represent a contiguous sequence of already serialized BCS-bytes.
|
|
2421
2189
|
*
|
|
@@ -2794,85 +2562,253 @@ declare class MoveOption<T extends Serializable & EntryFunctionArgument> extends
|
|
|
2794
2562
|
* the resulting MoveOption's .isSome() method will return false.
|
|
2795
2563
|
* @returns a MoveOption<Bool> with an inner value `value`
|
|
2796
2564
|
*/
|
|
2797
|
-
static Bool(value?: boolean | null): MoveOption<Bool>;
|
|
2565
|
+
static Bool(value?: boolean | null): MoveOption<Bool>;
|
|
2566
|
+
/**
|
|
2567
|
+
* Factory method to generate a MoveOption<MoveString> from a `string` or `undefined`.
|
|
2568
|
+
*
|
|
2569
|
+
* @example
|
|
2570
|
+
* MoveOption.MoveString("hello").isSome() === true;
|
|
2571
|
+
* MoveOption.MoveString("").isSome() === true;
|
|
2572
|
+
* MoveOption.MoveString().isSome() === false;
|
|
2573
|
+
* MoveOption.MoveString(undefined).isSome() === false;
|
|
2574
|
+
* @params value: the value used to fill the MoveOption. If `value` is undefined
|
|
2575
|
+
* the resulting MoveOption's .isSome() method will return false.
|
|
2576
|
+
* @returns a MoveOption<MoveString> with an inner value `value`
|
|
2577
|
+
*/
|
|
2578
|
+
static MoveString(value?: string | null): MoveOption<MoveString>;
|
|
2579
|
+
static deserialize<U extends Serializable & EntryFunctionArgument>(deserializer: Deserializer, cls: Deserializable<U>): MoveOption<U>;
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
/**
|
|
2583
|
+
* This enum is used to explain why an address was invalid.
|
|
2584
|
+
*/
|
|
2585
|
+
declare enum AddressInvalidReason {
|
|
2586
|
+
INCORRECT_NUMBER_OF_BYTES = "incorrect_number_of_bytes",
|
|
2587
|
+
INVALID_HEX_CHARS = "invalid_hex_chars",
|
|
2588
|
+
TOO_SHORT = "too_short",
|
|
2589
|
+
TOO_LONG = "too_long",
|
|
2590
|
+
LEADING_ZERO_X_REQUIRED = "leading_zero_x_required",
|
|
2591
|
+
LONG_FORM_REQUIRED_UNLESS_SPECIAL = "long_form_required_unless_special",
|
|
2592
|
+
INVALID_PADDING_ZEROES = "INVALID_PADDING_ZEROES"
|
|
2593
|
+
}
|
|
2594
|
+
type AccountAddressInput = HexInput | AccountAddress;
|
|
2595
|
+
/**
|
|
2596
|
+
* NOTE: Only use this class for account addresses. For other hex data, e.g. transaction
|
|
2597
|
+
* hashes, use the Hex class.
|
|
2598
|
+
*
|
|
2599
|
+
* AccountAddress is used for working with account addresses. Account addresses, when
|
|
2600
|
+
* represented as a string, generally look like these examples:
|
|
2601
|
+
* - 0x1
|
|
2602
|
+
* - 0xaa86fe99004361f747f91342ca13c426ca0cccb0c1217677180c9493bad6ef0c
|
|
2603
|
+
*
|
|
2604
|
+
* Proper formatting and parsing of account addresses is defined by AIP-40.
|
|
2605
|
+
* To learn more about the standard, read the AIP here:
|
|
2606
|
+
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2607
|
+
*
|
|
2608
|
+
* The comments in this class make frequent reference to the LONG and SHORT formats,
|
|
2609
|
+
* as well as "special" addresses. To learn what these refer to see AIP-40.
|
|
2610
|
+
*/
|
|
2611
|
+
declare class AccountAddress extends Serializable implements TransactionArgument {
|
|
2612
|
+
/**
|
|
2613
|
+
* This is the internal representation of an account address.
|
|
2614
|
+
*/
|
|
2615
|
+
readonly data: Uint8Array;
|
|
2616
|
+
/**
|
|
2617
|
+
* The number of bytes that make up an account address.
|
|
2618
|
+
*/
|
|
2619
|
+
static readonly LENGTH: number;
|
|
2620
|
+
/**
|
|
2621
|
+
* The length of an address string in LONG form without a leading 0x.
|
|
2622
|
+
*/
|
|
2623
|
+
static readonly LONG_STRING_LENGTH: number;
|
|
2624
|
+
static ZERO: AccountAddress;
|
|
2625
|
+
static ONE: AccountAddress;
|
|
2626
|
+
static TWO: AccountAddress;
|
|
2627
|
+
static THREE: AccountAddress;
|
|
2628
|
+
static FOUR: AccountAddress;
|
|
2629
|
+
/**
|
|
2630
|
+
* Creates an instance of AccountAddress from a Uint8Array.
|
|
2631
|
+
*
|
|
2632
|
+
* @param args.data A Uint8Array representing an account address.
|
|
2633
|
+
*/
|
|
2634
|
+
constructor(input: Uint8Array);
|
|
2635
|
+
/**
|
|
2636
|
+
* Returns whether an address is special, where special is defined as 0x0 to 0xf
|
|
2637
|
+
* inclusive. In other words, the last byte of the address must be < 0b10000 (16)
|
|
2638
|
+
* and every other byte must be zero.
|
|
2639
|
+
*
|
|
2640
|
+
* For more information on how special addresses are defined see AIP-40:
|
|
2641
|
+
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2642
|
+
*
|
|
2643
|
+
* @returns true if the address is special, false if not.
|
|
2644
|
+
*/
|
|
2645
|
+
isSpecial(): boolean;
|
|
2646
|
+
/**
|
|
2647
|
+
* Return the AccountAddress as a string as per AIP-40.
|
|
2648
|
+
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2649
|
+
*
|
|
2650
|
+
* In short, it means that special addresses are represented in SHORT form, meaning
|
|
2651
|
+
* 0x0 through to 0xf inclusive, and every other address is represented in LONG form,
|
|
2652
|
+
* meaning 0x + 64 hex characters.
|
|
2653
|
+
*
|
|
2654
|
+
* @returns AccountAddress as a string conforming to AIP-40.
|
|
2655
|
+
*/
|
|
2656
|
+
toString(): `0x${string}`;
|
|
2657
|
+
/**
|
|
2658
|
+
* NOTE: Prefer to use `toString` where possible.
|
|
2659
|
+
*
|
|
2660
|
+
* Return the AccountAddress as a string as per AIP-40 but without the leading 0x.
|
|
2661
|
+
*
|
|
2662
|
+
* Learn more by reading the docstring of `toString`.
|
|
2663
|
+
*
|
|
2664
|
+
* @returns AccountAddress as a string conforming to AIP-40 but without the leading 0x.
|
|
2665
|
+
*/
|
|
2666
|
+
toStringWithoutPrefix(): string;
|
|
2667
|
+
/**
|
|
2668
|
+
* NOTE: Prefer to use `toString` where possible.
|
|
2669
|
+
*
|
|
2670
|
+
* Whereas toString will format special addresses (as defined by isSpecial) using the
|
|
2671
|
+
* SHORT form (no leading 0s), this format the address in the LONG format
|
|
2672
|
+
* unconditionally.
|
|
2673
|
+
*
|
|
2674
|
+
* This means it will be 0x + 64 hex characters.
|
|
2675
|
+
*
|
|
2676
|
+
* @returns AccountAddress as a string in LONG form.
|
|
2677
|
+
*/
|
|
2678
|
+
toStringLong(): `0x${string}`;
|
|
2798
2679
|
/**
|
|
2799
|
-
*
|
|
2680
|
+
* NOTE: Prefer to use `toString` where possible.
|
|
2800
2681
|
*
|
|
2801
|
-
*
|
|
2802
|
-
*
|
|
2803
|
-
*
|
|
2804
|
-
*
|
|
2805
|
-
*
|
|
2806
|
-
*
|
|
2807
|
-
*
|
|
2808
|
-
* @returns a MoveOption<MoveString> with an inner value `value`
|
|
2682
|
+
* Whereas toString will format special addresses (as defined by isSpecial) using the
|
|
2683
|
+
* SHORT form (no leading 0s), this function will include leading zeroes. The string
|
|
2684
|
+
* will not have a leading zero.
|
|
2685
|
+
*
|
|
2686
|
+
* This means it will be 64 hex characters without a leading 0x.
|
|
2687
|
+
*
|
|
2688
|
+
* @returns AccountAddress as a string in LONG form without a leading 0x.
|
|
2809
2689
|
*/
|
|
2810
|
-
|
|
2811
|
-
static deserialize<U extends Serializable & EntryFunctionArgument>(deserializer: Deserializer, cls: Deserializable<U>): MoveOption<U>;
|
|
2812
|
-
}
|
|
2813
|
-
|
|
2814
|
-
/**
|
|
2815
|
-
* An abstract representation of a public key. All Asymmetric key pairs will use this to
|
|
2816
|
-
* verify signatures and for authentication keys.
|
|
2817
|
-
*/
|
|
2818
|
-
declare abstract class PublicKey extends Serializable {
|
|
2690
|
+
toStringLongWithoutPrefix(): string;
|
|
2819
2691
|
/**
|
|
2820
|
-
*
|
|
2821
|
-
*
|
|
2822
|
-
*
|
|
2692
|
+
* Get the inner hex data. The inner data is already a Uint8Array so no conversion
|
|
2693
|
+
* is taking place here, it just returns the inner data.
|
|
2694
|
+
*
|
|
2695
|
+
* @returns Hex data as Uint8Array
|
|
2823
2696
|
*/
|
|
2824
|
-
|
|
2825
|
-
message: HexInput;
|
|
2826
|
-
signature: Signature;
|
|
2827
|
-
}): boolean;
|
|
2697
|
+
toUint8Array(): Uint8Array;
|
|
2828
2698
|
/**
|
|
2829
|
-
*
|
|
2699
|
+
* Serialize the AccountAddress to a Serializer instance's data buffer.
|
|
2700
|
+
* @param serializer The serializer to serialize the AccountAddress to.
|
|
2701
|
+
* @returns void
|
|
2702
|
+
* @example
|
|
2703
|
+
* const serializer = new Serializer();
|
|
2704
|
+
* const address = AccountAddress.fromString("0x1");
|
|
2705
|
+
* address.serialize(serializer);
|
|
2706
|
+
* const bytes = serializer.toUint8Array();
|
|
2707
|
+
* // `bytes` is now the BCS-serialized address.
|
|
2830
2708
|
*/
|
|
2831
|
-
|
|
2709
|
+
serialize(serializer: Serializer): void;
|
|
2710
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
2711
|
+
serializeForScriptFunction(serializer: Serializer): void;
|
|
2832
2712
|
/**
|
|
2833
|
-
*
|
|
2713
|
+
* Deserialize an AccountAddress from the byte buffer in a Deserializer instance.
|
|
2714
|
+
* @param deserializer The deserializer to deserialize the AccountAddress from.
|
|
2715
|
+
* @returns An instance of AccountAddress.
|
|
2716
|
+
* @example
|
|
2717
|
+
* const bytes = hexToBytes("0x0102030405060708091011121314151617181920212223242526272829303132");
|
|
2718
|
+
* const deserializer = new Deserializer(bytes);
|
|
2719
|
+
* const address = AccountAddress.deserialize(deserializer);
|
|
2720
|
+
* // `address` is now an instance of AccountAddress.
|
|
2834
2721
|
*/
|
|
2835
|
-
|
|
2836
|
-
abstract serialize(serializer: Serializer): void;
|
|
2837
|
-
}
|
|
2838
|
-
/**
|
|
2839
|
-
* An abstract representation of a private key. This is used to sign transactions and
|
|
2840
|
-
* derive the public key associated.
|
|
2841
|
-
*/
|
|
2842
|
-
declare abstract class PrivateKey extends Serializable {
|
|
2722
|
+
static deserialize(deserializer: Deserializer): AccountAddress;
|
|
2843
2723
|
/**
|
|
2844
|
-
*
|
|
2845
|
-
*
|
|
2724
|
+
* NOTE: This function has strict parsing behavior. For relaxed behavior, please use
|
|
2725
|
+
* the `fromString` function.
|
|
2726
|
+
*
|
|
2727
|
+
* Creates an instance of AccountAddress from a hex string.
|
|
2728
|
+
*
|
|
2729
|
+
* This function allows only the strictest formats defined by AIP-40. In short this
|
|
2730
|
+
* means only the following formats are accepted:
|
|
2731
|
+
*
|
|
2732
|
+
* - LONG
|
|
2733
|
+
* - SHORT for special addresses
|
|
2734
|
+
*
|
|
2735
|
+
* Where:
|
|
2736
|
+
* - LONG is defined as 0x + 64 hex characters.
|
|
2737
|
+
* - SHORT for special addresses is 0x0 to 0xf inclusive without padding zeroes.
|
|
2738
|
+
*
|
|
2739
|
+
* This means the following are not accepted:
|
|
2740
|
+
* - SHORT for non-special addresses.
|
|
2741
|
+
* - Any address without a leading 0x.
|
|
2742
|
+
*
|
|
2743
|
+
* Learn more about the different address formats by reading AIP-40:
|
|
2744
|
+
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2745
|
+
*
|
|
2746
|
+
* @param input A hex string representing an account address.
|
|
2747
|
+
*
|
|
2748
|
+
* @returns An instance of AccountAddress.
|
|
2846
2749
|
*/
|
|
2847
|
-
|
|
2750
|
+
static fromStringStrict(input: string): AccountAddress;
|
|
2848
2751
|
/**
|
|
2849
|
-
*
|
|
2752
|
+
* NOTE: This function has relaxed parsing behavior. For strict behavior, please use
|
|
2753
|
+
* the `fromStringStrict` function. Where possible use `fromStringStrict` rather than this
|
|
2754
|
+
* function, `fromString` is only provided for backwards compatibility.
|
|
2755
|
+
*
|
|
2756
|
+
* Creates an instance of AccountAddress from a hex string.
|
|
2757
|
+
*
|
|
2758
|
+
* This function allows all formats defined by AIP-40. In short this means the
|
|
2759
|
+
* following formats are accepted:
|
|
2760
|
+
*
|
|
2761
|
+
* - LONG, with or without leading 0x
|
|
2762
|
+
* - SHORT, with or without leading 0x
|
|
2763
|
+
*
|
|
2764
|
+
* Where:
|
|
2765
|
+
* - LONG is 64 hex characters.
|
|
2766
|
+
* - SHORT is 1 to 63 hex characters inclusive.
|
|
2767
|
+
* - Padding zeroes are allowed, e.g. 0x0123 is valid.
|
|
2768
|
+
*
|
|
2769
|
+
* Learn more about the different address formats by reading AIP-40:
|
|
2770
|
+
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2771
|
+
*
|
|
2772
|
+
* @param input A hex string representing an account address.
|
|
2773
|
+
*
|
|
2774
|
+
* @returns An instance of AccountAddress.
|
|
2850
2775
|
*/
|
|
2851
|
-
|
|
2776
|
+
static fromString(input: string): AccountAddress;
|
|
2852
2777
|
/**
|
|
2853
|
-
*
|
|
2778
|
+
* Convenience method for creating an AccountAddress from all known inputs.
|
|
2779
|
+
*
|
|
2780
|
+
* This handles, Uint8array, string, and AccountAddress itself
|
|
2781
|
+
* @param input
|
|
2854
2782
|
*/
|
|
2855
|
-
|
|
2856
|
-
abstract serialize(serializer: Serializer): void;
|
|
2783
|
+
static from(input: AccountAddressInput): AccountAddress;
|
|
2857
2784
|
/**
|
|
2858
|
-
*
|
|
2785
|
+
* Convenience method for creating an AccountAddress from all known inputs.
|
|
2786
|
+
*
|
|
2787
|
+
* This handles, Uint8array, string, and AccountAddress itself
|
|
2788
|
+
* @param input
|
|
2859
2789
|
*/
|
|
2860
|
-
|
|
2861
|
-
}
|
|
2862
|
-
/**
|
|
2863
|
-
* An abstract representation of a signature. This is the product of signing a
|
|
2864
|
-
* message and can be used with the PublicKey to verify the signature.
|
|
2865
|
-
*/
|
|
2866
|
-
declare abstract class Signature extends Serializable {
|
|
2790
|
+
static fromStrict(input: AccountAddressInput): AccountAddress;
|
|
2867
2791
|
/**
|
|
2868
|
-
*
|
|
2792
|
+
* Check if the string is a valid AccountAddress.
|
|
2793
|
+
*
|
|
2794
|
+
* @param args.input A hex string representing an account address.
|
|
2795
|
+
* @param args.strict If true, use strict parsing behavior. If false, use relaxed parsing behavior.
|
|
2796
|
+
*
|
|
2797
|
+
* @returns valid = true if the string is valid, valid = false if not. If the string
|
|
2798
|
+
* is not valid, invalidReason will be set explaining why it is invalid.
|
|
2869
2799
|
*/
|
|
2870
|
-
|
|
2800
|
+
static isValid(args: {
|
|
2801
|
+
input: AccountAddressInput;
|
|
2802
|
+
strict?: boolean;
|
|
2803
|
+
}): ParsingResult<AddressInvalidReason>;
|
|
2871
2804
|
/**
|
|
2872
|
-
*
|
|
2805
|
+
* Return whether AccountAddresses are equal. AccountAddresses are considered equal
|
|
2806
|
+
* if their underlying byte data is identical.
|
|
2807
|
+
*
|
|
2808
|
+
* @param other The AccountAddress to compare to.
|
|
2809
|
+
* @returns true if the AccountAddresses are equal, false if not.
|
|
2873
2810
|
*/
|
|
2874
|
-
|
|
2875
|
-
abstract serialize(serializer: Serializer): void;
|
|
2811
|
+
equals(other: AccountAddress): boolean;
|
|
2876
2812
|
}
|
|
2877
2813
|
|
|
2878
2814
|
/**
|
|
@@ -2905,7 +2841,12 @@ declare class AuthenticationKey extends Serializable {
|
|
|
2905
2841
|
static deserialize(deserializer: Deserializer): AuthenticationKey;
|
|
2906
2842
|
toString(): string;
|
|
2907
2843
|
toUint8Array(): Uint8Array;
|
|
2844
|
+
static fromSchemeAndBytes(args: {
|
|
2845
|
+
scheme: AuthenticationKeyScheme;
|
|
2846
|
+
input: HexInput;
|
|
2847
|
+
}): AuthenticationKey;
|
|
2908
2848
|
/**
|
|
2849
|
+
* @deprecated Use `fromPublicKey` instead
|
|
2909
2850
|
* Derives an AuthenticationKey from the public key seed bytes and an explicit derivation scheme.
|
|
2910
2851
|
*
|
|
2911
2852
|
* This facilitates targeting a specific scheme for deriving an authentication key from a public key.
|
|
@@ -2913,7 +2854,7 @@ declare class AuthenticationKey extends Serializable {
|
|
|
2913
2854
|
* @param args - the public key and scheme to use for the derivation
|
|
2914
2855
|
*/
|
|
2915
2856
|
static fromPublicKeyAndScheme(args: {
|
|
2916
|
-
publicKey:
|
|
2857
|
+
publicKey: AccountPublicKey;
|
|
2917
2858
|
scheme: AuthenticationKeyScheme;
|
|
2918
2859
|
}): AuthenticationKey;
|
|
2919
2860
|
/**
|
|
@@ -2924,7 +2865,7 @@ declare class AuthenticationKey extends Serializable {
|
|
|
2924
2865
|
* @returns AuthenticationKey
|
|
2925
2866
|
*/
|
|
2926
2867
|
static fromPublicKey(args: {
|
|
2927
|
-
publicKey:
|
|
2868
|
+
publicKey: AccountPublicKey;
|
|
2928
2869
|
}): AuthenticationKey;
|
|
2929
2870
|
/**
|
|
2930
2871
|
* Derives an account address from an AuthenticationKey. Since an AccountAddress is also 32 bytes,
|
|
@@ -2936,172 +2877,81 @@ declare class AuthenticationKey extends Serializable {
|
|
|
2936
2877
|
}
|
|
2937
2878
|
|
|
2938
2879
|
/**
|
|
2939
|
-
*
|
|
2940
|
-
*
|
|
2941
|
-
* Use this class to create accounts, sign transactions, and more.
|
|
2942
|
-
* Note: Creating an account instance does not create the account on-chain.
|
|
2943
|
-
*
|
|
2944
|
-
* Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports
|
|
2945
|
-
* `Legacy` and `Unified` authentications.
|
|
2946
|
-
*
|
|
2947
|
-
* @Legacy includes `ED25519` and `MultiED25519`
|
|
2948
|
-
* @Unified includes `SingleSender` and `MultiSender`, where currently
|
|
2949
|
-
* `SingleSender` supports `ED25519` and `Secp256k1`, and `MultiSender` supports
|
|
2950
|
-
* `MultiED25519`.
|
|
2951
|
-
*
|
|
2952
|
-
* In TypeScript SDK, we support all of these options:
|
|
2953
|
-
*
|
|
2954
|
-
* @generate default to generate Legacy Ed25519 keys, with an optional `legacy` boolean argument
|
|
2955
|
-
* that lets you generate new keys conforming to the Unified authentication.
|
|
2956
|
-
*
|
|
2957
|
-
* @fromPrivateKey derives an account by a provided private key and address, with an optional
|
|
2958
|
-
* `legacy` boolean argument that lets you generate new keys conforming to the Unified authentication.
|
|
2959
|
-
*
|
|
2960
|
-
* @fromDerivationPath derives an account with bip44 path and mnemonics,
|
|
2880
|
+
* An abstract representation of a crypto signature,
|
|
2881
|
+
* associated to a specific signature scheme e.g. Ed25519 or Secp256k1
|
|
2961
2882
|
*
|
|
2883
|
+
* This is the product of signing a message directly from a PrivateKey
|
|
2884
|
+
* and can be verified against a CryptoPublicKey.
|
|
2962
2885
|
*/
|
|
2963
|
-
declare class
|
|
2964
|
-
/**
|
|
2965
|
-
* Public key associated with the account
|
|
2966
|
-
*/
|
|
2967
|
-
readonly publicKey: PublicKey;
|
|
2968
|
-
/**
|
|
2969
|
-
* Private key associated with the account
|
|
2970
|
-
*/
|
|
2971
|
-
readonly privateKey: PrivateKey;
|
|
2972
|
-
/**
|
|
2973
|
-
* Account address associated with the account
|
|
2974
|
-
*/
|
|
2975
|
-
readonly accountAddress: AccountAddress;
|
|
2976
|
-
/**
|
|
2977
|
-
* Signing scheme used to sign transactions
|
|
2978
|
-
*/
|
|
2979
|
-
readonly signingScheme: SigningScheme;
|
|
2886
|
+
declare abstract class Signature extends Serializable {
|
|
2980
2887
|
/**
|
|
2981
|
-
*
|
|
2982
|
-
*
|
|
2983
|
-
* Need to update this to use the new crypto library if new schemes are added.
|
|
2984
|
-
*
|
|
2985
|
-
* @param args.privateKey PrivateKey - private key of the account
|
|
2986
|
-
* @param args.address AccountAddress - address of the account
|
|
2987
|
-
* @param args.legacy optional. If set to false, the keypair authentication keys will be derived with a unified scheme.
|
|
2988
|
-
* Defaults to deriving an authentication key with the legacy scheme.
|
|
2989
|
-
*
|
|
2990
|
-
* This method is private because it should only be called by the factory static methods.
|
|
2991
|
-
* @returns Account
|
|
2888
|
+
* Get the raw signature bytes
|
|
2992
2889
|
*/
|
|
2993
|
-
|
|
2890
|
+
abstract toUint8Array(): Uint8Array;
|
|
2994
2891
|
/**
|
|
2995
|
-
*
|
|
2996
|
-
*
|
|
2997
|
-
* Default generation is using the Legacy ED25519 key
|
|
2998
|
-
*
|
|
2999
|
-
* @param args optional. Unify GenerateAccount type for Legacy and Unified keys
|
|
3000
|
-
*
|
|
3001
|
-
* Account input type to generate an account using Legacy
|
|
3002
|
-
* Ed25519 or MultiEd25519 keys or without a specified `scheme`.
|
|
3003
|
-
* ```
|
|
3004
|
-
* GenerateAccountWithLegacyKey = {
|
|
3005
|
-
* scheme?: SigningSchemeInput.Ed25519 | SigningSchemeInput.MultiEd25519;
|
|
3006
|
-
* legacy: true;
|
|
3007
|
-
* };
|
|
3008
|
-
* ```
|
|
3009
|
-
*
|
|
3010
|
-
* Account input type to generate an account using Unified
|
|
3011
|
-
* Secp256k1Ecdsa key
|
|
3012
|
-
* In this case `legacy` is always false
|
|
3013
|
-
* ```
|
|
3014
|
-
* GenerateAccountWithUnifiedKey = {
|
|
3015
|
-
* scheme: SigningSchemeInput.Secp256k1Ecdsa;
|
|
3016
|
-
* legacy?: false;
|
|
3017
|
-
* };
|
|
3018
|
-
* ```
|
|
3019
|
-
*
|
|
3020
|
-
* @returns Account with the given signing scheme
|
|
2892
|
+
* Get the signature as a hex string with a 0x prefix e.g. 0x123456...
|
|
3021
2893
|
*/
|
|
3022
|
-
|
|
2894
|
+
toString(): string;
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2897
|
+
/**
|
|
2898
|
+
* Arguments for verifying a signature
|
|
2899
|
+
*/
|
|
2900
|
+
interface VerifySignatureArgs {
|
|
2901
|
+
message: HexInput;
|
|
2902
|
+
signature: Signature;
|
|
2903
|
+
}
|
|
2904
|
+
/**
|
|
2905
|
+
* An abstract representation of a public key.
|
|
2906
|
+
*
|
|
2907
|
+
* Provides a common interface for verifying any signature.
|
|
2908
|
+
*/
|
|
2909
|
+
declare abstract class PublicKey extends Serializable {
|
|
3023
2910
|
/**
|
|
3024
|
-
*
|
|
3025
|
-
*
|
|
3026
|
-
*
|
|
3027
|
-
* that has not had its authentication key rotated.
|
|
3028
|
-
*
|
|
3029
|
-
* @param privateKey PrivateKey - private key of the account
|
|
3030
|
-
* @param args.legacy optional. If set to false, the keypair generated is a Unified keypair. Defaults
|
|
3031
|
-
* to generating a Legacy Ed25519 keypair
|
|
3032
|
-
*
|
|
3033
|
-
* @returns Account
|
|
2911
|
+
* Verifies that the private key associated with this public key signed the message with the given signature.
|
|
2912
|
+
* @param args.message The message that was signed
|
|
2913
|
+
* @param args.signature The signature to verify
|
|
3034
2914
|
*/
|
|
3035
|
-
|
|
3036
|
-
privateKey: PrivateKey;
|
|
3037
|
-
legacy?: boolean;
|
|
3038
|
-
}): Account$1;
|
|
2915
|
+
abstract verifySignature(args: VerifySignatureArgs): boolean;
|
|
3039
2916
|
/**
|
|
3040
|
-
*
|
|
3041
|
-
* This is primarily used to instantiate an `Account` that has had its authentication key rotated.
|
|
3042
|
-
*
|
|
3043
|
-
* @param args.privateKey PrivateKey - the underlying private key for the account
|
|
3044
|
-
* @param args.address AccountAddress - The account address the `Account` will sign for
|
|
3045
|
-
* @param args.legacy optional. If set to false, the keypair generated is a Unified keypair. Defaults
|
|
3046
|
-
* to generating a Legacy Ed25519 keypair
|
|
3047
|
-
*
|
|
3048
|
-
* @returns Account
|
|
2917
|
+
* Get the raw public key bytes
|
|
3049
2918
|
*/
|
|
3050
|
-
|
|
3051
|
-
privateKey: PrivateKey;
|
|
3052
|
-
address: AccountAddress;
|
|
3053
|
-
legacy?: boolean;
|
|
3054
|
-
}): Account$1;
|
|
2919
|
+
abstract toUint8Array(): Uint8Array;
|
|
3055
2920
|
/**
|
|
3056
|
-
*
|
|
3057
|
-
*
|
|
3058
|
-
* @param args.scheme The signing scheme to derive with
|
|
3059
|
-
* @param args.path the BIP44 derive hardened path (e.g. m/44'/637'/0'/0'/0') for Ed25519,
|
|
3060
|
-
* or non-hardened path (e.g. m/44'/637'/0'/0/0) for secp256k1
|
|
3061
|
-
* Detailed description: {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}
|
|
3062
|
-
* @param args.mnemonic the mnemonic seed phrase of the account
|
|
3063
|
-
* @param args.legacy optional. If set to false, the keypair generated is a Unified keypair. Defaults
|
|
3064
|
-
* to generating a Legacy Ed25519 keypair
|
|
3065
|
-
*
|
|
3066
|
-
* @returns Account
|
|
2921
|
+
* Get the public key as a hex string with a 0x prefix e.g. 0x123456...
|
|
3067
2922
|
*/
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
2923
|
+
toString(): string;
|
|
2924
|
+
}
|
|
2925
|
+
/**
|
|
2926
|
+
* An abstract representation of an account public key.
|
|
2927
|
+
*
|
|
2928
|
+
* Provides a common interface for deriving an authentication key.
|
|
2929
|
+
*/
|
|
2930
|
+
declare abstract class AccountPublicKey extends PublicKey {
|
|
3074
2931
|
/**
|
|
3075
|
-
*
|
|
3076
|
-
* associated with the account without changing the address that hosts their account.
|
|
3077
|
-
* See here for more info: {@link https://aptos.dev/concepts/accounts#single-signer-authentication}
|
|
3078
|
-
*
|
|
3079
|
-
* @param args.publicKey PublicKey - public key of the account
|
|
3080
|
-
* @returns The authentication key for the associated account
|
|
2932
|
+
* Get the authentication key associated with this public key
|
|
3081
2933
|
*/
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
2934
|
+
abstract authKey(): AuthenticationKey;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
/**
|
|
2938
|
+
* An abstract representation of a private key.
|
|
2939
|
+
* It is associated to a signature scheme and provides signing capabilities.
|
|
2940
|
+
*/
|
|
2941
|
+
interface PrivateKey {
|
|
3085
2942
|
/**
|
|
3086
2943
|
* Sign the given message with the private key.
|
|
3087
|
-
*
|
|
3088
|
-
* TODO: Add sign transaction or specific types
|
|
3089
|
-
*
|
|
3090
|
-
* @param data in HexInput format
|
|
3091
|
-
* @returns Signature
|
|
2944
|
+
* @param message in HexInput format
|
|
3092
2945
|
*/
|
|
3093
|
-
sign(
|
|
2946
|
+
sign(message: HexInput): Signature;
|
|
3094
2947
|
/**
|
|
3095
|
-
*
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
*
|
|
2948
|
+
* Derive the public key associated with the private key
|
|
2949
|
+
*/
|
|
2950
|
+
publicKey(): PublicKey;
|
|
2951
|
+
/**
|
|
2952
|
+
* Get the private key in bytes (Uint8Array).
|
|
3100
2953
|
*/
|
|
3101
|
-
|
|
3102
|
-
message: HexInput;
|
|
3103
|
-
signature: Signature;
|
|
3104
|
-
}): boolean;
|
|
2954
|
+
toUint8Array(): Uint8Array;
|
|
3105
2955
|
}
|
|
3106
2956
|
|
|
3107
2957
|
/**
|
|
@@ -3113,7 +2963,7 @@ declare class Account$1 {
|
|
|
3113
2963
|
* Ed25519 scheme is represented in the SDK as `Legacy authentication key` and also
|
|
3114
2964
|
* as `AnyPublicKey` that represents any `Unified authentication key`
|
|
3115
2965
|
*/
|
|
3116
|
-
declare class Ed25519PublicKey extends
|
|
2966
|
+
declare class Ed25519PublicKey extends AccountPublicKey {
|
|
3117
2967
|
/**
|
|
3118
2968
|
* Length of an Ed25519 public key
|
|
3119
2969
|
*/
|
|
@@ -3129,36 +2979,30 @@ declare class Ed25519PublicKey extends PublicKey {
|
|
|
3129
2979
|
* @param hexInput A HexInput (string or Uint8Array)
|
|
3130
2980
|
*/
|
|
3131
2981
|
constructor(hexInput: HexInput);
|
|
2982
|
+
/**
|
|
2983
|
+
* Verifies a signed data with a public key
|
|
2984
|
+
* @param args.message a signed message
|
|
2985
|
+
* @param args.signature the signature of the message
|
|
2986
|
+
*/
|
|
2987
|
+
verifySignature(args: VerifySignatureArgs): boolean;
|
|
2988
|
+
authKey(): AuthenticationKey;
|
|
3132
2989
|
/**
|
|
3133
2990
|
* Get the public key in bytes (Uint8Array).
|
|
3134
2991
|
*
|
|
3135
2992
|
* @returns Uint8Array representation of the public key
|
|
3136
2993
|
*/
|
|
3137
2994
|
toUint8Array(): Uint8Array;
|
|
3138
|
-
/**
|
|
3139
|
-
* Get the public key as a hex string with the 0x prefix.
|
|
3140
|
-
*
|
|
3141
|
-
* @returns string representation of the public key
|
|
3142
|
-
*/
|
|
3143
|
-
toString(): string;
|
|
3144
|
-
/**
|
|
3145
|
-
* Verifies a signed data with a public key
|
|
3146
|
-
* @param args.message a signed message
|
|
3147
|
-
* @param args.signature the signature of the message
|
|
3148
|
-
*/
|
|
3149
|
-
verifySignature(args: {
|
|
3150
|
-
message: HexInput;
|
|
3151
|
-
signature: Ed25519Signature;
|
|
3152
|
-
}): boolean;
|
|
3153
2995
|
serialize(serializer: Serializer): void;
|
|
3154
2996
|
static deserialize(deserializer: Deserializer): Ed25519PublicKey;
|
|
3155
|
-
|
|
3156
|
-
|
|
2997
|
+
/**
|
|
2998
|
+
* @deprecated use `instanceof Ed25519PublicKey` instead.
|
|
2999
|
+
*/
|
|
3000
|
+
static isPublicKey(publicKey: AccountPublicKey): publicKey is Ed25519PublicKey;
|
|
3157
3001
|
}
|
|
3158
3002
|
/**
|
|
3159
3003
|
* Represents the private key of an Ed25519 key pair.
|
|
3160
3004
|
*/
|
|
3161
|
-
declare class Ed25519PrivateKey extends PrivateKey {
|
|
3005
|
+
declare class Ed25519PrivateKey extends Serializable implements PrivateKey {
|
|
3162
3006
|
/**
|
|
3163
3007
|
* Length of an Ed25519 private key
|
|
3164
3008
|
*/
|
|
@@ -3179,39 +3023,12 @@ declare class Ed25519PrivateKey extends PrivateKey {
|
|
|
3179
3023
|
* @param hexInput HexInput (string or Uint8Array)
|
|
3180
3024
|
*/
|
|
3181
3025
|
constructor(hexInput: HexInput);
|
|
3182
|
-
/**
|
|
3183
|
-
* Get the private key in bytes (Uint8Array).
|
|
3184
|
-
*
|
|
3185
|
-
* @returns Uint8Array representation of the private key
|
|
3186
|
-
*/
|
|
3187
|
-
toUint8Array(): Uint8Array;
|
|
3188
|
-
/**
|
|
3189
|
-
* Get the private key as a hex string with the 0x prefix.
|
|
3190
|
-
*
|
|
3191
|
-
* @returns string representation of the private key
|
|
3192
|
-
*/
|
|
3193
|
-
toString(): string;
|
|
3194
|
-
/**
|
|
3195
|
-
* Sign the given message with the private key.
|
|
3196
|
-
*
|
|
3197
|
-
* @param message in HexInput format
|
|
3198
|
-
* @returns Signature
|
|
3199
|
-
*/
|
|
3200
|
-
sign(message: HexInput): Ed25519Signature;
|
|
3201
|
-
serialize(serializer: Serializer): void;
|
|
3202
|
-
static deserialize(deserializer: Deserializer): Ed25519PrivateKey;
|
|
3203
3026
|
/**
|
|
3204
3027
|
* Generate a new random private key.
|
|
3205
3028
|
*
|
|
3206
3029
|
* @returns Ed25519PrivateKey
|
|
3207
3030
|
*/
|
|
3208
3031
|
static generate(): Ed25519PrivateKey;
|
|
3209
|
-
/**
|
|
3210
|
-
* Derive the Ed25519PublicKey for this private key.
|
|
3211
|
-
*
|
|
3212
|
-
* @returns Ed25519PublicKey
|
|
3213
|
-
*/
|
|
3214
|
-
publicKey(): Ed25519PublicKey;
|
|
3215
3032
|
/**
|
|
3216
3033
|
* Derives a private key from a mnemonic seed phrase.
|
|
3217
3034
|
*
|
|
@@ -3234,6 +3051,36 @@ declare class Ed25519PrivateKey extends PrivateKey {
|
|
|
3234
3051
|
* @returns
|
|
3235
3052
|
*/
|
|
3236
3053
|
private static fromDerivationPathInner;
|
|
3054
|
+
/**
|
|
3055
|
+
* Derive the Ed25519PublicKey for this private key.
|
|
3056
|
+
*
|
|
3057
|
+
* @returns Ed25519PublicKey
|
|
3058
|
+
*/
|
|
3059
|
+
publicKey(): Ed25519PublicKey;
|
|
3060
|
+
/**
|
|
3061
|
+
* Sign the given message with the private key.
|
|
3062
|
+
*
|
|
3063
|
+
* @param message in HexInput format
|
|
3064
|
+
* @returns Signature
|
|
3065
|
+
*/
|
|
3066
|
+
sign(message: HexInput): Ed25519Signature;
|
|
3067
|
+
/**
|
|
3068
|
+
* Get the private key in bytes (Uint8Array).
|
|
3069
|
+
*
|
|
3070
|
+
* @returns Uint8Array representation of the private key
|
|
3071
|
+
*/
|
|
3072
|
+
toUint8Array(): Uint8Array;
|
|
3073
|
+
/**
|
|
3074
|
+
* Get the private key as a hex string with the 0x prefix.
|
|
3075
|
+
*
|
|
3076
|
+
* @returns string representation of the private key
|
|
3077
|
+
*/
|
|
3078
|
+
toString(): string;
|
|
3079
|
+
serialize(serializer: Serializer): void;
|
|
3080
|
+
static deserialize(deserializer: Deserializer): Ed25519PrivateKey;
|
|
3081
|
+
/**
|
|
3082
|
+
* @deprecated use `instanceof Ed25519PrivateKey` instead.
|
|
3083
|
+
*/
|
|
3237
3084
|
static isPrivateKey(privateKey: PrivateKey): privateKey is Ed25519PrivateKey;
|
|
3238
3085
|
}
|
|
3239
3086
|
/**
|
|
@@ -3250,28 +3097,79 @@ declare class Ed25519Signature extends Signature {
|
|
|
3250
3097
|
*/
|
|
3251
3098
|
private readonly data;
|
|
3252
3099
|
constructor(hexInput: HexInput);
|
|
3253
|
-
/**
|
|
3254
|
-
* Get the signature in bytes (Uint8Array).
|
|
3255
|
-
*
|
|
3256
|
-
* @returns Uint8Array representation of the signature
|
|
3257
|
-
*/
|
|
3258
3100
|
toUint8Array(): Uint8Array;
|
|
3259
|
-
/**
|
|
3260
|
-
* Get the signature as a hex string with the 0x prefix.
|
|
3261
|
-
*
|
|
3262
|
-
* @returns string representation of the signature
|
|
3263
|
-
*/
|
|
3264
|
-
toString(): string;
|
|
3265
3101
|
serialize(serializer: Serializer): void;
|
|
3266
3102
|
static deserialize(deserializer: Deserializer): Ed25519Signature;
|
|
3267
|
-
static load(deserializer: Deserializer): Ed25519Signature;
|
|
3268
|
-
static isSignature(signature: Signature): signature is Ed25519Signature;
|
|
3269
3103
|
}
|
|
3270
3104
|
|
|
3105
|
+
type DerivedKeys = {
|
|
3106
|
+
key: Uint8Array;
|
|
3107
|
+
chainCode: Uint8Array;
|
|
3108
|
+
};
|
|
3109
|
+
/**
|
|
3110
|
+
* Aptos derive path is 637
|
|
3111
|
+
*/
|
|
3112
|
+
declare const APTOS_HARDENED_REGEX: RegExp;
|
|
3113
|
+
declare const APTOS_BIP44_REGEX: RegExp;
|
|
3114
|
+
/**
|
|
3115
|
+
* A list of supported key types and associated seeds
|
|
3116
|
+
*/
|
|
3117
|
+
declare enum KeyType {
|
|
3118
|
+
ED25519 = "ed25519 seed"
|
|
3119
|
+
}
|
|
3120
|
+
declare const HARDENED_OFFSET = 2147483648;
|
|
3121
|
+
/**
|
|
3122
|
+
* Aptos derive path is 637
|
|
3123
|
+
*
|
|
3124
|
+
* Parse and validate a path that is compliant to BIP-44 in form m/44'/637'/{account_index}'/{change_index}/{address_index}
|
|
3125
|
+
* for Secp256k1
|
|
3126
|
+
*
|
|
3127
|
+
* Note that for secp256k1, last two components must be non-hardened.
|
|
3128
|
+
*
|
|
3129
|
+
* @param path path string (e.g. `m/44'/637'/0'/0/0`).
|
|
3130
|
+
*/
|
|
3131
|
+
declare function isValidBIP44Path(path: string): boolean;
|
|
3132
|
+
/**
|
|
3133
|
+
* Aptos derive path is 637
|
|
3134
|
+
*
|
|
3135
|
+
* Parse and validate a path that is compliant to SLIP-0010 and BIP-44
|
|
3136
|
+
* in form m/44'/637'/{account_index}'/{change_index}'/{address_index}'.
|
|
3137
|
+
* See SLIP-0010 {@link https://github.com/satoshilabs/slips/blob/master/slip-0044.md}
|
|
3138
|
+
* See BIP-44 {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}
|
|
3139
|
+
*
|
|
3140
|
+
* Note that for Ed25519, all components must be hardened.
|
|
3141
|
+
* This is because non-hardened [PK] derivation would not work due to Ed25519's lack of a key homomorphism.
|
|
3142
|
+
* Specifically, you cannot derive the PK associated with derivation path a/b/c given the PK of a/b.
|
|
3143
|
+
* This is because the PK in Ed25519 is, more or less, computed as 𝑔𝐻(𝑠𝑘),
|
|
3144
|
+
* with the hash function breaking the homomorphism.
|
|
3145
|
+
*
|
|
3146
|
+
* @param path path string (e.g. `m/44'/637'/0'/0'/0'`).
|
|
3147
|
+
*/
|
|
3148
|
+
declare function isValidHardenedPath(path: string): boolean;
|
|
3149
|
+
declare const deriveKey: (hashSeed: Uint8Array | string, data: Uint8Array | string) => DerivedKeys;
|
|
3150
|
+
/**
|
|
3151
|
+
* Derive a child key from the private key
|
|
3152
|
+
* @param key
|
|
3153
|
+
* @param chainCode
|
|
3154
|
+
* @param index
|
|
3155
|
+
* @constructor
|
|
3156
|
+
*/
|
|
3157
|
+
declare const CKDPriv: ({ key, chainCode }: DerivedKeys, index: number) => DerivedKeys;
|
|
3158
|
+
/**
|
|
3159
|
+
* Splits derive path into segments
|
|
3160
|
+
* @param path
|
|
3161
|
+
*/
|
|
3162
|
+
declare const splitPath: (path: string) => Array<string>;
|
|
3163
|
+
/**
|
|
3164
|
+
* Normalizes the mnemonic by removing extra whitespace and making it lowercase
|
|
3165
|
+
* @param mnemonic the mnemonic seed phrase
|
|
3166
|
+
*/
|
|
3167
|
+
declare const mnemonicToSeed: (mnemonic: string) => Uint8Array;
|
|
3168
|
+
|
|
3271
3169
|
/**
|
|
3272
3170
|
* Represents the public key of a K-of-N Ed25519 multi-sig transaction.
|
|
3273
3171
|
*/
|
|
3274
|
-
declare class MultiEd25519PublicKey extends
|
|
3172
|
+
declare class MultiEd25519PublicKey extends AccountPublicKey {
|
|
3275
3173
|
/**
|
|
3276
3174
|
* Maximum number of public keys supported
|
|
3277
3175
|
*/
|
|
@@ -3285,7 +3183,7 @@ declare class MultiEd25519PublicKey extends PublicKey {
|
|
|
3285
3183
|
*/
|
|
3286
3184
|
static readonly MIN_THRESHOLD = 1;
|
|
3287
3185
|
/**
|
|
3288
|
-
* List of Ed25519 public keys for this
|
|
3186
|
+
* List of Ed25519 public keys for this LegacyMultiEd25519PublicKey
|
|
3289
3187
|
*/
|
|
3290
3188
|
readonly publicKeys: Ed25519PublicKey[];
|
|
3291
3189
|
/**
|
|
@@ -3307,34 +3205,181 @@ declare class MultiEd25519PublicKey extends PublicKey {
|
|
|
3307
3205
|
publicKeys: Ed25519PublicKey[];
|
|
3308
3206
|
threshold: number;
|
|
3309
3207
|
});
|
|
3208
|
+
verifySignature(args: VerifySignatureArgs): boolean;
|
|
3209
|
+
authKey(): AuthenticationKey;
|
|
3210
|
+
/**
|
|
3211
|
+
* Converts a PublicKeys into Uint8Array (bytes) with: bytes = p1_bytes | ... | pn_bytes | threshold
|
|
3212
|
+
*/
|
|
3213
|
+
toUint8Array(): Uint8Array;
|
|
3214
|
+
serialize(serializer: Serializer): void;
|
|
3215
|
+
static deserialize(deserializer: Deserializer): MultiEd25519PublicKey;
|
|
3216
|
+
}
|
|
3217
|
+
/**
|
|
3218
|
+
* Represents the signature of a K-of-N Ed25519 multi-sig transaction.
|
|
3219
|
+
*/
|
|
3220
|
+
declare class MultiEd25519Signature extends Signature {
|
|
3221
|
+
/**
|
|
3222
|
+
* Maximum number of Ed25519 signatures supported
|
|
3223
|
+
*/
|
|
3224
|
+
static MAX_SIGNATURES_SUPPORTED: number;
|
|
3225
|
+
/**
|
|
3226
|
+
* Number of bytes in the bitmap representing who signed the transaction (32-bits)
|
|
3227
|
+
*/
|
|
3228
|
+
static BITMAP_LEN: number;
|
|
3229
|
+
/**
|
|
3230
|
+
* The list of underlying Ed25519 signatures
|
|
3231
|
+
*/
|
|
3232
|
+
readonly signatures: Ed25519Signature[];
|
|
3233
|
+
/**
|
|
3234
|
+
* 32-bit Bitmap representing who signed the transaction
|
|
3235
|
+
*
|
|
3236
|
+
* This is represented where each public key can be masked to determine whether the message was signed by that key.
|
|
3237
|
+
*/
|
|
3238
|
+
readonly bitmap: Uint8Array;
|
|
3239
|
+
/**
|
|
3240
|
+
* Signature for a K-of-N multi-sig transaction.
|
|
3241
|
+
*
|
|
3242
|
+
* @see {@link
|
|
3243
|
+
* https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}
|
|
3244
|
+
*
|
|
3245
|
+
* @param args.signatures A list of signatures
|
|
3246
|
+
* @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth
|
|
3247
|
+
* signature should be provided in `signatures`. Bits are read from left to right.
|
|
3248
|
+
* Alternatively, you can specify an array of bitmap positions.
|
|
3249
|
+
* Valid position should range between 0 and 31.
|
|
3250
|
+
* @see MultiEd25519Signature.createBitmap
|
|
3251
|
+
*/
|
|
3252
|
+
constructor(args: {
|
|
3253
|
+
signatures: Ed25519Signature[];
|
|
3254
|
+
bitmap: Uint8Array | number[];
|
|
3255
|
+
});
|
|
3256
|
+
/**
|
|
3257
|
+
* Converts a MultiSignature into Uint8Array (bytes) with `bytes = s1_bytes | ... | sn_bytes | bitmap`
|
|
3258
|
+
*/
|
|
3259
|
+
toUint8Array(): Uint8Array;
|
|
3260
|
+
serialize(serializer: Serializer): void;
|
|
3261
|
+
static deserialize(deserializer: Deserializer): MultiEd25519Signature;
|
|
3262
|
+
/**
|
|
3263
|
+
* Helper method to create a bitmap out of the specified bit positions
|
|
3264
|
+
* @param args.bits The bitmap positions that should be set. A position starts at index 0.
|
|
3265
|
+
* Valid position should range between 0 and 31.
|
|
3266
|
+
* @example
|
|
3267
|
+
* Here's an example of valid `bits`
|
|
3268
|
+
* ```
|
|
3269
|
+
* [0, 2, 31]
|
|
3270
|
+
* ```
|
|
3271
|
+
* `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.
|
|
3272
|
+
* The result bitmap should be 0b1010000000000000000000000000001
|
|
3273
|
+
*
|
|
3274
|
+
* @returns bitmap that is 32bit long
|
|
3275
|
+
*/
|
|
3276
|
+
static createBitmap(args: {
|
|
3277
|
+
bits: number[];
|
|
3278
|
+
}): Uint8Array;
|
|
3279
|
+
}
|
|
3280
|
+
|
|
3281
|
+
/**
|
|
3282
|
+
* Represents any public key supported by Aptos.
|
|
3283
|
+
*
|
|
3284
|
+
* Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports
|
|
3285
|
+
* `Legacy` and `Unified` authentication keys.
|
|
3286
|
+
*
|
|
3287
|
+
* Any unified authentication key is represented in the SDK as `AnyPublicKey`.
|
|
3288
|
+
*/
|
|
3289
|
+
declare class AnyPublicKey extends AccountPublicKey {
|
|
3290
|
+
/**
|
|
3291
|
+
* Reference to the inner public key
|
|
3292
|
+
*/
|
|
3293
|
+
readonly publicKey: PublicKey;
|
|
3294
|
+
/**
|
|
3295
|
+
* Index of the underlying enum variant
|
|
3296
|
+
*/
|
|
3297
|
+
readonly variant: AnyPublicKeyVariant;
|
|
3298
|
+
constructor(publicKey: PublicKey);
|
|
3299
|
+
verifySignature(args: VerifySignatureArgs): boolean;
|
|
3300
|
+
authKey(): AuthenticationKey;
|
|
3301
|
+
toUint8Array(): Uint8Array;
|
|
3302
|
+
serialize(serializer: Serializer): void;
|
|
3303
|
+
static deserialize(deserializer: Deserializer): AnyPublicKey;
|
|
3304
|
+
/**
|
|
3305
|
+
* @deprecated use `instanceof AnyPublicKey` instead.
|
|
3306
|
+
*/
|
|
3307
|
+
static isPublicKey(publicKey: AccountPublicKey): publicKey is AnyPublicKey;
|
|
3308
|
+
/**
|
|
3309
|
+
* @deprecated use `publicKey instanceof Ed25519PublicKey` instead.
|
|
3310
|
+
*/
|
|
3311
|
+
isEd25519(): boolean;
|
|
3312
|
+
/**
|
|
3313
|
+
* @deprecated use `publicKey instanceof Secp256k1PublicKey` instead.
|
|
3314
|
+
*/
|
|
3315
|
+
isSecp256k1PublicKey(): boolean;
|
|
3316
|
+
}
|
|
3317
|
+
/**
|
|
3318
|
+
* Instance of signature that uses the SingleKey authentication scheme.
|
|
3319
|
+
* This signature can only be generated by a `SingleKeySigner`, since it uses the
|
|
3320
|
+
* same authentication scheme.
|
|
3321
|
+
*/
|
|
3322
|
+
declare class AnySignature extends Signature {
|
|
3323
|
+
readonly signature: Signature;
|
|
3310
3324
|
/**
|
|
3311
|
-
*
|
|
3325
|
+
* Index of the underlying enum variant
|
|
3312
3326
|
*/
|
|
3327
|
+
private readonly variant;
|
|
3328
|
+
constructor(signature: Signature);
|
|
3313
3329
|
toUint8Array(): Uint8Array;
|
|
3314
|
-
toString(): string;
|
|
3315
|
-
verifySignature(args: {
|
|
3316
|
-
message: HexInput;
|
|
3317
|
-
signature: MultiEd25519Signature;
|
|
3318
|
-
}): boolean;
|
|
3319
3330
|
serialize(serializer: Serializer): void;
|
|
3320
|
-
static deserialize(deserializer: Deserializer):
|
|
3331
|
+
static deserialize(deserializer: Deserializer): AnySignature;
|
|
3321
3332
|
}
|
|
3333
|
+
|
|
3322
3334
|
/**
|
|
3323
|
-
* Represents the
|
|
3335
|
+
* Represents the public key of a multi-agent account.
|
|
3336
|
+
*
|
|
3337
|
+
* The public keys of each individual agent can be any type of public key supported by Aptos.
|
|
3338
|
+
* Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports
|
|
3339
|
+
* `Legacy` and `Unified` authentication keys.
|
|
3324
3340
|
*/
|
|
3325
|
-
declare class
|
|
3341
|
+
declare class MultiKey extends AccountPublicKey {
|
|
3326
3342
|
/**
|
|
3327
|
-
*
|
|
3343
|
+
* List of any public keys
|
|
3328
3344
|
*/
|
|
3329
|
-
|
|
3345
|
+
readonly publicKeys: AnyPublicKey[];
|
|
3346
|
+
/**
|
|
3347
|
+
* The minimum number of valid signatures required, for the number of public keys specified
|
|
3348
|
+
*/
|
|
3349
|
+
readonly signaturesRequired: number;
|
|
3350
|
+
constructor(args: {
|
|
3351
|
+
publicKeys: Array<PublicKey>;
|
|
3352
|
+
signaturesRequired: number;
|
|
3353
|
+
});
|
|
3354
|
+
verifySignature(args: VerifySignatureArgs): boolean;
|
|
3355
|
+
authKey(): AuthenticationKey;
|
|
3356
|
+
toUint8Array(): Uint8Array;
|
|
3357
|
+
serialize(serializer: Serializer): void;
|
|
3358
|
+
static deserialize(deserializer: Deserializer): MultiKey;
|
|
3359
|
+
/**
|
|
3360
|
+
* Create a bitmap that holds the mapping from the original public keys
|
|
3361
|
+
* to the signatures passed in
|
|
3362
|
+
*
|
|
3363
|
+
* @param args.bits array of the index mapping to the matching public keys
|
|
3364
|
+
* @returns Uint8array bit map
|
|
3365
|
+
*/
|
|
3366
|
+
createBitmap(args: {
|
|
3367
|
+
bits: number[];
|
|
3368
|
+
}): Uint8Array;
|
|
3369
|
+
}
|
|
3370
|
+
declare class MultiKeySignature extends Signature {
|
|
3330
3371
|
/**
|
|
3331
3372
|
* Number of bytes in the bitmap representing who signed the transaction (32-bits)
|
|
3332
3373
|
*/
|
|
3333
3374
|
static BITMAP_LEN: number;
|
|
3375
|
+
/**
|
|
3376
|
+
* Maximum number of Ed25519 signatures supported
|
|
3377
|
+
*/
|
|
3378
|
+
static MAX_SIGNATURES_SUPPORTED: number;
|
|
3334
3379
|
/**
|
|
3335
3380
|
* The list of underlying Ed25519 signatures
|
|
3336
3381
|
*/
|
|
3337
|
-
readonly signatures:
|
|
3382
|
+
readonly signatures: AnySignature[];
|
|
3338
3383
|
/**
|
|
3339
3384
|
* 32-bit Bitmap representing who signed the transaction
|
|
3340
3385
|
*
|
|
@@ -3352,14 +3397,9 @@ declare class MultiEd25519Signature extends Signature {
|
|
|
3352
3397
|
* signature should be provided in `signatures`. Bits are read from left to right
|
|
3353
3398
|
*/
|
|
3354
3399
|
constructor(args: {
|
|
3355
|
-
signatures:
|
|
3356
|
-
bitmap: Uint8Array;
|
|
3400
|
+
signatures: Array<Signature | AnySignature>;
|
|
3401
|
+
bitmap: Uint8Array | number[];
|
|
3357
3402
|
});
|
|
3358
|
-
/**
|
|
3359
|
-
* Converts a MultiSignature into Uint8Array (bytes) with `bytes = s1_bytes | ... | sn_bytes | bitmap`
|
|
3360
|
-
*/
|
|
3361
|
-
toUint8Array(): Uint8Array;
|
|
3362
|
-
toString(): string;
|
|
3363
3403
|
/**
|
|
3364
3404
|
* Helper method to create a bitmap out of the specified bit positions
|
|
3365
3405
|
* @param args.bits The bitmap positions that should be set. A position starts at index 0.
|
|
@@ -3377,8 +3417,9 @@ declare class MultiEd25519Signature extends Signature {
|
|
|
3377
3417
|
static createBitmap(args: {
|
|
3378
3418
|
bits: number[];
|
|
3379
3419
|
}): Uint8Array;
|
|
3420
|
+
toUint8Array(): Uint8Array;
|
|
3380
3421
|
serialize(serializer: Serializer): void;
|
|
3381
|
-
static deserialize(deserializer: Deserializer):
|
|
3422
|
+
static deserialize(deserializer: Deserializer): MultiKeySignature;
|
|
3382
3423
|
}
|
|
3383
3424
|
|
|
3384
3425
|
/**
|
|
@@ -3395,38 +3436,20 @@ declare class Secp256k1PublicKey extends PublicKey {
|
|
|
3395
3436
|
* @param hexInput A HexInput (string or Uint8Array)
|
|
3396
3437
|
*/
|
|
3397
3438
|
constructor(hexInput: HexInput);
|
|
3398
|
-
|
|
3399
|
-
* Get the public key in bytes (Uint8Array).
|
|
3400
|
-
*
|
|
3401
|
-
* @returns Uint8Array representation of the public key
|
|
3402
|
-
*/
|
|
3439
|
+
verifySignature(args: VerifySignatureArgs): boolean;
|
|
3403
3440
|
toUint8Array(): Uint8Array;
|
|
3404
|
-
/**
|
|
3405
|
-
* Get the public key as a hex string with the 0x prefix.
|
|
3406
|
-
*
|
|
3407
|
-
* @returns string representation of the public key
|
|
3408
|
-
*/
|
|
3409
|
-
toString(): string;
|
|
3410
|
-
/**
|
|
3411
|
-
* Verifies a signed data with a public key
|
|
3412
|
-
*
|
|
3413
|
-
* @param args.message message
|
|
3414
|
-
* @param args.signature The signature
|
|
3415
|
-
* @returns true if the signature is valid
|
|
3416
|
-
*/
|
|
3417
|
-
verifySignature(args: {
|
|
3418
|
-
message: HexInput;
|
|
3419
|
-
signature: Secp256k1Signature;
|
|
3420
|
-
}): boolean;
|
|
3421
3441
|
serialize(serializer: Serializer): void;
|
|
3422
3442
|
static deserialize(deserializer: Deserializer): Secp256k1PublicKey;
|
|
3423
|
-
|
|
3443
|
+
/**
|
|
3444
|
+
* @deprecated use `instanceof Secp256k1PublicKey` instead
|
|
3445
|
+
* @param publicKey
|
|
3446
|
+
*/
|
|
3424
3447
|
static isPublicKey(publicKey: PublicKey): publicKey is Secp256k1PublicKey;
|
|
3425
3448
|
}
|
|
3426
3449
|
/**
|
|
3427
3450
|
* A Secp256k1 ecdsa private key
|
|
3428
3451
|
*/
|
|
3429
|
-
declare class Secp256k1PrivateKey extends PrivateKey {
|
|
3452
|
+
declare class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
3430
3453
|
/**
|
|
3431
3454
|
* Length of Secp256k1 ecdsa private key
|
|
3432
3455
|
*/
|
|
@@ -3443,17 +3466,30 @@ declare class Secp256k1PrivateKey extends PrivateKey {
|
|
|
3443
3466
|
*/
|
|
3444
3467
|
constructor(hexInput: HexInput);
|
|
3445
3468
|
/**
|
|
3446
|
-
*
|
|
3469
|
+
* Generate a new random private key.
|
|
3447
3470
|
*
|
|
3448
|
-
* @returns
|
|
3471
|
+
* @returns Secp256k1PrivateKey
|
|
3449
3472
|
*/
|
|
3450
|
-
|
|
3473
|
+
static generate(): Secp256k1PrivateKey;
|
|
3451
3474
|
/**
|
|
3452
|
-
*
|
|
3475
|
+
* Derives a private key from a mnemonic seed phrase.
|
|
3453
3476
|
*
|
|
3454
|
-
* @
|
|
3477
|
+
* @param path the BIP44 path
|
|
3478
|
+
* @param mnemonics the mnemonic seed phrase
|
|
3479
|
+
*
|
|
3480
|
+
* @returns The generated key
|
|
3455
3481
|
*/
|
|
3456
|
-
|
|
3482
|
+
static fromDerivationPath(path: string, mnemonics: string): Secp256k1PrivateKey;
|
|
3483
|
+
/**
|
|
3484
|
+
* A private inner function so we can separate from the main fromDerivationPath() method
|
|
3485
|
+
* to add tests to verify we create the keys correctly.
|
|
3486
|
+
*
|
|
3487
|
+
* @param path the BIP44 path
|
|
3488
|
+
* @param seed the seed phrase created by the mnemonics
|
|
3489
|
+
*
|
|
3490
|
+
* @returns The generated key
|
|
3491
|
+
*/
|
|
3492
|
+
private static fromDerivationPathInner;
|
|
3457
3493
|
/**
|
|
3458
3494
|
* Sign the given message with the private key.
|
|
3459
3495
|
*
|
|
@@ -3461,14 +3497,6 @@ declare class Secp256k1PrivateKey extends PrivateKey {
|
|
|
3461
3497
|
* @returns Signature
|
|
3462
3498
|
*/
|
|
3463
3499
|
sign(message: HexInput): Secp256k1Signature;
|
|
3464
|
-
serialize(serializer: Serializer): void;
|
|
3465
|
-
static deserialize(deserializer: Deserializer): Secp256k1PrivateKey;
|
|
3466
|
-
/**
|
|
3467
|
-
* Generate a new random private key.
|
|
3468
|
-
*
|
|
3469
|
-
* @returns Secp256k1PrivateKey
|
|
3470
|
-
*/
|
|
3471
|
-
static generate(): Secp256k1PrivateKey;
|
|
3472
3500
|
/**
|
|
3473
3501
|
* Derive the Secp256k1PublicKey from this private key.
|
|
3474
3502
|
*
|
|
@@ -3476,227 +3504,397 @@ declare class Secp256k1PrivateKey extends PrivateKey {
|
|
|
3476
3504
|
*/
|
|
3477
3505
|
publicKey(): Secp256k1PublicKey;
|
|
3478
3506
|
/**
|
|
3479
|
-
*
|
|
3507
|
+
* Get the private key in bytes (Uint8Array).
|
|
3480
3508
|
*
|
|
3481
|
-
* @
|
|
3482
|
-
|
|
3509
|
+
* @returns
|
|
3510
|
+
*/
|
|
3511
|
+
toUint8Array(): Uint8Array;
|
|
3512
|
+
/**
|
|
3513
|
+
* Get the private key as a hex string with the 0x prefix.
|
|
3483
3514
|
*
|
|
3484
|
-
* @returns
|
|
3515
|
+
* @returns string representation of the private key
|
|
3485
3516
|
*/
|
|
3486
|
-
|
|
3517
|
+
toString(): string;
|
|
3518
|
+
serialize(serializer: Serializer): void;
|
|
3519
|
+
static deserialize(deserializer: Deserializer): Secp256k1PrivateKey;
|
|
3487
3520
|
/**
|
|
3488
|
-
*
|
|
3489
|
-
|
|
3521
|
+
* @deprecated use `instanceof Secp256k1PrivateKey` instead
|
|
3522
|
+
*/
|
|
3523
|
+
static isPrivateKey(privateKey: PrivateKey): privateKey is Secp256k1PrivateKey;
|
|
3524
|
+
}
|
|
3525
|
+
/**
|
|
3526
|
+
* A signature of a message signed using a Secp256k1 ecdsa private key
|
|
3527
|
+
*/
|
|
3528
|
+
declare class Secp256k1Signature extends Signature {
|
|
3529
|
+
/**
|
|
3530
|
+
* Secp256k1 ecdsa signatures are 256-bit.
|
|
3531
|
+
*/
|
|
3532
|
+
static readonly LENGTH = 64;
|
|
3533
|
+
/**
|
|
3534
|
+
* The signature bytes
|
|
3535
|
+
* @private
|
|
3536
|
+
*/
|
|
3537
|
+
private readonly data;
|
|
3538
|
+
/**
|
|
3539
|
+
* Create a new Signature instance from a Uint8Array or String.
|
|
3490
3540
|
*
|
|
3491
|
-
* @param
|
|
3492
|
-
|
|
3541
|
+
* @param hexInput A HexInput (string or Uint8Array)
|
|
3542
|
+
*/
|
|
3543
|
+
constructor(hexInput: HexInput);
|
|
3544
|
+
toUint8Array(): Uint8Array;
|
|
3545
|
+
serialize(serializer: Serializer): void;
|
|
3546
|
+
static deserialize(deserializer: Deserializer): Secp256k1Signature;
|
|
3547
|
+
}
|
|
3548
|
+
|
|
3549
|
+
declare abstract class AccountAuthenticator extends Serializable {
|
|
3550
|
+
abstract serialize(serializer: Serializer): void;
|
|
3551
|
+
static deserialize(deserializer: Deserializer): AccountAuthenticator;
|
|
3552
|
+
isEd25519(): this is AccountAuthenticatorEd25519;
|
|
3553
|
+
isMultiEd25519(): this is AccountAuthenticatorMultiEd25519;
|
|
3554
|
+
isSingleKey(): this is AccountAuthenticatorSingleKey;
|
|
3555
|
+
isMultiKey(): this is AccountAuthenticatorMultiKey;
|
|
3556
|
+
}
|
|
3557
|
+
/**
|
|
3558
|
+
* Transaction authenticator Ed25519 for a multi signer transaction
|
|
3559
|
+
*
|
|
3560
|
+
* @param public_key Account's Ed25519 public key.
|
|
3561
|
+
* @param signature Account's Ed25519 signature
|
|
3562
|
+
*
|
|
3563
|
+
*/
|
|
3564
|
+
declare class AccountAuthenticatorEd25519 extends AccountAuthenticator {
|
|
3565
|
+
readonly public_key: Ed25519PublicKey;
|
|
3566
|
+
readonly signature: Ed25519Signature;
|
|
3567
|
+
constructor(public_key: Ed25519PublicKey, signature: Ed25519Signature);
|
|
3568
|
+
serialize(serializer: Serializer): void;
|
|
3569
|
+
static load(deserializer: Deserializer): AccountAuthenticatorEd25519;
|
|
3570
|
+
}
|
|
3571
|
+
/**
|
|
3572
|
+
* Transaction authenticator Multi Ed25519 for a multi signers transaction
|
|
3573
|
+
*
|
|
3574
|
+
* @param public_key Account's MultiEd25519 public key.
|
|
3575
|
+
* @param signature Account's MultiEd25519 signature
|
|
3576
|
+
*
|
|
3577
|
+
*/
|
|
3578
|
+
declare class AccountAuthenticatorMultiEd25519 extends AccountAuthenticator {
|
|
3579
|
+
readonly public_key: MultiEd25519PublicKey;
|
|
3580
|
+
readonly signature: MultiEd25519Signature;
|
|
3581
|
+
constructor(public_key: MultiEd25519PublicKey, signature: MultiEd25519Signature);
|
|
3582
|
+
serialize(serializer: Serializer): void;
|
|
3583
|
+
static load(deserializer: Deserializer): AccountAuthenticatorMultiEd25519;
|
|
3584
|
+
}
|
|
3585
|
+
/**
|
|
3586
|
+
* AccountAuthenticatorSingleKey for a single signer
|
|
3587
|
+
*
|
|
3588
|
+
* @param public_key AnyPublicKey
|
|
3589
|
+
* @param signature AnySignature
|
|
3590
|
+
*
|
|
3591
|
+
*/
|
|
3592
|
+
declare class AccountAuthenticatorSingleKey extends AccountAuthenticator {
|
|
3593
|
+
readonly public_key: AnyPublicKey;
|
|
3594
|
+
readonly signature: AnySignature;
|
|
3595
|
+
constructor(public_key: AnyPublicKey, signature: AnySignature);
|
|
3596
|
+
serialize(serializer: Serializer): void;
|
|
3597
|
+
static load(deserializer: Deserializer): AccountAuthenticatorSingleKey;
|
|
3598
|
+
}
|
|
3599
|
+
/**
|
|
3600
|
+
* AccountAuthenticatorMultiKey for a multi signer
|
|
3601
|
+
*
|
|
3602
|
+
* @param public_keys MultiKey
|
|
3603
|
+
* @param signatures Signature
|
|
3604
|
+
*
|
|
3605
|
+
*/
|
|
3606
|
+
declare class AccountAuthenticatorMultiKey extends AccountAuthenticator {
|
|
3607
|
+
readonly public_keys: MultiKey;
|
|
3608
|
+
readonly signatures: Array<AnySignature>;
|
|
3609
|
+
readonly signatures_bitmap: Uint8Array;
|
|
3610
|
+
constructor(public_keys: MultiKey, signatures: Array<AnySignature>, signatures_bitmap: Uint8Array);
|
|
3611
|
+
serialize(serializer: Serializer): void;
|
|
3612
|
+
static load(deserializer: Deserializer): AccountAuthenticatorMultiKey;
|
|
3613
|
+
}
|
|
3614
|
+
|
|
3615
|
+
interface SingleKeySignerConstructorArgs {
|
|
3616
|
+
privateKey: PrivateKey;
|
|
3617
|
+
address?: AccountAddressInput;
|
|
3618
|
+
}
|
|
3619
|
+
interface SingleKeySignerGenerateArgs {
|
|
3620
|
+
scheme?: SigningSchemeInput;
|
|
3621
|
+
}
|
|
3622
|
+
type SingleKeySignerFromDerivationPathArgs = SingleKeySignerGenerateArgs & {
|
|
3623
|
+
path: string;
|
|
3624
|
+
mnemonic: string;
|
|
3625
|
+
};
|
|
3626
|
+
interface VerifySingleKeySignatureArgs {
|
|
3627
|
+
message: HexInput;
|
|
3628
|
+
signature: AnySignature;
|
|
3629
|
+
}
|
|
3630
|
+
/**
|
|
3631
|
+
* Signer implementation for the SingleKey authentication scheme.
|
|
3632
|
+
* This extends a SingleKeyAccount by adding signing capabilities through a valid private key.
|
|
3633
|
+
* Currently, the only supported signature schemes are Ed25519 and Secp256k1.
|
|
3634
|
+
*
|
|
3635
|
+
* Note: Generating a signer instance does not create the account on-chain.
|
|
3636
|
+
*/
|
|
3637
|
+
declare class SingleKeyAccount implements Account$1 {
|
|
3638
|
+
/**
|
|
3639
|
+
* Private key associated with the account
|
|
3640
|
+
*/
|
|
3641
|
+
readonly privateKey: PrivateKey;
|
|
3642
|
+
readonly publicKey: AnyPublicKey;
|
|
3643
|
+
readonly accountAddress: AccountAddress;
|
|
3644
|
+
readonly signingScheme = SigningScheme.SingleKey;
|
|
3645
|
+
constructor(args: SingleKeySignerConstructorArgs);
|
|
3646
|
+
/**
|
|
3647
|
+
* Derives an account from a randomly generated private key.
|
|
3648
|
+
* Default generation is using an Ed25519 key
|
|
3649
|
+
* @returns Account with the given signature scheme
|
|
3650
|
+
*/
|
|
3651
|
+
static generate(args?: SingleKeySignerGenerateArgs): SingleKeyAccount;
|
|
3652
|
+
/**
|
|
3653
|
+
* Derives an account with bip44 path and mnemonics,
|
|
3654
|
+
* Default to using an Ed25519 signature scheme.
|
|
3493
3655
|
*
|
|
3494
|
-
* @
|
|
3656
|
+
* @param args.scheme The signature scheme to derive the private key with
|
|
3657
|
+
* @param args.path the BIP44 derive hardened path (e.g. m/44'/637'/0'/0'/0') for Ed25519,
|
|
3658
|
+
* or non-hardened path (e.g. m/44'/637'/0'/0/0) for secp256k1
|
|
3659
|
+
* Detailed description: {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}
|
|
3660
|
+
* @param args.mnemonic the mnemonic seed phrase of the account
|
|
3495
3661
|
*/
|
|
3496
|
-
|
|
3497
|
-
|
|
3662
|
+
static fromDerivationPath(args: SingleKeySignerFromDerivationPathArgs): SingleKeyAccount;
|
|
3663
|
+
verifySignature(args: VerifySingleKeySignatureArgs): boolean;
|
|
3664
|
+
signWithAuthenticator(message: HexInput): AccountAuthenticatorSingleKey;
|
|
3665
|
+
sign(message: HexInput): AnySignature;
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
/**
|
|
3669
|
+
* Arguments for creating an `Ed25519Account` from an `Ed25519PrivateKey`.
|
|
3670
|
+
* This is the default input type when passing an `Ed25519PrivateKey`.
|
|
3671
|
+
* In order to use the SingleKey authentication scheme, `legacy` needs to be explicitly set to false.
|
|
3672
|
+
*/
|
|
3673
|
+
interface CreateEd25519AccountFromPrivateKeyArgs {
|
|
3674
|
+
privateKey: Ed25519PrivateKey;
|
|
3675
|
+
address?: AccountAddressInput;
|
|
3676
|
+
legacy?: true;
|
|
3677
|
+
}
|
|
3678
|
+
/**
|
|
3679
|
+
* Arguments for creating an `SingleKeyAccount` from an `Ed25519PrivateKey`.
|
|
3680
|
+
* The `legacy` argument needs to be explicitly set to false in order to
|
|
3681
|
+
* use the `SingleKey` authentication scheme.
|
|
3682
|
+
*/
|
|
3683
|
+
interface CreateEd25519SingleKeyAccountFromPrivateKeyArgs {
|
|
3684
|
+
privateKey: Ed25519PrivateKey;
|
|
3685
|
+
address?: AccountAddressInput;
|
|
3686
|
+
legacy: false;
|
|
3687
|
+
}
|
|
3688
|
+
/**
|
|
3689
|
+
* Arguments for creating an `SingleKeyAccount` from any supported private key
|
|
3690
|
+
* that is not an `Ed25519PrivateKey`.
|
|
3691
|
+
* The `legacy` argument defaults to false and cannot be explicitly set to true.
|
|
3692
|
+
*/
|
|
3693
|
+
interface CreateSingleKeyAccountFromPrivateKeyArgs {
|
|
3694
|
+
privateKey: Exclude<PrivateKey, Ed25519PrivateKey>;
|
|
3695
|
+
address?: AccountAddressInput;
|
|
3696
|
+
legacy?: false;
|
|
3697
|
+
}
|
|
3698
|
+
/**
|
|
3699
|
+
* Arguments for creating an opaque `Account` from any supported private key.
|
|
3700
|
+
* This is used when the private key type is not known at compilation time.
|
|
3701
|
+
*/
|
|
3702
|
+
interface CreateAccountFromPrivateKeyArgs {
|
|
3703
|
+
privateKey: PrivateKey;
|
|
3704
|
+
address?: AccountAddressInput;
|
|
3705
|
+
legacy?: boolean;
|
|
3706
|
+
}
|
|
3707
|
+
/**
|
|
3708
|
+
* Arguments for generating an `Ed25519Account`.
|
|
3709
|
+
* This is the input type used by default.
|
|
3710
|
+
*/
|
|
3711
|
+
interface GenerateEd25519AccountArgs {
|
|
3712
|
+
scheme?: SigningSchemeInput.Ed25519;
|
|
3713
|
+
legacy?: true;
|
|
3714
|
+
}
|
|
3715
|
+
/**
|
|
3716
|
+
* Arguments for generating an `SingleKeyAccount` with ah underlying `Ed25519PrivateKey`.
|
|
3717
|
+
* The `legacy` argument needs to be explicitly set to false,
|
|
3718
|
+
* otherwise an `Ed25519Account` will be returned instead.
|
|
3719
|
+
*/
|
|
3720
|
+
interface GenerateEd25519SingleKeyAccountArgs {
|
|
3721
|
+
scheme?: SigningSchemeInput.Ed25519;
|
|
3722
|
+
legacy: false;
|
|
3723
|
+
}
|
|
3724
|
+
/**
|
|
3725
|
+
* Arguments for generating an `SingleKeyAccount` with any supported private key
|
|
3726
|
+
* that is not an `Ed25519PrivateKey`.
|
|
3727
|
+
* The `legacy` argument defaults to false and cannot be explicitly set to true.
|
|
3728
|
+
*/
|
|
3729
|
+
interface GenerateSingleKeyAccountArgs {
|
|
3730
|
+
scheme: Exclude<SigningSchemeInput, SigningSchemeInput.Ed25519>;
|
|
3731
|
+
legacy?: false;
|
|
3732
|
+
}
|
|
3733
|
+
/**
|
|
3734
|
+
* Arguments for generating an opaque `Account`.
|
|
3735
|
+
* This is used when the input signature scheme is not known at compilation time.
|
|
3736
|
+
*/
|
|
3737
|
+
interface GenerateAccountArgs {
|
|
3738
|
+
scheme?: SigningSchemeInput;
|
|
3739
|
+
legacy?: boolean;
|
|
3498
3740
|
}
|
|
3499
3741
|
/**
|
|
3500
|
-
*
|
|
3742
|
+
* Arguments for deriving a private key from a mnemonic phrase and a BIP44 path.
|
|
3501
3743
|
*/
|
|
3502
|
-
|
|
3744
|
+
interface PrivateKeyFromDerivationPathArgs {
|
|
3745
|
+
path: string;
|
|
3746
|
+
mnemonic: string;
|
|
3747
|
+
}
|
|
3748
|
+
/**
|
|
3749
|
+
* Interface for a generic Aptos account.
|
|
3750
|
+
*
|
|
3751
|
+
* The interface is defined as abstract class to provide a single entrypoint for account generation,
|
|
3752
|
+
* either through `Account.generate()` or `Account.fromDerivationPath`.
|
|
3753
|
+
* Despite this being an abstract class, it should be treated as an interface and enforced using
|
|
3754
|
+
* the `implements` keyword.
|
|
3755
|
+
*
|
|
3756
|
+
* Note: Generating an account instance does not create the account on-chain.
|
|
3757
|
+
*/
|
|
3758
|
+
declare abstract class Account$1 {
|
|
3503
3759
|
/**
|
|
3504
|
-
*
|
|
3760
|
+
* Private key associated with the account.
|
|
3761
|
+
* Note: this will be removed in the next major release,
|
|
3762
|
+
* as not all accounts have a private key.
|
|
3505
3763
|
*/
|
|
3506
|
-
|
|
3764
|
+
abstract readonly privateKey: PrivateKey;
|
|
3507
3765
|
/**
|
|
3508
|
-
*
|
|
3509
|
-
* @private
|
|
3766
|
+
* Public key associated with the account
|
|
3510
3767
|
*/
|
|
3511
|
-
|
|
3768
|
+
abstract readonly publicKey: AccountPublicKey;
|
|
3512
3769
|
/**
|
|
3513
|
-
*
|
|
3514
|
-
*
|
|
3515
|
-
* @param hexInput A HexInput (string or Uint8Array)
|
|
3770
|
+
* Account address associated with the account
|
|
3516
3771
|
*/
|
|
3517
|
-
|
|
3772
|
+
abstract readonly accountAddress: AccountAddress;
|
|
3518
3773
|
/**
|
|
3519
|
-
*
|
|
3520
|
-
*
|
|
3521
|
-
* @returns Uint8Array representation of the signature
|
|
3774
|
+
* Signing scheme used to sign transactions
|
|
3522
3775
|
*/
|
|
3523
|
-
|
|
3776
|
+
abstract signingScheme: SigningScheme;
|
|
3524
3777
|
/**
|
|
3525
|
-
*
|
|
3526
|
-
*
|
|
3527
|
-
* @
|
|
3778
|
+
* Derives an account from a randomly generated private key.
|
|
3779
|
+
* @param args.scheme The signature scheme to use, to generate the private key
|
|
3780
|
+
* @param args.legacy Whether to use a legacy authentication scheme, when applicable
|
|
3781
|
+
* @returns An account compatible with the provided signature scheme
|
|
3528
3782
|
*/
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
static
|
|
3532
|
-
static
|
|
3533
|
-
static isSignature(signature: Signature): signature is Secp256k1Signature;
|
|
3534
|
-
}
|
|
3535
|
-
|
|
3536
|
-
declare class AnySignature extends Signature {
|
|
3537
|
-
readonly signature: Signature;
|
|
3538
|
-
constructor(signature: Signature);
|
|
3783
|
+
static generate(args?: GenerateEd25519AccountArgs): Ed25519Account;
|
|
3784
|
+
static generate(args: GenerateEd25519SingleKeyAccountArgs): SingleKeyAccount;
|
|
3785
|
+
static generate(args: GenerateSingleKeyAccountArgs): SingleKeyAccount;
|
|
3786
|
+
static generate(args: GenerateAccountArgs): Account$1;
|
|
3539
3787
|
/**
|
|
3540
|
-
*
|
|
3788
|
+
* Creates an account from the provided private key.
|
|
3541
3789
|
*
|
|
3542
|
-
* @
|
|
3790
|
+
* @param args.privateKey a valid private key
|
|
3791
|
+
* @param args.address the account's address. If not provided, it will be derived from the public key.
|
|
3792
|
+
* @param args.legacy Whether to use a legacy authentication scheme, when applicable
|
|
3543
3793
|
*/
|
|
3544
|
-
|
|
3794
|
+
static fromPrivateKey(args: CreateEd25519AccountFromPrivateKeyArgs): Ed25519Account;
|
|
3795
|
+
static fromPrivateKey(args: CreateEd25519SingleKeyAccountFromPrivateKeyArgs): SingleKeyAccount;
|
|
3796
|
+
static fromPrivateKey(args: CreateSingleKeyAccountFromPrivateKeyArgs): SingleKeyAccount;
|
|
3797
|
+
static fromPrivateKey(args: CreateAccountFromPrivateKeyArgs): Account$1;
|
|
3545
3798
|
/**
|
|
3546
|
-
*
|
|
3799
|
+
* @deprecated use `fromPrivateKey` instead.
|
|
3800
|
+
* Instantiates an account given a private key and a specified account address.
|
|
3801
|
+
* This is primarily used to instantiate an `Account` that has had its authentication key rotated.
|
|
3547
3802
|
*
|
|
3548
|
-
* @
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
static deserialize(deserializer: Deserializer): AnySignature;
|
|
3553
|
-
}
|
|
3554
|
-
|
|
3555
|
-
/**
|
|
3556
|
-
* Represents any public key supported by Aptos.
|
|
3557
|
-
*
|
|
3558
|
-
* Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports
|
|
3559
|
-
* `Legacy` and `Unified` authentication keys.
|
|
3560
|
-
*
|
|
3561
|
-
* Any unified authentication key is represented in the SDK as `AnyPublicKey`.
|
|
3562
|
-
*/
|
|
3563
|
-
declare class AnyPublicKey extends PublicKey {
|
|
3564
|
-
/**
|
|
3565
|
-
* Reference to the inner public key
|
|
3566
|
-
*/
|
|
3567
|
-
readonly publicKey: PublicKey;
|
|
3568
|
-
constructor(publicKey: PublicKey);
|
|
3569
|
-
/**
|
|
3570
|
-
* Get the public key in bytes (Uint8Array).
|
|
3803
|
+
* @param args.privateKey PrivateKey - the underlying private key for the account
|
|
3804
|
+
* @param args.address AccountAddress - The account address the `Account` will sign for
|
|
3805
|
+
* @param args.legacy optional. If set to false, the keypair generated is a Unified keypair. Defaults
|
|
3806
|
+
* to generating a Legacy Ed25519 keypair
|
|
3571
3807
|
*
|
|
3572
|
-
* @returns
|
|
3808
|
+
* @returns Account
|
|
3573
3809
|
*/
|
|
3574
|
-
|
|
3810
|
+
static fromPrivateKeyAndAddress(args: CreateAccountFromPrivateKeyArgs): Account$1;
|
|
3575
3811
|
/**
|
|
3576
|
-
*
|
|
3812
|
+
* Derives an account with bip44 path and mnemonics
|
|
3577
3813
|
*
|
|
3578
|
-
* @
|
|
3814
|
+
* @param args.scheme The signature scheme to derive the private key with
|
|
3815
|
+
* @param args.path the BIP44 derive hardened path (e.g. m/44'/637'/0'/0'/0') for Ed25519,
|
|
3816
|
+
* or non-hardened path (e.g. m/44'/637'/0'/0/0) for secp256k1
|
|
3817
|
+
* Detailed description: {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}
|
|
3818
|
+
* @param args.mnemonic the mnemonic seed phrase of the account
|
|
3579
3819
|
*/
|
|
3580
|
-
|
|
3820
|
+
static fromDerivationPath(args: GenerateEd25519AccountArgs & PrivateKeyFromDerivationPathArgs): Ed25519Account;
|
|
3821
|
+
static fromDerivationPath(args: GenerateEd25519SingleKeyAccountArgs & PrivateKeyFromDerivationPathArgs): SingleKeyAccount;
|
|
3822
|
+
static fromDerivationPath(args: GenerateSingleKeyAccountArgs & PrivateKeyFromDerivationPathArgs): SingleKeyAccount;
|
|
3823
|
+
static fromDerivationPath(args: GenerateAccountArgs & PrivateKeyFromDerivationPathArgs): Account$1;
|
|
3581
3824
|
/**
|
|
3582
|
-
*
|
|
3825
|
+
* @deprecated use `publicKey.authKey()` instead.
|
|
3826
|
+
* This key enables account owners to rotate their private key(s)
|
|
3827
|
+
* associated with the account without changing the address that hosts their account.
|
|
3828
|
+
* See here for more info: {@link https://aptos.dev/concepts/accounts#single-signer-authentication}
|
|
3583
3829
|
*
|
|
3584
|
-
* @param args.
|
|
3585
|
-
* @
|
|
3586
|
-
* @returns true if the signature is valid
|
|
3587
|
-
*/
|
|
3588
|
-
verifySignature(args: {
|
|
3589
|
-
message: HexInput;
|
|
3590
|
-
signature: AnySignature;
|
|
3591
|
-
}): boolean;
|
|
3592
|
-
serialize(serializer: Serializer): void;
|
|
3593
|
-
static deserialize(deserializer: Deserializer): AnyPublicKey;
|
|
3594
|
-
static isPublicKey(publicKey: PublicKey): publicKey is AnyPublicKey;
|
|
3595
|
-
isEd25519(): this is Ed25519PublicKey;
|
|
3596
|
-
isSecp256k1PublicKey(): this is Secp256k1PublicKey;
|
|
3597
|
-
}
|
|
3598
|
-
|
|
3599
|
-
declare class MultiKey extends PublicKey {
|
|
3600
|
-
/**
|
|
3601
|
-
* List of any public keys
|
|
3830
|
+
* @param args.publicKey PublicKey - public key of the account
|
|
3831
|
+
* @returns The authentication key for the associated account
|
|
3602
3832
|
*/
|
|
3603
|
-
|
|
3833
|
+
static authKey(args: {
|
|
3834
|
+
publicKey: AccountPublicKey;
|
|
3835
|
+
}): AuthenticationKey;
|
|
3604
3836
|
/**
|
|
3605
|
-
*
|
|
3837
|
+
* Sign a message using the available signing capabilities.
|
|
3838
|
+
* @param message the signing message, as binary input
|
|
3839
|
+
* @return the AccountAuthenticator containing the signature, together with the account's public key
|
|
3606
3840
|
*/
|
|
3607
|
-
|
|
3608
|
-
constructor(args: {
|
|
3609
|
-
publicKeys: PublicKey[];
|
|
3610
|
-
signaturesRequired: number;
|
|
3611
|
-
});
|
|
3612
|
-
toUint8Array(): Uint8Array;
|
|
3841
|
+
abstract signWithAuthenticator(message: HexInput): AccountAuthenticator;
|
|
3613
3842
|
/**
|
|
3614
|
-
*
|
|
3615
|
-
*
|
|
3616
|
-
*
|
|
3617
|
-
* @param args.bits array of the index mapping to the matching public keys
|
|
3618
|
-
* @returns Uint8array bit map
|
|
3843
|
+
* Sign the given message with the private key.
|
|
3844
|
+
* @param message in HexInput format
|
|
3845
|
+
* @returns AccountSignature
|
|
3619
3846
|
*/
|
|
3620
|
-
|
|
3621
|
-
bits: number[];
|
|
3622
|
-
}): Uint8Array;
|
|
3847
|
+
abstract sign(message: HexInput): Signature;
|
|
3623
3848
|
/**
|
|
3624
|
-
*
|
|
3625
|
-
*
|
|
3626
|
-
* @returns string
|
|
3849
|
+
* @param args.message raw message data in HexInput format
|
|
3850
|
+
* @param args.signature signed message signature
|
|
3627
3851
|
*/
|
|
3628
|
-
|
|
3629
|
-
verifySignature(args: {
|
|
3630
|
-
message: HexInput;
|
|
3631
|
-
signature: AnySignature;
|
|
3632
|
-
}): boolean;
|
|
3633
|
-
serialize(serializer: Serializer): void;
|
|
3634
|
-
static deserialize(deserializer: Deserializer): MultiKey;
|
|
3852
|
+
verifySignature(args: VerifySignatureArgs): boolean;
|
|
3635
3853
|
}
|
|
3636
3854
|
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
}
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
*/
|
|
3649
|
-
declare enum KeyType {
|
|
3650
|
-
ED25519 = "ed25519 seed"
|
|
3855
|
+
interface Ed25519SignerConstructorArgs {
|
|
3856
|
+
privateKey: Ed25519PrivateKey;
|
|
3857
|
+
address?: AccountAddressInput;
|
|
3858
|
+
}
|
|
3859
|
+
interface Ed25519SignerFromDerivationPathArgs {
|
|
3860
|
+
path: string;
|
|
3861
|
+
mnemonic: string;
|
|
3862
|
+
}
|
|
3863
|
+
interface VerifyEd25519SignatureArgs {
|
|
3864
|
+
message: HexInput;
|
|
3865
|
+
signature: Ed25519Signature;
|
|
3651
3866
|
}
|
|
3652
|
-
declare const HARDENED_OFFSET = 2147483648;
|
|
3653
|
-
/**
|
|
3654
|
-
* Aptos derive path is 637
|
|
3655
|
-
*
|
|
3656
|
-
* Parse and validate a path that is compliant to BIP-44 in form m/44'/637'/{account_index}'/{change_index}/{address_index}
|
|
3657
|
-
* for Secp256k1
|
|
3658
|
-
*
|
|
3659
|
-
* Note that for secp256k1, last two components must be non-hardened.
|
|
3660
|
-
*
|
|
3661
|
-
* @param path path string (e.g. `m/44'/637'/0'/0/0`).
|
|
3662
|
-
*/
|
|
3663
|
-
declare function isValidBIP44Path(path: string): boolean;
|
|
3664
3867
|
/**
|
|
3665
|
-
*
|
|
3666
|
-
*
|
|
3667
|
-
* Parse and validate a path that is compliant to SLIP-0010 and BIP-44
|
|
3668
|
-
* in form m/44'/637'/{account_index}'/{change_index}'/{address_index}'.
|
|
3669
|
-
* See SLIP-0010 {@link https://github.com/satoshilabs/slips/blob/master/slip-0044.md}
|
|
3670
|
-
* See BIP-44 {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}
|
|
3671
|
-
*
|
|
3672
|
-
* Note that for Ed25519, all components must be hardened.
|
|
3673
|
-
* This is because non-hardened [PK] derivation would not work due to Ed25519's lack of a key homomorphism.
|
|
3674
|
-
* Specifically, you cannot derive the PK associated with derivation path a/b/c given the PK of a/b.
|
|
3675
|
-
* This is because the PK in Ed25519 is, more or less, computed as 𝑔𝐻(𝑠𝑘),
|
|
3676
|
-
* with the hash function breaking the homomorphism.
|
|
3868
|
+
* Signer implementation for the Ed25519 authentication scheme.
|
|
3869
|
+
* This extends an {@link Ed25519Account} by adding signing capabilities through an {@link Ed25519PrivateKey}.
|
|
3677
3870
|
*
|
|
3678
|
-
*
|
|
3679
|
-
*/
|
|
3680
|
-
declare function isValidHardenedPath(path: string): boolean;
|
|
3681
|
-
declare const deriveKey: (hashSeed: Uint8Array | string, data: Uint8Array | string) => DerivedKeys;
|
|
3682
|
-
/**
|
|
3683
|
-
* Derive a child key from the private key
|
|
3684
|
-
* @param key
|
|
3685
|
-
* @param chainCode
|
|
3686
|
-
* @param index
|
|
3687
|
-
* @constructor
|
|
3688
|
-
*/
|
|
3689
|
-
declare const CKDPriv: ({ key, chainCode }: DerivedKeys, index: number) => DerivedKeys;
|
|
3690
|
-
/**
|
|
3691
|
-
* Splits derive path into segments
|
|
3692
|
-
* @param path
|
|
3693
|
-
*/
|
|
3694
|
-
declare const splitPath: (path: string) => Array<string>;
|
|
3695
|
-
/**
|
|
3696
|
-
* Normalizes the mnemonic by removing extra whitespace and making it lowercase
|
|
3697
|
-
* @param mnemonic the mnemonic seed phrase
|
|
3871
|
+
* Note: Generating a signer instance does not create the account on-chain.
|
|
3698
3872
|
*/
|
|
3699
|
-
declare
|
|
3873
|
+
declare class Ed25519Account implements Account$1 {
|
|
3874
|
+
/**
|
|
3875
|
+
* Private key associated with the account
|
|
3876
|
+
*/
|
|
3877
|
+
readonly privateKey: Ed25519PrivateKey;
|
|
3878
|
+
readonly publicKey: Ed25519PublicKey;
|
|
3879
|
+
readonly accountAddress: AccountAddress;
|
|
3880
|
+
readonly signingScheme = SigningScheme.Ed25519;
|
|
3881
|
+
constructor(args: Ed25519SignerConstructorArgs);
|
|
3882
|
+
/**
|
|
3883
|
+
* Derives a signer from a randomly generated private key
|
|
3884
|
+
*/
|
|
3885
|
+
static generate(): Ed25519Account;
|
|
3886
|
+
/**
|
|
3887
|
+
* Derives an account with bip44 path and mnemonics
|
|
3888
|
+
*
|
|
3889
|
+
* @param args.path the BIP44 derive hardened path e.g. m/44'/637'/0'/0'/0'
|
|
3890
|
+
* Detailed description: {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}
|
|
3891
|
+
* @param args.mnemonic the mnemonic seed phrase of the account
|
|
3892
|
+
*/
|
|
3893
|
+
static fromDerivationPath(args: Ed25519SignerFromDerivationPathArgs): Ed25519Account;
|
|
3894
|
+
verifySignature(args: VerifyEd25519SignatureArgs): boolean;
|
|
3895
|
+
signWithAuthenticator(message: HexInput): AccountAuthenticatorEd25519;
|
|
3896
|
+
sign(message: HexInput): Ed25519Signature;
|
|
3897
|
+
}
|
|
3700
3898
|
|
|
3701
3899
|
/**
|
|
3702
3900
|
* Type of API endpoint for request routing
|
|
@@ -3706,7 +3904,6 @@ declare enum AptosApiType {
|
|
|
3706
3904
|
INDEXER = 1,
|
|
3707
3905
|
FAUCET = 2
|
|
3708
3906
|
}
|
|
3709
|
-
declare const DEFAULT_NETWORK = Network.DEVNET;
|
|
3710
3907
|
/**
|
|
3711
3908
|
* The default max gas amount when none is given.
|
|
3712
3909
|
*
|
|
@@ -4563,72 +4760,6 @@ declare class RotationProofChallenge extends Serializable {
|
|
|
4563
4760
|
serialize(serializer: Serializer): void;
|
|
4564
4761
|
}
|
|
4565
4762
|
|
|
4566
|
-
declare abstract class AccountAuthenticator extends Serializable {
|
|
4567
|
-
abstract serialize(serializer: Serializer): void;
|
|
4568
|
-
static deserialize(deserializer: Deserializer): AccountAuthenticator;
|
|
4569
|
-
isEd25519(): this is AccountAuthenticatorEd25519;
|
|
4570
|
-
isMultiEd25519(): this is AccountAuthenticatorMultiEd25519;
|
|
4571
|
-
isSingleKey(): this is AccountAuthenticatorSingleKey;
|
|
4572
|
-
isMultiKey(): this is AccountAuthenticatorMultiKey;
|
|
4573
|
-
}
|
|
4574
|
-
/**
|
|
4575
|
-
* Transaction authenticator Ed25519 for a multi signer transaction
|
|
4576
|
-
*
|
|
4577
|
-
* @param public_key Account's Ed25519 public key.
|
|
4578
|
-
* @param signature Account's Ed25519 signature
|
|
4579
|
-
*
|
|
4580
|
-
*/
|
|
4581
|
-
declare class AccountAuthenticatorEd25519 extends AccountAuthenticator {
|
|
4582
|
-
readonly public_key: Ed25519PublicKey;
|
|
4583
|
-
readonly signature: Ed25519Signature;
|
|
4584
|
-
constructor(public_key: Ed25519PublicKey, signature: Ed25519Signature);
|
|
4585
|
-
serialize(serializer: Serializer): void;
|
|
4586
|
-
static load(deserializer: Deserializer): AccountAuthenticatorEd25519;
|
|
4587
|
-
}
|
|
4588
|
-
/**
|
|
4589
|
-
* Transaction authenticator Multi Ed25519 for a multi signers transaction
|
|
4590
|
-
*
|
|
4591
|
-
* @param public_key Account's MultiEd25519 public key.
|
|
4592
|
-
* @param signature Account's MultiEd25519 signature
|
|
4593
|
-
*
|
|
4594
|
-
*/
|
|
4595
|
-
declare class AccountAuthenticatorMultiEd25519 extends AccountAuthenticator {
|
|
4596
|
-
readonly public_key: MultiEd25519PublicKey;
|
|
4597
|
-
readonly signature: MultiEd25519Signature;
|
|
4598
|
-
constructor(public_key: MultiEd25519PublicKey, signature: MultiEd25519Signature);
|
|
4599
|
-
serialize(serializer: Serializer): void;
|
|
4600
|
-
static load(deserializer: Deserializer): AccountAuthenticatorMultiEd25519;
|
|
4601
|
-
}
|
|
4602
|
-
/**
|
|
4603
|
-
* AccountAuthenticatorSingleKey for a single signer
|
|
4604
|
-
*
|
|
4605
|
-
* @param public_key AnyPublicKey
|
|
4606
|
-
* @param signature AnySignature
|
|
4607
|
-
*
|
|
4608
|
-
*/
|
|
4609
|
-
declare class AccountAuthenticatorSingleKey extends AccountAuthenticator {
|
|
4610
|
-
readonly public_key: AnyPublicKey;
|
|
4611
|
-
readonly signature: AnySignature;
|
|
4612
|
-
constructor(public_key: AnyPublicKey, signature: AnySignature);
|
|
4613
|
-
serialize(serializer: Serializer): void;
|
|
4614
|
-
static load(deserializer: Deserializer): AccountAuthenticatorSingleKey;
|
|
4615
|
-
}
|
|
4616
|
-
/**
|
|
4617
|
-
* AccountAuthenticatorMultiKey for a multi signer
|
|
4618
|
-
*
|
|
4619
|
-
* @param public_keys MultiKey
|
|
4620
|
-
* @param signatures Signature
|
|
4621
|
-
*
|
|
4622
|
-
*/
|
|
4623
|
-
declare class AccountAuthenticatorMultiKey extends AccountAuthenticator {
|
|
4624
|
-
readonly public_keys: MultiKey;
|
|
4625
|
-
readonly signatures: Array<AnySignature>;
|
|
4626
|
-
readonly signatures_bitmap: Uint8Array;
|
|
4627
|
-
constructor(public_keys: MultiKey, signatures: Array<AnySignature>, signatures_bitmap: Uint8Array);
|
|
4628
|
-
serialize(serializer: Serializer): void;
|
|
4629
|
-
static load(deserializer: Deserializer): AccountAuthenticatorMultiKey;
|
|
4630
|
-
}
|
|
4631
|
-
|
|
4632
4763
|
declare abstract class TransactionAuthenticator extends Serializable {
|
|
4633
4764
|
abstract serialize(serializer: Serializer): void;
|
|
4634
4765
|
static deserialize(deserializer: Deserializer): TransactionAuthenticator;
|
|
@@ -5011,6 +5142,17 @@ declare class DigitalAsset {
|
|
|
5011
5142
|
minimumLedgerVersion?: AnyNumber;
|
|
5012
5143
|
options?: TokenStandardArg;
|
|
5013
5144
|
}): Promise<GetCollectionDataResponse>;
|
|
5145
|
+
/**
|
|
5146
|
+
* Queries data of a specific collection by the collection ID.
|
|
5147
|
+
*
|
|
5148
|
+
* @param args.collectionId the ID of the collection, it's the same thing as the address of the collection object
|
|
5149
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
5150
|
+
* @returns GetCollectionDataResponse response type
|
|
5151
|
+
*/
|
|
5152
|
+
getCollectionDataByCollectionId(args: {
|
|
5153
|
+
collectionId: AccountAddressInput;
|
|
5154
|
+
minimumLedgerVersion?: AnyNumber;
|
|
5155
|
+
}): Promise<GetCollectionDataResponse>;
|
|
5014
5156
|
/**
|
|
5015
5157
|
* Queries a collection's ID.
|
|
5016
5158
|
*
|
|
@@ -6994,4 +7136,4 @@ declare function postAptosFullNode<Req extends {}, Res extends {}>(options: Post
|
|
|
6994
7136
|
declare function postAptosIndexer<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
6995
7137
|
declare function postAptosFaucet<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
6996
7138
|
|
|
6997
|
-
export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_HARDENED_REGEX, Account$1 as Account, AccountAddress, type AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorSingleKey, AccountAuthenticatorVariant, type AccountData, AccountSequenceNumber, type AccountSignature, AddressInvalidReason, type AnyNumber, AnyPublicKey, AnyPublicKeyVariant, type AnyRawTransaction, type AnyRawTransactionInstance, AnySignature, AnySignatureVariant, type AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, type AptosRequest, type AptosResponse, type AptosSettings, AuthenticationKey, type AuthenticationKeyScheme, type Block, type BlockMetadataTransactionResponse, Bool, CKDPriv, ChainId, type Client, type ClientConfig, type ClientRequest, type ClientResponse, type CommittedTransactionResponse,
|
|
7139
|
+
export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_HARDENED_REGEX, Account$1 as Account, AccountAddress, type AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorSingleKey, AccountAuthenticatorVariant, type AccountData, AccountPublicKey, AccountSequenceNumber, type AccountSignature, AddressInvalidReason, type AnyNumber, AnyPublicKey, AnyPublicKeyVariant, type AnyRawTransaction, type AnyRawTransactionInstance, AnySignature, AnySignatureVariant, type AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, type AptosRequest, type AptosResponse, type AptosSettings, AuthenticationKey, type AuthenticationKeyScheme, type Block, type BlockMetadataTransactionResponse, Bool, CKDPriv, ChainId, type Client, type ClientConfig, type ClientRequest, type ClientResponse, type CommittedTransactionResponse, type CreateAccountFromPrivateKeyArgs, type CreateEd25519AccountFromPrivateKeyArgs, type CreateEd25519SingleKeyAccountFromPrivateKeyArgs, type CreateSingleKeyAccountFromPrivateKeyArgs, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, type DecodedTableData, type DeletedTableData, DeriveScheme, type DerivedKeys, type Deserializable, Deserializer, type DirectWriteSet, Ed25519Account, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, type Ed25519SignerConstructorArgs, type Ed25519SignerFromDerivationPathArgs, EntryFunction, type EntryFunctionABI, type EntryFunctionArgument, type EntryFunctionArgumentTypes, EntryFunctionBytes, type EntryFunctionPayloadResponse, type Event$1 as Event, type EventGuid, type ExecutionFinishEventData, type FailureEventData, FeePayerRawTransaction, FixedBytes, type GasEstimation, type GenerateAccount, type GenerateAccountArgs, type GenerateAccountWithEd25519, type GenerateAccountWithSingleSignerSecp256k1Key, type GenerateEd25519AccountArgs, type GenerateEd25519SingleKeyAccountArgs, type GenerateSingleKeyAccountArgs, type GenesisPayload, type GenesisTransactionResponse, type GetANSNameResponse, type GetAccountCoinsDataResponse, type GetAccountCollectionsWithOwnedTokenResponse, type GetAccountOwnedObjectsResponse, type GetAccountOwnedTokensFromCollectionResponse, type GetAccountOwnedTokensQueryResponse, type GetAptosRequestOptions, type GetChainTopUserTransactionsResponse, type GetCollectionDataResponse, type GetCurrentFungibleAssetBalancesResponse, type GetCurrentTokenOwnershipResponse, type GetDelegatedStakingActivitiesResponse, type GetEventsResponse, type GetFungibleAssetActivitiesResponse, type GetFungibleAssetMetadataResponse, type GetNumberOfDelegatorsResponse, type GetOwnedTokensResponse, type GetProcessorStatusResponse, type GetRequestOptions, type GetTokenActivityResponse, type GetTokenDataResponse, type GraphqlQuery, HARDENED_OFFSET, Hex, type HexInput, HexInvalidReason, Identifier, type InputEntryFunctionData, type InputEntryFunctionDataWithABI, type InputEntryFunctionDataWithRemoteABI, type InputGenerateMultiAgentRawTransactionArgs, type InputGenerateMultiAgentRawTransactionData, type InputGenerateRawTransactionArgs, type InputGenerateSingleSignerRawTransactionArgs, type InputGenerateSingleSignerRawTransactionData, type InputGenerateTransactionData, type InputGenerateTransactionOptions, type InputGenerateTransactionPayloadData, type InputGenerateTransactionPayloadDataWithABI, type InputGenerateTransactionPayloadDataWithRemoteABI, type InputMultiSigData, type InputMultiSigDataWithABI, type InputMultiSigDataWithRemoteABI, type InputScriptData, type InputSimulateTransactionData, type InputSimulateTransactionOptions, type InputSubmitTransactionData, type InputViewRequestData, KeyType, type LedgerInfo, type LedgerVersionArg, MimeType, ModuleId, MoveAbility, type MoveAddressType, type MoveFunction, type MoveFunctionGenericTypeParam, type MoveFunctionId, MoveFunctionVisibility, type MoveModule, type MoveModuleBytecode, type MoveModuleId, type MoveObjectType, MoveOption, type MoveOptionType, type MoveResource, type MoveScriptBytecode, MoveString, type MoveStruct, type MoveStructField, type MoveStructId, type MoveStructType, type MoveType, type MoveUint128Type, type MoveUint16Type, type MoveUint256Type, type MoveUint32Type, type MoveUint64Type, type MoveUint8Type, type MoveValue, MoveVector, MultiAgentRawTransaction, type MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiKey, MultiKeySignature, MultiSig, MultiSigTransactionPayload, type MultisigPayloadResponse, Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI, type OrderBy, type OrderByArg, type OrderByValue, type PaginationArgs, ParsingError, type ParsingResult, type PendingTransactionResponse, type PostAptosRequestOptions, type PostRequestOptions, type PrivateKey, type PrivateKeyFromDerivationPathArgs, ProcessorType, PublicKey, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT, RawTransaction, RawTransactionWithData, RoleType, RotationProofChallenge, Script, type ScriptFunctionArgument, type ScriptFunctionArgumentTypes, type ScriptPayloadResponse, ScriptTransactionArgumentVariants, type ScriptWriteSet, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, type SimpleEntryFunctionArgumentTypes, type SimpleTransaction, SingleKeyAccount, type SingleKeySignerConstructorArgs, type SingleKeySignerFromDerivationPathArgs, type SingleKeySignerGenerateArgs, type StateCheckpointTransactionResponse, StructTag, type SuccessEventData, type TableItemRequest, type TokenStandard, type TokenStandardArg, type TransactionArgument, TransactionAuthenticator, TransactionAuthenticatorEd25519, TransactionAuthenticatorFeePayer, TransactionAuthenticatorMultiAgent, TransactionAuthenticatorMultiEd25519, TransactionAuthenticatorSingleSender, TransactionAuthenticatorVariant, type TransactionEd25519Signature, type TransactionFeePayerSignature, type TransactionMultiAgentSignature, type TransactionMultiEd25519Signature, TransactionPayload, TransactionPayloadEntryFunction, TransactionPayloadMultiSig, type TransactionPayloadResponse, TransactionPayloadScript, TransactionPayloadVariants, type TransactionResponse, TransactionResponseType, type TransactionSecp256k1Signature, type TransactionSignature, TransactionVariants, TransactionWorker, type TransactionWorkerEvents, TransactionWorkerEventsEnum, TypeTag, TypeTagAddress, TypeTagBool, TypeTagGeneric, TypeTagParserError, TypeTagParserErrorType, TypeTagReference, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVariants, TypeTagVector, U128, U16, U256, U32, U64, U8, type Uint128, type Uint16, type Uint256, type Uint32, type Uint64, type Uint8, type UserTransactionResponse, type ValidatorTransactionResponse, type VerifyEd25519SignatureArgs, type VerifySignatureArgs, type VerifySingleKeySignatureArgs, type ViewRequest, type WaitForTransactionOptions, type WhereArg, type WriteSet, type WriteSetChange, type WriteSetChangeDeleteModule, type WriteSetChangeDeleteResource, type WriteSetChangeDeleteTableItem, type WriteSetChangeWriteModule, type WriteSetChangeWriteResource, type WriteSetChangeWriteTableItem, aptosCoinStructTag, aptosRequest, buildTransaction, checkOrConvertArgument, convertArgument, deriveKey, deriveTransactionType, deserializeFromScriptArgument, ensureBoolean, fetchEntryFunctionAbi, findFirstNonSignerArg, generateMultiSignersSignedTransaction, generateRawTransaction, generateSignedTransaction, generateSignedTransactionForSimulation, generateSigningMessage, generateTransactionPayload, generateTransactionPayloadWithABI, get, getAptosFullNode, getAuthenticatorForSimulation, getFunctionParts, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBlockMetadataTransactionResponse, isBool, isEd25519Signature, isEncodedEntryFunctionArgument, isFeePayerSignature, isGenesisTransactionResponse, isLargeNumber, isMultiAgentSignature, isMultiEd25519Signature, isNull, isNumber, isPendingTransactionResponse, isScriptDataInput, isSecp256k1Signature, isStateCheckpointTransactionResponse, isString, isUserTransactionResponse, isValidBIP44Path, isValidHardenedPath, isValidatorTransactionResponse, mnemonicToSeed, objectStructTag, optionStructTag, outOfRangeErrorMessage, paginateWithCursor, parseTypeTag, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, promiseFulfilledStatus, request, sign, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch, validateNumberInRange };
|