@aptos-labs/ts-sdk 1.13.3-zeta.0 → 1.13.3
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/common/index.d.ts +1388 -1822
- package/dist/common/index.js +26 -26
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-8gJF5t3F.d.mts → Ed25519Account--qjfup2u.d.mts} +12 -10
- package/dist/esm/api/account.d.mts +1 -13
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +2 -2
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +8 -14
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +0 -20
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +7 -7
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +1 -1
- 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 +5 -5
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +7 -7
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +8 -13
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +1 -1
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +8 -8
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +1 -1
- 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 +6 -6
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +0 -2
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/chunk-24IKVZBK.mjs +2 -0
- package/dist/esm/chunk-24IKVZBK.mjs.map +1 -0
- package/dist/esm/chunk-2HISPUZZ.mjs +2 -0
- package/dist/esm/chunk-2HISPUZZ.mjs.map +1 -0
- package/dist/esm/{chunk-SNQJV7MF.mjs → chunk-3WUGR46O.mjs} +2 -2
- package/dist/esm/{chunk-TVRJ3M7B.mjs → chunk-52C73T26.mjs} +2 -2
- package/dist/esm/{chunk-TVRJ3M7B.mjs.map → chunk-52C73T26.mjs.map} +1 -1
- package/dist/esm/{chunk-3LQPAGL6.mjs → chunk-5P2S2SZZ.mjs} +2 -2
- package/dist/esm/{chunk-CN37OHFT.mjs → chunk-6CFRW26C.mjs} +2 -2
- package/dist/esm/chunk-6CFRW26C.mjs.map +1 -0
- package/dist/esm/chunk-734YX27W.mjs +2 -0
- package/dist/esm/{chunk-WO2KROQ6.mjs.map → chunk-734YX27W.mjs.map} +1 -1
- package/dist/esm/{chunk-6NZNCDDW.mjs → chunk-7QJ6YJXP.mjs} +2 -2
- package/dist/esm/chunk-AD3VLZ7I.mjs +2 -0
- package/dist/esm/chunk-AD3VLZ7I.mjs.map +1 -0
- package/dist/esm/{chunk-MKUAW7KW.mjs → chunk-AU6W5OIH.mjs} +2 -2
- package/dist/esm/{chunk-3CIA6J5L.mjs → chunk-B3R6G6QP.mjs} +2 -2
- package/dist/esm/chunk-B3R6G6QP.mjs.map +1 -0
- package/dist/esm/chunk-B7TQGVGL.mjs +2 -0
- package/dist/esm/{chunk-YGHLXEB4.mjs.map → chunk-B7TQGVGL.mjs.map} +1 -1
- package/dist/esm/{chunk-MWUJCP27.mjs → chunk-BWFJHFBQ.mjs} +2 -2
- package/dist/esm/chunk-CNMQNPNV.mjs +2 -0
- package/dist/esm/chunk-CNMQNPNV.mjs.map +1 -0
- package/dist/esm/{chunk-274CXZ6R.mjs → chunk-CTIN3GTP.mjs} +2 -2
- package/dist/esm/{chunk-W637YAND.mjs → chunk-CU67XZNB.mjs} +2 -2
- package/dist/esm/chunk-CYNQRMO5.mjs +2 -0
- package/dist/esm/chunk-CYNQRMO5.mjs.map +1 -0
- package/dist/esm/{chunk-IEZO4PIG.mjs → chunk-DM44OGQH.mjs} +2 -2
- package/dist/esm/{chunk-3VGX3TXH.mjs → chunk-DMKUAQB7.mjs} +2 -2
- package/dist/esm/{chunk-QMIEBNTP.mjs → chunk-DPV25ZKR.mjs} +2 -2
- package/dist/esm/{chunk-MGOHPDX4.mjs → chunk-DSTKXJMA.mjs} +2 -2
- package/dist/esm/chunk-E7FWVXGX.mjs +1 -0
- package/dist/esm/chunk-EOFJFE4T.mjs +2 -0
- package/dist/esm/chunk-EOFJFE4T.mjs.map +1 -0
- package/dist/esm/chunk-FATWMUXK.mjs +2 -0
- package/dist/esm/chunk-FATWMUXK.mjs.map +1 -0
- package/dist/esm/{chunk-EB7AI4B4.mjs → chunk-FS3NSGBF.mjs} +2 -2
- package/dist/esm/{chunk-E36GTDEB.mjs → chunk-G2O323HP.mjs} +2 -2
- package/dist/esm/{chunk-LDMEIVL6.mjs → chunk-GSD4OOM3.mjs} +2 -2
- package/dist/esm/{chunk-R6PFLI3Z.mjs → chunk-HQ5I4Q3H.mjs} +2 -2
- package/dist/esm/chunk-HQ5I4Q3H.mjs.map +1 -0
- package/dist/esm/{chunk-QXVGXZJX.mjs → chunk-IIPYR7PF.mjs} +2 -2
- package/dist/esm/chunk-IIPYR7PF.mjs.map +1 -0
- package/dist/esm/{chunk-DKLA4F3P.mjs → chunk-IKYIJYBY.mjs} +2 -2
- package/dist/esm/chunk-IKYIJYBY.mjs.map +1 -0
- package/dist/esm/{chunk-T23OVRNF.mjs → chunk-IOSQVDZI.mjs} +2 -2
- package/dist/esm/chunk-KVZ4XMZS.mjs +2 -0
- package/dist/esm/chunk-KVZ4XMZS.mjs.map +1 -0
- package/dist/esm/chunk-LR65XHSF.mjs +2 -0
- package/dist/esm/chunk-LR65XHSF.mjs.map +1 -0
- package/dist/esm/{chunk-HFLWASAB.mjs → chunk-MACC2BLE.mjs} +2 -2
- package/dist/esm/chunk-MC6G725U.mjs +2 -0
- package/dist/esm/chunk-MC6G725U.mjs.map +1 -0
- package/dist/esm/{chunk-Q7TGZJT4.mjs → chunk-MFKMAAWA.mjs} +2 -2
- package/dist/esm/chunk-MLWIHWNH.mjs +1 -0
- package/dist/esm/chunk-NNQJBFRB.mjs +2 -0
- package/dist/esm/{chunk-7STYQ5ZE.mjs → chunk-NPFNYP75.mjs} +2 -2
- package/dist/esm/{chunk-U72H6EST.mjs → chunk-O2F53NKI.mjs} +2 -2
- package/dist/esm/{chunk-7FNHL6LU.mjs → chunk-O4JRPZZM.mjs} +2 -2
- package/dist/esm/chunk-ODRO4CSA.mjs +2 -0
- package/dist/esm/chunk-ODRO4CSA.mjs.map +1 -0
- package/dist/esm/chunk-OVJQWQ2N.mjs +2 -0
- package/dist/esm/chunk-OVJQWQ2N.mjs.map +1 -0
- package/dist/esm/chunk-OWW6SIDP.mjs +2 -0
- package/dist/esm/chunk-OWW6SIDP.mjs.map +1 -0
- package/dist/esm/{chunk-N4B6S6FK.mjs → chunk-PFIMEXNN.mjs} +2 -2
- package/dist/esm/chunk-PFIMEXNN.mjs.map +1 -0
- package/dist/esm/{chunk-Z2ZR4PTF.mjs → chunk-PZGLV5UQ.mjs} +2 -2
- package/dist/esm/{chunk-AKGASNN4.mjs → chunk-Q3TZGQVC.mjs} +2 -2
- package/dist/esm/chunk-Q3TZGQVC.mjs.map +1 -0
- package/dist/esm/{chunk-6RBUXB5I.mjs → chunk-QIAHBEEW.mjs} +2 -2
- package/dist/esm/chunk-QMURTXFM.mjs +2 -0
- package/dist/esm/{chunk-7XHVF3ZX.mjs.map → chunk-QMURTXFM.mjs.map} +1 -1
- package/dist/esm/{chunk-NC5HHEEM.mjs → chunk-QTRYMRYK.mjs} +2 -2
- package/dist/esm/{chunk-STYDBDYL.mjs → chunk-R5QUBEH6.mjs} +2 -2
- package/dist/esm/chunk-R7G3CLRI.mjs +1 -0
- package/dist/esm/{chunk-ZNEBMSNC.mjs → chunk-RHBCVCOS.mjs} +2 -2
- package/dist/esm/{chunk-7H3HRFVM.mjs → chunk-RIUZPGI5.mjs} +2 -2
- package/dist/esm/{chunk-H3LMPXEM.mjs → chunk-SG4MAOCF.mjs} +2 -2
- package/dist/esm/chunk-SUAKPNKQ.mjs +2 -0
- package/dist/esm/chunk-SUAKPNKQ.mjs.map +1 -0
- package/dist/esm/{chunk-3FVRXELT.mjs → chunk-TBMAJ6AW.mjs} +2 -2
- package/dist/esm/chunk-TLOPIURC.mjs +2 -0
- package/dist/esm/chunk-TLOPIURC.mjs.map +1 -0
- package/dist/esm/{chunk-PFFAQZHT.mjs → chunk-U43IJHQN.mjs} +2 -2
- package/dist/esm/{chunk-KNHI66FK.mjs → chunk-UFT7US42.mjs} +2 -2
- package/dist/esm/{chunk-HGZGTBA4.mjs → chunk-UML2VQZT.mjs} +2 -2
- package/dist/esm/chunk-UVSRX4SV.mjs +1 -0
- package/dist/esm/{chunk-T3W5USZC.mjs → chunk-V3Q2KXJU.mjs} +2 -2
- package/dist/esm/chunk-V4SRNEV3.mjs +2 -0
- package/dist/esm/chunk-V4SRNEV3.mjs.map +1 -0
- package/dist/esm/{chunk-3PGVEOWR.mjs → chunk-V6OS74OS.mjs} +2 -2
- package/dist/esm/chunk-VVIG4E7Q.mjs +2 -0
- package/dist/esm/{chunk-APEBWN6Q.mjs → chunk-W4ZW7QHA.mjs} +2 -2
- package/dist/esm/{chunk-COW5IGYC.mjs → chunk-WFZDFFBM.mjs} +2 -2
- package/dist/esm/{chunk-2SD6JLIU.mjs → chunk-WLF5YQM4.mjs} +2 -2
- package/dist/esm/chunk-WLF5YQM4.mjs.map +1 -0
- package/dist/esm/chunk-XDGQTMDV.mjs +2 -0
- package/dist/esm/chunk-XDGQTMDV.mjs.map +1 -0
- package/dist/esm/{chunk-TE7AJKSU.mjs → chunk-XO3HHRJV.mjs} +2 -2
- package/dist/esm/chunk-YFRXBEOC.mjs +2 -0
- package/dist/esm/chunk-YFRXBEOC.mjs.map +1 -0
- package/dist/esm/chunk-YPTF6MLX.mjs +2 -0
- package/dist/esm/chunk-YPTF6MLX.mjs.map +1 -0
- package/dist/esm/{chunk-J2IIPYZG.mjs → chunk-YU3KB3UV.mjs} +2 -2
- package/dist/esm/{chunk-KCVBUZ6L.mjs → chunk-Z5YFM2AW.mjs} +2 -2
- package/dist/esm/chunk-Z5YFM2AW.mjs.map +1 -0
- package/dist/esm/{chunk-C3L4ETUF.mjs → chunk-ZYYK3UXP.mjs} +2 -2
- package/dist/esm/{chunk-H6BRBIMG.mjs → chunk-ZZZZVONX.mjs} +2 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +1 -2
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +2 -2
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +1 -3
- 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/index.d.mts +14 -5
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +10 -0
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/hdKey.d.mts +1 -15
- package/dist/esm/core/crypto/hdKey.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +5 -7
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +3 -4
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/index.d.mts +7 -6
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +9 -15
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +1 -13
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +7 -7
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +2 -2
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +5 -5
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.d.mts +7 -7
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +4 -3
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +2 -2
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- 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/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.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 +1 -13
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +2 -2
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +1 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +25 -13
- 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 +6 -6
- package/dist/esm/types/index.d.mts +3 -17
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/utils/apiEndpoints.d.mts +1 -3
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.d.mts +1 -3
- 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/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -7
- package/src/api/account.ts +1 -2
- package/src/api/ans.ts +1 -2
- package/src/api/aptos.ts +0 -6
- package/src/api/aptosConfig.ts +1 -46
- package/src/api/digitalAsset.ts +1 -2
- package/src/api/fungibleAsset.ts +1 -2
- package/src/api/transaction.ts +1 -2
- package/src/api/transactionSubmission/management.ts +1 -1
- package/src/api/transactionSubmission/sign.ts +1 -1
- package/src/bcs/serializer.ts +0 -18
- package/src/client/core.ts +0 -8
- package/src/client/get.ts +0 -6
- package/src/client/post.ts +0 -12
- package/src/{account → core/account}/Account.ts +16 -12
- package/src/{account → core/account}/Ed25519Account.ts +7 -13
- package/src/{account → core/account}/SingleKeyAccount.ts +8 -13
- package/src/core/account/index.ts +3 -1
- package/src/core/crypto/ed25519.ts +24 -4
- package/src/core/crypto/hdKey.ts +0 -31
- package/src/core/crypto/index.ts +0 -2
- package/src/core/crypto/multiKey.ts +11 -21
- package/src/core/crypto/singleKey.ts +0 -11
- package/src/core/index.ts +1 -0
- package/src/index.ts +0 -1
- package/src/internal/account.ts +1 -1
- package/src/internal/ans.ts +1 -2
- package/src/internal/digitalAsset.ts +1 -2
- package/src/internal/fungibleAsset.ts +1 -2
- package/src/internal/transactionSubmission.ts +7 -8
- package/src/transactions/authenticator/account.ts +11 -6
- package/src/transactions/management/accountSequenceNumber.ts +1 -1
- package/src/transactions/management/transactionWorker.ts +2 -8
- package/src/transactions/transactionBuilder/index.ts +0 -1
- package/src/transactions/transactionBuilder/transactionBuilder.ts +70 -41
- package/src/types/index.ts +0 -19
- package/src/utils/apiEndpoints.ts +0 -14
- package/src/utils/const.ts +0 -2
- package/src/version.ts +1 -1
- package/dist/esm/account/Account.d.mts +0 -34
- package/dist/esm/account/Account.mjs +0 -2
- package/dist/esm/account/Ed25519Account.d.mts +0 -34
- package/dist/esm/account/Ed25519Account.mjs +0 -2
- package/dist/esm/account/EphemeralKeyPair.d.mts +0 -46
- package/dist/esm/account/EphemeralKeyPair.mjs +0 -2
- package/dist/esm/account/KeylessAccount.d.mts +0 -87
- package/dist/esm/account/KeylessAccount.mjs +0 -2
- package/dist/esm/account/MultiKeyAccount.d.mts +0 -99
- package/dist/esm/account/MultiKeyAccount.mjs +0 -2
- package/dist/esm/account/SingleKeyAccount.d.mts +0 -34
- package/dist/esm/account/SingleKeyAccount.mjs +0 -2
- package/dist/esm/account/index.d.mts +0 -39
- package/dist/esm/account/index.mjs +0 -2
- package/dist/esm/api/keyless.d.mts +0 -65
- package/dist/esm/api/keyless.mjs +0 -2
- package/dist/esm/api/keyless.mjs.map +0 -1
- package/dist/esm/chunk-2M7KHFEG.mjs +0 -2
- package/dist/esm/chunk-2M7KHFEG.mjs.map +0 -1
- package/dist/esm/chunk-2SD6JLIU.mjs.map +0 -1
- package/dist/esm/chunk-2YDIOWRJ.mjs +0 -2
- package/dist/esm/chunk-2YDIOWRJ.mjs.map +0 -1
- package/dist/esm/chunk-3CIA6J5L.mjs.map +0 -1
- package/dist/esm/chunk-5VSMDXZ6.mjs +0 -2
- package/dist/esm/chunk-5VSMDXZ6.mjs.map +0 -1
- package/dist/esm/chunk-6GQAHQGW.mjs +0 -2
- package/dist/esm/chunk-6GQAHQGW.mjs.map +0 -1
- package/dist/esm/chunk-6NMHAFIO.mjs +0 -2
- package/dist/esm/chunk-6NMHAFIO.mjs.map +0 -1
- package/dist/esm/chunk-7MPJPZ73.mjs +0 -2
- package/dist/esm/chunk-7MPJPZ73.mjs.map +0 -1
- package/dist/esm/chunk-7XHVF3ZX.mjs +0 -2
- package/dist/esm/chunk-7Z6DYLCA.mjs +0 -1
- package/dist/esm/chunk-7Z6DYLCA.mjs.map +0 -1
- package/dist/esm/chunk-AKGASNN4.mjs.map +0 -1
- package/dist/esm/chunk-AQ4I7VVB.mjs +0 -1
- package/dist/esm/chunk-AQ4I7VVB.mjs.map +0 -1
- package/dist/esm/chunk-CN37OHFT.mjs.map +0 -1
- package/dist/esm/chunk-CQJ4WN7M.mjs +0 -2
- package/dist/esm/chunk-CQJ4WN7M.mjs.map +0 -1
- package/dist/esm/chunk-DKLA4F3P.mjs.map +0 -1
- package/dist/esm/chunk-E4Z5IEZP.mjs +0 -2
- package/dist/esm/chunk-E4Z5IEZP.mjs.map +0 -1
- package/dist/esm/chunk-EQKI6NJR.mjs +0 -2
- package/dist/esm/chunk-EQKI6NJR.mjs.map +0 -1
- package/dist/esm/chunk-F6QCHPVS.mjs +0 -2
- package/dist/esm/chunk-F6QCHPVS.mjs.map +0 -1
- package/dist/esm/chunk-FLYEALDB.mjs +0 -2
- package/dist/esm/chunk-FLYEALDB.mjs.map +0 -1
- package/dist/esm/chunk-HQWIGPYQ.mjs +0 -2
- package/dist/esm/chunk-HQWIGPYQ.mjs.map +0 -1
- package/dist/esm/chunk-HURQZGUZ.mjs +0 -2
- package/dist/esm/chunk-HURQZGUZ.mjs.map +0 -1
- package/dist/esm/chunk-JEUAQVXW.mjs +0 -2
- package/dist/esm/chunk-JEUAQVXW.mjs.map +0 -1
- package/dist/esm/chunk-JOYJUVSE.mjs +0 -2
- package/dist/esm/chunk-JOYJUVSE.mjs.map +0 -1
- package/dist/esm/chunk-JXCZTOYC.mjs +0 -1
- package/dist/esm/chunk-JXCZTOYC.mjs.map +0 -1
- package/dist/esm/chunk-KCVBUZ6L.mjs.map +0 -1
- package/dist/esm/chunk-LX7N4NUS.mjs +0 -2
- package/dist/esm/chunk-LX7N4NUS.mjs.map +0 -1
- package/dist/esm/chunk-N4B6S6FK.mjs.map +0 -1
- package/dist/esm/chunk-NMVZP3Q2.mjs +0 -2
- package/dist/esm/chunk-NMVZP3Q2.mjs.map +0 -1
- package/dist/esm/chunk-NNA5VEB2.mjs +0 -2
- package/dist/esm/chunk-NNA5VEB2.mjs.map +0 -1
- package/dist/esm/chunk-OKRUEVF3.mjs +0 -2
- package/dist/esm/chunk-OKRUEVF3.mjs.map +0 -1
- package/dist/esm/chunk-PLPCOELE.mjs +0 -2
- package/dist/esm/chunk-PLPCOELE.mjs.map +0 -1
- package/dist/esm/chunk-QHIQLTBS.mjs +0 -2
- package/dist/esm/chunk-QHIQLTBS.mjs.map +0 -1
- package/dist/esm/chunk-QXVGXZJX.mjs.map +0 -1
- package/dist/esm/chunk-R6PFLI3Z.mjs.map +0 -1
- package/dist/esm/chunk-RFSO3JRG.mjs +0 -1
- package/dist/esm/chunk-RFSO3JRG.mjs.map +0 -1
- package/dist/esm/chunk-RPXN7HGR.mjs +0 -2
- package/dist/esm/chunk-RPXN7HGR.mjs.map +0 -1
- package/dist/esm/chunk-S5HG2QUD.mjs +0 -2
- package/dist/esm/chunk-S5HG2QUD.mjs.map +0 -1
- package/dist/esm/chunk-SRLCFTZR.mjs +0 -2
- package/dist/esm/chunk-SRLCFTZR.mjs.map +0 -1
- package/dist/esm/chunk-TBG3MIIE.mjs +0 -2
- package/dist/esm/chunk-TBG3MIIE.mjs.map +0 -1
- package/dist/esm/chunk-TJPWYYNO.mjs +0 -2
- package/dist/esm/chunk-TJPWYYNO.mjs.map +0 -1
- package/dist/esm/chunk-W76IQV5K.mjs +0 -2
- package/dist/esm/chunk-W76IQV5K.mjs.map +0 -1
- package/dist/esm/chunk-WO2KROQ6.mjs +0 -2
- package/dist/esm/chunk-X56CTMYB.mjs +0 -2
- package/dist/esm/chunk-XEXWFQNP.mjs +0 -2
- package/dist/esm/chunk-YE5B2S5L.mjs +0 -2
- package/dist/esm/chunk-YE5B2S5L.mjs.map +0 -1
- package/dist/esm/chunk-YGHLXEB4.mjs +0 -2
- package/dist/esm/core/crypto/ephemeral.d.mts +0 -77
- package/dist/esm/core/crypto/ephemeral.mjs +0 -2
- package/dist/esm/core/crypto/ephemeral.mjs.map +0 -1
- package/dist/esm/core/crypto/keyless.d.mts +0 -217
- package/dist/esm/core/crypto/keyless.mjs +0 -2
- package/dist/esm/core/crypto/keyless.mjs.map +0 -1
- package/dist/esm/core/crypto/poseidon.d.mts +0 -7
- package/dist/esm/core/crypto/poseidon.mjs +0 -2
- package/dist/esm/core/crypto/poseidon.mjs.map +0 -1
- package/dist/esm/internal/keyless.d.mts +0 -65
- package/dist/esm/internal/keyless.mjs +0 -2
- package/dist/esm/internal/keyless.mjs.map +0 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +0 -47
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +0 -2
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +0 -1
- package/dist/esm/types/keyless.d.mts +0 -14
- package/dist/esm/types/keyless.mjs +0 -1
- package/dist/esm/types/keyless.mjs.map +0 -1
- package/src/account/EphemeralKeyPair.ts +0 -115
- package/src/account/KeylessAccount.ts +0 -240
- package/src/account/MultiKeyAccount.ts +0 -119
- package/src/account/index.ts +0 -6
- package/src/api/keyless.ts +0 -34
- package/src/core/crypto/ephemeral.ts +0 -149
- package/src/core/crypto/keyless.ts +0 -508
- package/src/core/crypto/poseidon.ts +0 -134
- package/src/internal/keyless.ts +0 -185
- package/src/transactions/transactionBuilder/signingMessage.ts +0 -70
- package/src/types/keyless.ts +0 -6
- /package/dist/esm/{chunk-SNQJV7MF.mjs.map → chunk-3WUGR46O.mjs.map} +0 -0
- /package/dist/esm/{chunk-3LQPAGL6.mjs.map → chunk-5P2S2SZZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-6NZNCDDW.mjs.map → chunk-7QJ6YJXP.mjs.map} +0 -0
- /package/dist/esm/{chunk-MKUAW7KW.mjs.map → chunk-AU6W5OIH.mjs.map} +0 -0
- /package/dist/esm/{chunk-MWUJCP27.mjs.map → chunk-BWFJHFBQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-274CXZ6R.mjs.map → chunk-CTIN3GTP.mjs.map} +0 -0
- /package/dist/esm/{chunk-W637YAND.mjs.map → chunk-CU67XZNB.mjs.map} +0 -0
- /package/dist/esm/{chunk-IEZO4PIG.mjs.map → chunk-DM44OGQH.mjs.map} +0 -0
- /package/dist/esm/{chunk-3VGX3TXH.mjs.map → chunk-DMKUAQB7.mjs.map} +0 -0
- /package/dist/esm/{chunk-QMIEBNTP.mjs.map → chunk-DPV25ZKR.mjs.map} +0 -0
- /package/dist/esm/{chunk-MGOHPDX4.mjs.map → chunk-DSTKXJMA.mjs.map} +0 -0
- /package/dist/esm/{account/Account.mjs.map → chunk-E7FWVXGX.mjs.map} +0 -0
- /package/dist/esm/{chunk-EB7AI4B4.mjs.map → chunk-FS3NSGBF.mjs.map} +0 -0
- /package/dist/esm/{chunk-E36GTDEB.mjs.map → chunk-G2O323HP.mjs.map} +0 -0
- /package/dist/esm/{chunk-LDMEIVL6.mjs.map → chunk-GSD4OOM3.mjs.map} +0 -0
- /package/dist/esm/{chunk-T23OVRNF.mjs.map → chunk-IOSQVDZI.mjs.map} +0 -0
- /package/dist/esm/{chunk-HFLWASAB.mjs.map → chunk-MACC2BLE.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q7TGZJT4.mjs.map → chunk-MFKMAAWA.mjs.map} +0 -0
- /package/dist/esm/{account/Ed25519Account.mjs.map → chunk-MLWIHWNH.mjs.map} +0 -0
- /package/dist/esm/{chunk-XEXWFQNP.mjs.map → chunk-NNQJBFRB.mjs.map} +0 -0
- /package/dist/esm/{chunk-7STYQ5ZE.mjs.map → chunk-NPFNYP75.mjs.map} +0 -0
- /package/dist/esm/{chunk-U72H6EST.mjs.map → chunk-O2F53NKI.mjs.map} +0 -0
- /package/dist/esm/{chunk-7FNHL6LU.mjs.map → chunk-O4JRPZZM.mjs.map} +0 -0
- /package/dist/esm/{chunk-Z2ZR4PTF.mjs.map → chunk-PZGLV5UQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-6RBUXB5I.mjs.map → chunk-QIAHBEEW.mjs.map} +0 -0
- /package/dist/esm/{chunk-NC5HHEEM.mjs.map → chunk-QTRYMRYK.mjs.map} +0 -0
- /package/dist/esm/{chunk-STYDBDYL.mjs.map → chunk-R5QUBEH6.mjs.map} +0 -0
- /package/dist/esm/{account/EphemeralKeyPair.mjs.map → chunk-R7G3CLRI.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZNEBMSNC.mjs.map → chunk-RHBCVCOS.mjs.map} +0 -0
- /package/dist/esm/{chunk-7H3HRFVM.mjs.map → chunk-RIUZPGI5.mjs.map} +0 -0
- /package/dist/esm/{chunk-H3LMPXEM.mjs.map → chunk-SG4MAOCF.mjs.map} +0 -0
- /package/dist/esm/{chunk-3FVRXELT.mjs.map → chunk-TBMAJ6AW.mjs.map} +0 -0
- /package/dist/esm/{chunk-PFFAQZHT.mjs.map → chunk-U43IJHQN.mjs.map} +0 -0
- /package/dist/esm/{chunk-KNHI66FK.mjs.map → chunk-UFT7US42.mjs.map} +0 -0
- /package/dist/esm/{chunk-HGZGTBA4.mjs.map → chunk-UML2VQZT.mjs.map} +0 -0
- /package/dist/esm/{account/KeylessAccount.mjs.map → chunk-UVSRX4SV.mjs.map} +0 -0
- /package/dist/esm/{chunk-T3W5USZC.mjs.map → chunk-V3Q2KXJU.mjs.map} +0 -0
- /package/dist/esm/{chunk-3PGVEOWR.mjs.map → chunk-V6OS74OS.mjs.map} +0 -0
- /package/dist/esm/{chunk-X56CTMYB.mjs.map → chunk-VVIG4E7Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-APEBWN6Q.mjs.map → chunk-W4ZW7QHA.mjs.map} +0 -0
- /package/dist/esm/{chunk-COW5IGYC.mjs.map → chunk-WFZDFFBM.mjs.map} +0 -0
- /package/dist/esm/{chunk-TE7AJKSU.mjs.map → chunk-XO3HHRJV.mjs.map} +0 -0
- /package/dist/esm/{chunk-J2IIPYZG.mjs.map → chunk-YU3KB3UV.mjs.map} +0 -0
- /package/dist/esm/{chunk-C3L4ETUF.mjs.map → chunk-ZYYK3UXP.mjs.map} +0 -0
- /package/dist/esm/{chunk-H6BRBIMG.mjs.map → chunk-ZZZZVONX.mjs.map} +0 -0
- /package/dist/esm/{account/MultiKeyAccount.mjs.map → core/account/Account.mjs.map} +0 -0
- /package/dist/esm/{account/SingleKeyAccount.mjs.map → core/account/Ed25519Account.mjs.map} +0 -0
- /package/dist/esm/{account/index.mjs.map → core/account/SingleKeyAccount.mjs.map} +0 -0
package/src/api/transaction.ts
CHANGED
|
@@ -33,8 +33,7 @@ import {
|
|
|
33
33
|
InputGenerateTransactionOptions,
|
|
34
34
|
InputGenerateTransactionPayloadData,
|
|
35
35
|
} from "../transactions";
|
|
36
|
-
import { AccountAddressInput, PrivateKey } from "../core";
|
|
37
|
-
import { Account } from "../account";
|
|
36
|
+
import { AccountAddressInput, Account, PrivateKey } from "../core";
|
|
38
37
|
import { Build } from "./transactionSubmission/build";
|
|
39
38
|
import { Simulate } from "./transactionSubmission/simulate";
|
|
40
39
|
import { Submit } from "./transactionSubmission/submit";
|
|
@@ -2,7 +2,7 @@ import EventEmitter from "eventemitter3";
|
|
|
2
2
|
import { TransactionWorkerEvents, TransactionWorker, TransactionWorkerEventsEnum } from "../../transactions/management";
|
|
3
3
|
import { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from "../../transactions";
|
|
4
4
|
import { AptosConfig } from "../aptosConfig";
|
|
5
|
-
import { Account } from "../../
|
|
5
|
+
import { Account } from "../../core";
|
|
6
6
|
|
|
7
7
|
export class TransactionManagement extends EventEmitter<TransactionWorkerEvents> {
|
|
8
8
|
account!: Account;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { Account } from "../../
|
|
4
|
+
import { Account } from "../../core";
|
|
5
5
|
import { signTransaction } from "../../internal/transactionSubmission";
|
|
6
6
|
import { AccountAuthenticator, AnyRawTransaction } from "../../transactions";
|
|
7
7
|
import { AptosConfig } from "../aptosConfig";
|
package/src/bcs/serializer.ts
CHANGED
|
@@ -316,24 +316,6 @@ export class Serializer {
|
|
|
316
316
|
item.serialize(this);
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
|
-
|
|
320
|
-
serializeOption<T extends Serializable>(value?: T): void {
|
|
321
|
-
if (value === undefined) {
|
|
322
|
-
this.serializeU32AsUleb128(0);
|
|
323
|
-
} else {
|
|
324
|
-
this.serializeU32AsUleb128(1);
|
|
325
|
-
value.serialize(this);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
serializeOptionStr(value?: string): void {
|
|
330
|
-
if (value === undefined) {
|
|
331
|
-
this.serializeU32AsUleb128(0);
|
|
332
|
-
} else {
|
|
333
|
-
this.serializeU32AsUleb128(1);
|
|
334
|
-
this.serializeStr(value);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
319
|
}
|
|
338
320
|
|
|
339
321
|
export function ensureBoolean(value: unknown): asserts value is boolean {
|
package/src/client/core.ts
CHANGED
|
@@ -106,14 +106,6 @@ export async function aptosRequest<Req extends {}, Res extends {}>(
|
|
|
106
106
|
return result;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
if (result.status >= 500) {
|
|
110
|
-
throw new AptosApiError(options, result, `${response.data}`);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (aptosConfig.isPepperServiceRequest(url)) {
|
|
114
|
-
throw new AptosApiError(options, result, `${response.data}`);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
109
|
let errorMessage: string;
|
|
118
110
|
|
|
119
111
|
if (result && result.data && "message" in result.data && "error_code" in result.data) {
|
package/src/client/get.ts
CHANGED
|
@@ -89,12 +89,6 @@ export async function getAptosFullNode<Req extends {}, Res extends {}>(
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
export async function getAptosPepperService<Req extends {}, Res extends {}>(
|
|
93
|
-
options: GetAptosRequestOptions,
|
|
94
|
-
): Promise<AptosResponse<Req, Res>> {
|
|
95
|
-
return get<Req, Res>({ ...options, type: AptosApiType.PEPPER });
|
|
96
|
-
}
|
|
97
|
-
|
|
98
92
|
/// This function is a helper for paginating using a function wrapping an API
|
|
99
93
|
export async function paginateWithCursor<Req extends Record<string, any>, Res extends Array<{}>>(
|
|
100
94
|
options: GetAptosRequestOptions,
|
package/src/client/post.ts
CHANGED
|
@@ -135,15 +135,3 @@ export async function postAptosFaucet<Req extends {}, Res extends {}>(
|
|
|
135
135
|
},
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
export async function postAptosPepperService<Req extends {}, Res extends {}>(
|
|
140
|
-
options: PostAptosRequestOptions,
|
|
141
|
-
): Promise<AptosResponse<Req, Res>> {
|
|
142
|
-
return post<Req, Res>({ ...options, type: AptosApiType.PEPPER });
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export async function postAptosProvingService<Req extends {}, Res extends {}>(
|
|
146
|
-
options: PostAptosRequestOptions,
|
|
147
|
-
): Promise<AptosResponse<Req, Res>> {
|
|
148
|
-
return post<Req, Res>({ ...options, type: AptosApiType.PROVER });
|
|
149
|
-
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { AccountAuthenticator } from "
|
|
2
|
-
import { HexInput, SigningScheme, SigningSchemeInput } from "
|
|
3
|
-
import type { AccountAddress, AccountAddressInput } from "../
|
|
4
|
-
import { AuthenticationKey } from "../
|
|
5
|
-
import { AccountPublicKey, Ed25519PrivateKey, PrivateKey, Signature, VerifySignatureArgs } from "../
|
|
1
|
+
import type { AccountAuthenticator } from "../../transactions/authenticator/account";
|
|
2
|
+
import { HexInput, SigningScheme, SigningSchemeInput } from "../../types";
|
|
3
|
+
import type { AccountAddress, AccountAddressInput } from "../accountAddress";
|
|
4
|
+
import { AuthenticationKey } from "../authenticationKey";
|
|
5
|
+
import { AccountPublicKey, Ed25519PrivateKey, PrivateKey, Signature, VerifySignatureArgs } from "../crypto";
|
|
6
6
|
import { Ed25519Account } from "./Ed25519Account";
|
|
7
7
|
import { SingleKeyAccount } from "./SingleKeyAccount";
|
|
8
|
-
import { AnyRawTransaction } from "../transactions/types";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Arguments for creating an `Ed25519Account` from an `Ed25519PrivateKey`.
|
|
@@ -107,6 +106,13 @@ export interface PrivateKeyFromDerivationPathArgs {
|
|
|
107
106
|
* Note: Generating an account instance does not create the account on-chain.
|
|
108
107
|
*/
|
|
109
108
|
export abstract class Account {
|
|
109
|
+
/**
|
|
110
|
+
* Private key associated with the account.
|
|
111
|
+
* Note: this will be removed in the next major release,
|
|
112
|
+
* as not all accounts have a private key.
|
|
113
|
+
*/
|
|
114
|
+
abstract readonly privateKey: PrivateKey;
|
|
115
|
+
|
|
110
116
|
/**
|
|
111
117
|
* Public key associated with the account
|
|
112
118
|
*/
|
|
@@ -216,11 +222,11 @@ export abstract class Account {
|
|
|
216
222
|
}
|
|
217
223
|
|
|
218
224
|
/**
|
|
219
|
-
* Sign a
|
|
220
|
-
* @param
|
|
221
|
-
* @return the AccountAuthenticator containing the signature
|
|
225
|
+
* Sign a message using the available signing capabilities.
|
|
226
|
+
* @param message the signing message, as binary input
|
|
227
|
+
* @return the AccountAuthenticator containing the signature, together with the account's public key
|
|
222
228
|
*/
|
|
223
|
-
abstract signWithAuthenticator(
|
|
229
|
+
abstract signWithAuthenticator(message: HexInput): AccountAuthenticator;
|
|
224
230
|
|
|
225
231
|
/**
|
|
226
232
|
* Sign the given message with the private key.
|
|
@@ -229,8 +235,6 @@ export abstract class Account {
|
|
|
229
235
|
*/
|
|
230
236
|
abstract sign(message: HexInput): Signature;
|
|
231
237
|
|
|
232
|
-
abstract signTransaction(transaction: AnyRawTransaction): Signature;
|
|
233
|
-
|
|
234
238
|
/**
|
|
235
239
|
* @param args.message raw message data in HexInput format
|
|
236
240
|
* @param args.signature signed message signature
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { AccountAuthenticatorEd25519 } from "
|
|
2
|
-
import { HexInput, SigningScheme } from "
|
|
3
|
-
import { AccountAddress, AccountAddressInput } from "../
|
|
4
|
-
import { Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature } from "../
|
|
1
|
+
import { AccountAuthenticatorEd25519 } from "../../transactions/authenticator/account";
|
|
2
|
+
import { HexInput, SigningScheme } from "../../types";
|
|
3
|
+
import { AccountAddress, AccountAddressInput } from "../accountAddress";
|
|
4
|
+
import { Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature } from "../crypto";
|
|
5
5
|
import type { Account } from "./Account";
|
|
6
|
-
import { AnyRawTransaction } from "../transactions/types";
|
|
7
|
-
import { generateSigningMessageForTransaction } from "../transactions/transactionBuilder/signingMessage";
|
|
8
6
|
|
|
9
7
|
export interface Ed25519SignerConstructorArgs {
|
|
10
8
|
privateKey: Ed25519PrivateKey;
|
|
@@ -77,17 +75,13 @@ export class Ed25519Account implements Account {
|
|
|
77
75
|
return this.publicKey.verifySignature(args);
|
|
78
76
|
}
|
|
79
77
|
|
|
80
|
-
signWithAuthenticator(
|
|
81
|
-
const signature = this.privateKey.sign(
|
|
78
|
+
signWithAuthenticator(message: HexInput) {
|
|
79
|
+
const signature = this.privateKey.sign(message);
|
|
82
80
|
return new AccountAuthenticatorEd25519(this.publicKey, signature);
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
sign(message: HexInput) {
|
|
86
|
-
return this.
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
signTransaction(transaction: AnyRawTransaction) {
|
|
90
|
-
return this.sign(generateSigningMessageForTransaction(transaction));
|
|
84
|
+
return this.signWithAuthenticator(message).signature;
|
|
91
85
|
}
|
|
92
86
|
|
|
93
87
|
// endregion
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { AccountAuthenticatorSingleKey } from "
|
|
2
|
-
import { type HexInput, SigningScheme, SigningSchemeInput } from "
|
|
3
|
-
import { AccountAddress, AccountAddressInput } from "../
|
|
4
|
-
import { AnyPublicKey, AnySignature, Ed25519PrivateKey, PrivateKey, Secp256k1PrivateKey } from "../
|
|
1
|
+
import { AccountAuthenticatorSingleKey } from "../../transactions/authenticator/account";
|
|
2
|
+
import { type HexInput, SigningScheme, SigningSchemeInput } from "../../types";
|
|
3
|
+
import { AccountAddress, AccountAddressInput } from "../accountAddress";
|
|
4
|
+
import { AnyPublicKey, AnySignature, Ed25519PrivateKey, PrivateKey, Secp256k1PrivateKey } from "../crypto";
|
|
5
5
|
import type { Account } from "./Account";
|
|
6
|
-
import { generateSigningMessageForTransaction } from "../transactions/transactionBuilder/signingMessage";
|
|
7
|
-
import { AnyRawTransaction } from "../transactions/types";
|
|
8
6
|
|
|
9
7
|
export interface SingleKeySignerConstructorArgs {
|
|
10
8
|
privateKey: PrivateKey;
|
|
@@ -108,17 +106,14 @@ export class SingleKeyAccount implements Account {
|
|
|
108
106
|
return this.publicKey.verifySignature(args);
|
|
109
107
|
}
|
|
110
108
|
|
|
111
|
-
signWithAuthenticator(
|
|
112
|
-
const
|
|
109
|
+
signWithAuthenticator(message: HexInput) {
|
|
110
|
+
const innerSignature = this.privateKey.sign(message);
|
|
111
|
+
const signature = new AnySignature(innerSignature);
|
|
113
112
|
return new AccountAuthenticatorSingleKey(this.publicKey, signature);
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
sign(message: HexInput) {
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
signTransaction(transaction: AnyRawTransaction) {
|
|
121
|
-
return this.sign(generateSigningMessageForTransaction(transaction));
|
|
116
|
+
return this.signWithAuthenticator(message).signature;
|
|
122
117
|
}
|
|
123
118
|
|
|
124
119
|
// endregion
|
|
@@ -7,7 +7,7 @@ import { Serializable, Serializer } from "../../bcs/serializer";
|
|
|
7
7
|
import { AuthenticationKey } from "../authenticationKey";
|
|
8
8
|
import { Hex } from "../hex";
|
|
9
9
|
import { HexInput, SigningScheme as AuthenticationKeyScheme } from "../../types";
|
|
10
|
-
import {
|
|
10
|
+
import { CKDPriv, deriveKey, HARDENED_OFFSET, isValidHardenedPath, mnemonicToSeed, splitPath } from "./hdKey";
|
|
11
11
|
import { PrivateKey } from "./privateKey";
|
|
12
12
|
import { AccountPublicKey, VerifySignatureArgs } from "./publicKey";
|
|
13
13
|
import { Signature } from "./signature";
|
|
@@ -185,9 +185,29 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
|
|
|
185
185
|
if (!isValidHardenedPath(path)) {
|
|
186
186
|
throw new Error(`Invalid derivation path ${path}`);
|
|
187
187
|
}
|
|
188
|
-
return
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
return Ed25519PrivateKey.fromDerivationPathInner(path, mnemonicToSeed(mnemonics));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* A private inner function so we can separate from the main fromDerivationPath() method
|
|
193
|
+
* to add tests to verify we create the keys correctly.
|
|
194
|
+
*
|
|
195
|
+
* @param path the BIP44 path
|
|
196
|
+
* @param seed the seed phrase created by the mnemonics
|
|
197
|
+
* @param offset the offset used for key derivation, defaults to 0x80000000
|
|
198
|
+
* @returns
|
|
199
|
+
*/
|
|
200
|
+
private static fromDerivationPathInner(path: string, seed: Uint8Array, offset = HARDENED_OFFSET): Ed25519PrivateKey {
|
|
201
|
+
const { key, chainCode } = deriveKey(Ed25519PrivateKey.SLIP_0010_SEED, seed);
|
|
202
|
+
|
|
203
|
+
const segments = splitPath(path).map((el) => parseInt(el, 10));
|
|
204
|
+
|
|
205
|
+
// Derive the child key based on the path
|
|
206
|
+
const { key: privateKey } = segments.reduce((parentKeys, segment) => CKDPriv(parentKeys, segment + offset), {
|
|
207
|
+
key,
|
|
208
|
+
chainCode,
|
|
209
|
+
});
|
|
210
|
+
return new Ed25519PrivateKey(privateKey);
|
|
191
211
|
}
|
|
192
212
|
|
|
193
213
|
// endregion
|
package/src/core/crypto/hdKey.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { hmac } from "@noble/hashes/hmac";
|
|
5
5
|
import { sha512 } from "@noble/hashes/sha512";
|
|
6
6
|
import * as bip39 from "@scure/bip39";
|
|
7
|
-
import { HexInput } from "../../types";
|
|
8
7
|
|
|
9
8
|
export type DerivedKeys = {
|
|
10
9
|
key: Uint8Array;
|
|
@@ -16,7 +15,6 @@ export type DerivedKeys = {
|
|
|
16
15
|
*/
|
|
17
16
|
export const APTOS_HARDENED_REGEX = /^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/;
|
|
18
17
|
export const APTOS_BIP44_REGEX = /^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/;
|
|
19
|
-
export const APTOS_BIP44_DEFAULT_DERIVATION_PATH = "m/44'/637'/0'/0'/0'";
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
20
|
* A list of supported key types and associated seeds
|
|
@@ -93,35 +91,6 @@ const removeApostrophes = (val: string): string => val.replace("'", "");
|
|
|
93
91
|
*/
|
|
94
92
|
export const splitPath = (path: string): Array<string> => path.split("/").slice(1).map(removeApostrophes);
|
|
95
93
|
|
|
96
|
-
/**
|
|
97
|
-
* @param path the BIP44 path
|
|
98
|
-
* @param seed the seed phrase created by the mnemonics
|
|
99
|
-
* @param offset the offset used for key derivation, defaults to 0x80000000
|
|
100
|
-
* @returns
|
|
101
|
-
*/
|
|
102
|
-
export function fromDerivationPath(
|
|
103
|
-
path: string,
|
|
104
|
-
hashSeed: HexInput,
|
|
105
|
-
seed: Uint8Array,
|
|
106
|
-
offset = HARDENED_OFFSET,
|
|
107
|
-
): Uint8Array {
|
|
108
|
-
if (offset === HARDENED_OFFSET && !isValidHardenedPath(path)) {
|
|
109
|
-
throw new Error(`Invalid hardened derivation path ${path}`);
|
|
110
|
-
} else if (offset !== HARDENED_OFFSET && !isValidBIP44Path(path)) {
|
|
111
|
-
throw new Error(`Invalid derivation path ${path}`);
|
|
112
|
-
}
|
|
113
|
-
const { key, chainCode } = deriveKey(hashSeed, seed);
|
|
114
|
-
|
|
115
|
-
const segments = splitPath(path).map((el) => parseInt(el, 10));
|
|
116
|
-
|
|
117
|
-
// Derive the child key based on the path
|
|
118
|
-
const { key: privateKey } = segments.reduce((parentKeys, segment) => CKDPriv(parentKeys, segment + offset), {
|
|
119
|
-
key,
|
|
120
|
-
chainCode,
|
|
121
|
-
});
|
|
122
|
-
return privateKey;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
94
|
/**
|
|
126
95
|
* Normalizes the mnemonic by removing extra whitespace and making it lowercase
|
|
127
96
|
* @param mnemonic the mnemonic seed phrase
|
package/src/core/crypto/index.ts
CHANGED
|
@@ -5,8 +5,6 @@ export * from "./ed25519";
|
|
|
5
5
|
export * from "./hdKey";
|
|
6
6
|
export * from "./multiEd25519";
|
|
7
7
|
export * from "./multiKey";
|
|
8
|
-
export * from "./ephemeral";
|
|
9
|
-
export * from "./keyless";
|
|
10
8
|
export * from "./privateKey";
|
|
11
9
|
export * from "./publicKey";
|
|
12
10
|
export * from "./secp256k1";
|
|
@@ -139,19 +139,9 @@ export class MultiKey extends AccountPublicKey {
|
|
|
139
139
|
|
|
140
140
|
return bitmap;
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
getIndex(publicKey: PublicKey): number {
|
|
144
|
-
const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);
|
|
145
|
-
const index = this.publicKeys.findIndex((pk) => pk.toString() === anyPublicKey.toString());
|
|
146
|
-
|
|
147
|
-
if (index !== -1) {
|
|
148
|
-
return index;
|
|
149
|
-
}
|
|
150
|
-
throw new Error("Public key not found in MultiKey");
|
|
151
|
-
}
|
|
152
142
|
}
|
|
153
143
|
|
|
154
|
-
export class
|
|
144
|
+
export class MultiKeySignature extends Signature {
|
|
155
145
|
/**
|
|
156
146
|
* Number of bytes in the bitmap representing who signed the transaction (32-bits)
|
|
157
147
|
*/
|
|
@@ -160,7 +150,7 @@ export class MultiSignature extends Signature {
|
|
|
160
150
|
/**
|
|
161
151
|
* Maximum number of Ed25519 signatures supported
|
|
162
152
|
*/
|
|
163
|
-
static MAX_SIGNATURES_SUPPORTED =
|
|
153
|
+
static MAX_SIGNATURES_SUPPORTED = MultiKeySignature.BITMAP_LEN * 8;
|
|
164
154
|
|
|
165
155
|
/**
|
|
166
156
|
* The list of underlying Ed25519 signatures
|
|
@@ -188,8 +178,8 @@ export class MultiSignature extends Signature {
|
|
|
188
178
|
super();
|
|
189
179
|
const { signatures, bitmap } = args;
|
|
190
180
|
|
|
191
|
-
if (signatures.length >
|
|
192
|
-
throw new Error(`The number of signatures cannot be greater than ${
|
|
181
|
+
if (signatures.length > MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {
|
|
182
|
+
throw new Error(`The number of signatures cannot be greater than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED}`);
|
|
193
183
|
}
|
|
194
184
|
|
|
195
185
|
// Make sure that all signatures are normalized to the SingleKey authentication scheme
|
|
@@ -198,9 +188,9 @@ export class MultiSignature extends Signature {
|
|
|
198
188
|
);
|
|
199
189
|
|
|
200
190
|
if (!(bitmap instanceof Uint8Array)) {
|
|
201
|
-
this.bitmap =
|
|
202
|
-
} else if (bitmap.length !==
|
|
203
|
-
throw new Error(`"bitmap" length should be ${
|
|
191
|
+
this.bitmap = MultiKeySignature.createBitmap({ bits: bitmap });
|
|
192
|
+
} else if (bitmap.length !== MultiKeySignature.BITMAP_LEN) {
|
|
193
|
+
throw new Error(`"bitmap" length should be ${MultiKeySignature.BITMAP_LEN}`);
|
|
204
194
|
} else {
|
|
205
195
|
this.bitmap = bitmap;
|
|
206
196
|
}
|
|
@@ -236,8 +226,8 @@ export class MultiSignature extends Signature {
|
|
|
236
226
|
const dupCheckSet = new Set();
|
|
237
227
|
|
|
238
228
|
bits.forEach((bit: number) => {
|
|
239
|
-
if (bit >=
|
|
240
|
-
throw new Error(`Cannot have a signature larger than ${
|
|
229
|
+
if (bit >= MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {
|
|
230
|
+
throw new Error(`Cannot have a signature larger than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED - 1}.`);
|
|
241
231
|
}
|
|
242
232
|
|
|
243
233
|
if (dupCheckSet.has(bit)) {
|
|
@@ -275,7 +265,7 @@ export class MultiSignature extends Signature {
|
|
|
275
265
|
serializer.serializeBytes(this.bitmap);
|
|
276
266
|
}
|
|
277
267
|
|
|
278
|
-
static deserialize(deserializer: Deserializer):
|
|
268
|
+
static deserialize(deserializer: Deserializer): MultiKeySignature {
|
|
279
269
|
const bitmap = deserializer.deserializeBytes();
|
|
280
270
|
const nSignatures = bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);
|
|
281
271
|
const signatures: AnySignature[] = [];
|
|
@@ -283,7 +273,7 @@ export class MultiSignature extends Signature {
|
|
|
283
273
|
const signature = AnySignature.deserialize(deserializer);
|
|
284
274
|
signatures.push(signature);
|
|
285
275
|
}
|
|
286
|
-
return new
|
|
276
|
+
return new MultiKeySignature({ signatures, bitmap });
|
|
287
277
|
}
|
|
288
278
|
|
|
289
279
|
// endregion
|
|
@@ -4,7 +4,6 @@ import { AuthenticationKey } from "../authenticationKey";
|
|
|
4
4
|
import { Ed25519PublicKey, Ed25519Signature } from "./ed25519";
|
|
5
5
|
import { AccountPublicKey, PublicKey, VerifySignatureArgs } from "./publicKey";
|
|
6
6
|
import { Secp256k1PublicKey, Secp256k1Signature } from "./secp256k1";
|
|
7
|
-
import { KeylessPublicKey, KeylessSignature } from "./keyless";
|
|
8
7
|
import { Signature } from "./signature";
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -35,8 +34,6 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
35
34
|
this.variant = AnyPublicKeyVariant.Ed25519;
|
|
36
35
|
} else if (publicKey instanceof Secp256k1PublicKey) {
|
|
37
36
|
this.variant = AnyPublicKeyVariant.Secp256k1;
|
|
38
|
-
} else if (publicKey instanceof KeylessPublicKey) {
|
|
39
|
-
this.variant = AnyPublicKeyVariant.Keyless;
|
|
40
37
|
} else {
|
|
41
38
|
throw new Error("Unsupported public key type");
|
|
42
39
|
}
|
|
@@ -88,9 +85,6 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
88
85
|
case AnyPublicKeyVariant.Secp256k1:
|
|
89
86
|
publicKey = Secp256k1PublicKey.deserialize(deserializer);
|
|
90
87
|
break;
|
|
91
|
-
case AnyPublicKeyVariant.Keyless:
|
|
92
|
-
publicKey = KeylessPublicKey.deserialize(deserializer);
|
|
93
|
-
break;
|
|
94
88
|
default:
|
|
95
89
|
throw new Error(`Unknown variant index for AnyPublicKey: ${variantIndex}`);
|
|
96
90
|
}
|
|
@@ -144,8 +138,6 @@ export class AnySignature extends Signature {
|
|
|
144
138
|
this.variant = AnySignatureVariant.Ed25519;
|
|
145
139
|
} else if (signature instanceof Secp256k1Signature) {
|
|
146
140
|
this.variant = AnySignatureVariant.Secp256k1;
|
|
147
|
-
} else if (signature instanceof KeylessSignature) {
|
|
148
|
-
this.variant = AnySignatureVariant.Keyless;
|
|
149
141
|
} else {
|
|
150
142
|
throw new Error("Unsupported signature type");
|
|
151
143
|
}
|
|
@@ -178,9 +170,6 @@ export class AnySignature extends Signature {
|
|
|
178
170
|
case AnySignatureVariant.Secp256k1:
|
|
179
171
|
signature = Secp256k1Signature.deserialize(deserializer);
|
|
180
172
|
break;
|
|
181
|
-
case AnySignatureVariant.Keyless:
|
|
182
|
-
signature = KeylessSignature.deserialize(deserializer);
|
|
183
|
-
break;
|
|
184
173
|
default:
|
|
185
174
|
throw new Error(`Unknown variant index for AnySignature: ${variantIndex}`);
|
|
186
175
|
}
|
package/src/core/index.ts
CHANGED
package/src/index.ts
CHANGED
package/src/internal/account.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
12
|
import { AptosApiError, getAptosFullNode, paginateWithCursor } from "../client";
|
|
13
13
|
import { AccountAddress, AccountAddressInput } from "../core/accountAddress";
|
|
14
|
-
import { Account } from "../account";
|
|
14
|
+
import { Account } from "../core/account";
|
|
15
15
|
import { AnyPublicKey, Ed25519PublicKey, PrivateKey } from "../core/crypto";
|
|
16
16
|
import { getTableItem, queryIndexer } from "./general";
|
|
17
17
|
import {
|
package/src/internal/ans.ts
CHANGED
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
|
-
import { Account } from "../
|
|
13
|
-
import { AccountAddress, AccountAddressInput } from "../core";
|
|
12
|
+
import { Account, AccountAddress, AccountAddressInput } from "../core";
|
|
14
13
|
import { InputGenerateTransactionOptions } from "../transactions/types";
|
|
15
14
|
import { GetANSNameResponse, MoveAddressType, OrderByArg, PaginationArgs, WhereArg } from "../types";
|
|
16
15
|
import { GetNamesQuery } from "../types/generated/operations";
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
12
|
import { Bool, MoveString, MoveVector, U64 } from "../bcs";
|
|
13
|
-
import { AccountAddress, AccountAddressInput } from "../core";
|
|
14
|
-
import { Account } from "../account";
|
|
13
|
+
import { Account, AccountAddress, AccountAddressInput } from "../core";
|
|
15
14
|
import { EntryFunctionABI, InputGenerateTransactionOptions } from "../transactions/types";
|
|
16
15
|
import {
|
|
17
16
|
AnyNumber,
|
|
@@ -33,8 +33,7 @@ import {
|
|
|
33
33
|
FungibleAssetActivitiesBoolExp,
|
|
34
34
|
FungibleAssetMetadataBoolExp,
|
|
35
35
|
} from "../types/generated/types";
|
|
36
|
-
import { AccountAddressInput } from "../core";
|
|
37
|
-
import { Account } from "../account";
|
|
36
|
+
import { Account, AccountAddressInput } from "../core";
|
|
38
37
|
import {
|
|
39
38
|
EntryFunctionABI,
|
|
40
39
|
InputGenerateTransactionOptions,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { AptosConfig } from "../api/aptosConfig";
|
|
9
9
|
import { MoveVector, U8 } from "../bcs";
|
|
10
10
|
import { postAptosFullNode } from "../client";
|
|
11
|
-
import { Account
|
|
11
|
+
import { Account } from "../core/account";
|
|
12
12
|
import { AccountAddress, AccountAddressInput } from "../core/accountAddress";
|
|
13
13
|
import { PrivateKey } from "../core/crypto";
|
|
14
14
|
import { AccountAuthenticator } from "../transactions/authenticator/account";
|
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
generateTransactionPayload,
|
|
19
19
|
generateSignedTransactionForSimulation,
|
|
20
20
|
generateSignedTransaction,
|
|
21
|
+
sign,
|
|
22
|
+
generateSigningMessage,
|
|
21
23
|
} from "../transactions/transactionBuilder/transactionBuilder";
|
|
22
24
|
import {
|
|
23
25
|
InputGenerateTransactionData,
|
|
@@ -33,7 +35,7 @@ import {
|
|
|
33
35
|
} from "../transactions/types";
|
|
34
36
|
import { getInfo } from "./account";
|
|
35
37
|
import { UserTransactionResponse, PendingTransactionResponse, MimeType, HexInput, TransactionResponse } from "../types";
|
|
36
|
-
import { TypeTagU8, TypeTagVector
|
|
38
|
+
import { TypeTagU8, TypeTagVector } from "../transactions";
|
|
37
39
|
import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
|
|
38
40
|
import { MultiAgentTransaction } from "../transactions/instances/multiAgentTransaction";
|
|
39
41
|
|
|
@@ -183,7 +185,7 @@ function isMultiAgentTransactionInput(
|
|
|
183
185
|
*/
|
|
184
186
|
export function getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {
|
|
185
187
|
const { transaction } = args;
|
|
186
|
-
return
|
|
188
|
+
return generateSigningMessage(transaction);
|
|
187
189
|
}
|
|
188
190
|
|
|
189
191
|
/**
|
|
@@ -202,8 +204,8 @@ export function getSigningMessage(args: { transaction: AnyRawTransaction }): Uin
|
|
|
202
204
|
* @return The signer AccountAuthenticator
|
|
203
205
|
*/
|
|
204
206
|
export function signTransaction(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
|
|
205
|
-
const {
|
|
206
|
-
return
|
|
207
|
+
const accountAuthenticator = sign({ ...args });
|
|
208
|
+
return accountAuthenticator;
|
|
207
209
|
}
|
|
208
210
|
|
|
209
211
|
/**
|
|
@@ -275,9 +277,6 @@ export async function signAndSubmitTransaction(args: {
|
|
|
275
277
|
transaction: AnyRawTransaction;
|
|
276
278
|
}): Promise<PendingTransactionResponse> {
|
|
277
279
|
const { aptosConfig, signer, transaction } = args;
|
|
278
|
-
if (signer instanceof KeylessAccount || signer instanceof MultiKeyAccount) {
|
|
279
|
-
await signer.waitForProofFetch();
|
|
280
|
-
}
|
|
281
280
|
const authenticator = signTransaction({ signer, transaction });
|
|
282
281
|
return submitTransaction({
|
|
283
282
|
aptosConfig,
|
|
@@ -7,7 +7,7 @@ import { Serializer, Deserializer, Serializable } from "../../bcs";
|
|
|
7
7
|
import { AnyPublicKey, AnySignature } from "../../core/crypto";
|
|
8
8
|
import { Ed25519PublicKey, Ed25519Signature } from "../../core/crypto/ed25519";
|
|
9
9
|
import { MultiEd25519PublicKey, MultiEd25519Signature } from "../../core/crypto/multiEd25519";
|
|
10
|
-
import { MultiKey
|
|
10
|
+
import { MultiKey } from "../../core/crypto/multiKey";
|
|
11
11
|
import { AccountAuthenticatorVariant } from "../../types";
|
|
12
12
|
|
|
13
13
|
export abstract class AccountAuthenticator extends Serializable {
|
|
@@ -149,23 +149,28 @@ export class AccountAuthenticatorSingleKey extends AccountAuthenticator {
|
|
|
149
149
|
export class AccountAuthenticatorMultiKey extends AccountAuthenticator {
|
|
150
150
|
public readonly public_keys: MultiKey;
|
|
151
151
|
|
|
152
|
-
public readonly signatures:
|
|
152
|
+
public readonly signatures: Array<AnySignature>;
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
public readonly signatures_bitmap: Uint8Array;
|
|
155
|
+
|
|
156
|
+
constructor(public_keys: MultiKey, signatures: Array<AnySignature>, signatures_bitmap: Uint8Array) {
|
|
155
157
|
super();
|
|
156
158
|
this.public_keys = public_keys;
|
|
157
159
|
this.signatures = signatures;
|
|
160
|
+
this.signatures_bitmap = signatures_bitmap;
|
|
158
161
|
}
|
|
159
162
|
|
|
160
163
|
serialize(serializer: Serializer): void {
|
|
161
164
|
serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiKey);
|
|
162
165
|
this.public_keys.serialize(serializer);
|
|
163
|
-
this.signatures
|
|
166
|
+
serializer.serializeVector<AnySignature>(this.signatures);
|
|
167
|
+
serializer.serializeBytes(this.signatures_bitmap);
|
|
164
168
|
}
|
|
165
169
|
|
|
166
170
|
static load(deserializer: Deserializer): AccountAuthenticatorMultiKey {
|
|
167
171
|
const public_keys = MultiKey.deserialize(deserializer);
|
|
168
|
-
const signatures =
|
|
169
|
-
|
|
172
|
+
const signatures = deserializer.deserializeVector(AnySignature);
|
|
173
|
+
const signatures_bitmap = deserializer.deserializeBytes();
|
|
174
|
+
return new AccountAuthenticatorMultiKey(public_keys, signatures, signatures_bitmap);
|
|
170
175
|
}
|
|
171
176
|
}
|