@aptos-labs/ts-sdk 1.13.0-zeta.1 → 1.13.1-zeta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/index.d.ts +25 -27
- package/dist/common/index.js +14 -14
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-hkKk3b4Z.d.mts → Ed25519Account-8gJF5t3F.d.mts} +2 -2
- package/dist/esm/account/Account.d.mts +1 -1
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +1 -1
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +9 -7
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +8 -6
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +1 -1
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +6 -6
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +1 -1
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/api/account.d.mts +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +13 -13
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +1 -2
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +9 -9
- 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 +13 -13
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +1 -2
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +10 -18
- package/dist/esm/api/keyless.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.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +1 -1
- 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/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/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/{chunk-OAOJVE5X.mjs → chunk-2OTMSEHI.mjs} +2 -2
- package/dist/esm/chunk-3OA7CG6N.mjs +2 -0
- package/dist/esm/chunk-3OA7CG6N.mjs.map +1 -0
- package/dist/esm/chunk-4QMXOWHP.mjs +1 -0
- package/dist/esm/chunk-4QMXOWHP.mjs.map +1 -0
- package/dist/esm/{chunk-CHL5NDZD.mjs → chunk-534GCQ37.mjs} +2 -2
- package/dist/esm/{chunk-KMHJNUXU.mjs → chunk-6DA64TSG.mjs} +2 -2
- package/dist/esm/{chunk-XESYWLDD.mjs → chunk-6YDD6LGX.mjs} +2 -2
- package/dist/esm/{chunk-XESYWLDD.mjs.map → chunk-6YDD6LGX.mjs.map} +1 -1
- package/dist/esm/{chunk-ULUMROUJ.mjs → chunk-7YMBWSKN.mjs} +2 -2
- package/dist/esm/{chunk-ULUMROUJ.mjs.map → chunk-7YMBWSKN.mjs.map} +1 -1
- package/dist/esm/{chunk-ZUDMSBVZ.mjs → chunk-AE7X4LVG.mjs} +2 -2
- package/dist/esm/chunk-AE7X4LVG.mjs.map +1 -0
- package/dist/esm/{chunk-ODA4KV4Q.mjs → chunk-ASRAJ24P.mjs} +2 -2
- package/dist/esm/{chunk-Q6CZDSLM.mjs → chunk-BIU5KNPT.mjs} +2 -2
- package/dist/esm/{chunk-4AOGG725.mjs → chunk-C2HDZYYQ.mjs} +2 -2
- package/dist/esm/chunk-CFJEOZMV.mjs +2 -0
- package/dist/esm/{chunk-LVYKZS54.mjs.map → chunk-CFJEOZMV.mjs.map} +1 -1
- package/dist/esm/chunk-COLCWAPL.mjs +2 -0
- package/dist/esm/chunk-COLCWAPL.mjs.map +1 -0
- package/dist/esm/{chunk-KWDJ4YOP.mjs → chunk-CW7JVCSV.mjs} +2 -2
- package/dist/esm/{chunk-KWDJ4YOP.mjs.map → chunk-CW7JVCSV.mjs.map} +1 -1
- package/dist/esm/chunk-D2DIZHP3.mjs +2 -0
- package/dist/esm/chunk-D2DIZHP3.mjs.map +1 -0
- package/dist/esm/{chunk-J5SQQQPI.mjs → chunk-EGTGR3R4.mjs} +2 -2
- package/dist/esm/{chunk-YNBWXDRS.mjs → chunk-FB6T6ZQP.mjs} +2 -2
- package/dist/esm/{chunk-XJFGX3E4.mjs → chunk-G4QU37E6.mjs} +2 -2
- package/dist/esm/chunk-G4QU37E6.mjs.map +1 -0
- package/dist/esm/{chunk-2I2XAOH7.mjs → chunk-GVZZTEYV.mjs} +2 -2
- package/dist/esm/{chunk-T3QZ5HSE.mjs → chunk-HZFOKUQZ.mjs} +2 -2
- package/dist/esm/{chunk-T3QZ5HSE.mjs.map → chunk-HZFOKUQZ.mjs.map} +1 -1
- package/dist/esm/{chunk-NU6UF6RM.mjs → chunk-I657KZIO.mjs} +2 -2
- package/dist/esm/{chunk-EMFDNUP2.mjs → chunk-IO2NZ5PR.mjs} +2 -2
- package/dist/esm/{chunk-TR6Q7RSZ.mjs → chunk-JP6UNRLO.mjs} +2 -2
- package/dist/esm/{chunk-BQCIUNLZ.mjs → chunk-KFKE46CF.mjs} +2 -2
- package/dist/esm/{chunk-R25D6NBC.mjs → chunk-LB4KMZNQ.mjs} +2 -2
- package/dist/esm/{chunk-R25D6NBC.mjs.map → chunk-LB4KMZNQ.mjs.map} +1 -1
- package/dist/esm/{chunk-NJWTXEHT.mjs → chunk-M3VGAYMW.mjs} +2 -2
- package/dist/esm/{chunk-NJWTXEHT.mjs.map → chunk-M3VGAYMW.mjs.map} +1 -1
- package/dist/esm/{chunk-KBSAS57Q.mjs → chunk-MUEDPI2Z.mjs} +2 -2
- package/dist/esm/{chunk-RXMGJBCP.mjs → chunk-N35ARFH3.mjs} +2 -2
- package/dist/esm/{chunk-HTO4EQNT.mjs → chunk-ND5A52N4.mjs} +2 -2
- package/dist/esm/{chunk-HTO4EQNT.mjs.map → chunk-ND5A52N4.mjs.map} +1 -1
- package/dist/esm/{chunk-ZGWWPB3D.mjs → chunk-NKSAU5OX.mjs} +2 -2
- package/dist/esm/{chunk-2FKQJL3H.mjs → chunk-NMYQ2LMC.mjs} +2 -2
- package/dist/esm/{chunk-2FKQJL3H.mjs.map → chunk-NMYQ2LMC.mjs.map} +1 -1
- package/dist/esm/chunk-OF256KD5.mjs +2 -0
- package/dist/esm/chunk-OF256KD5.mjs.map +1 -0
- package/dist/esm/{chunk-ACOL3VVP.mjs → chunk-OKRUEVF3.mjs} +1 -1
- package/dist/esm/chunk-OKRUEVF3.mjs.map +1 -0
- package/dist/esm/{chunk-YP3RMVL3.mjs → chunk-OQKD5SSG.mjs} +2 -2
- package/dist/esm/chunk-ORMDVSRG.mjs +2 -0
- package/dist/esm/chunk-ORMDVSRG.mjs.map +1 -0
- package/dist/esm/{chunk-P4UY6YKM.mjs → chunk-P2JP6PSD.mjs} +2 -2
- package/dist/esm/{chunk-7M3U2I23.mjs → chunk-PCLBZIT4.mjs} +2 -2
- package/dist/esm/chunk-PSTPEDI3.mjs +2 -0
- package/dist/esm/{chunk-WF737YNO.mjs.map → chunk-PSTPEDI3.mjs.map} +1 -1
- package/dist/esm/{chunk-VJCQBX6V.mjs → chunk-QBWI223M.mjs} +2 -2
- package/dist/esm/{chunk-XJ3HRNOP.mjs → chunk-QEKSGA7S.mjs} +2 -2
- package/dist/esm/chunk-QEKSGA7S.mjs.map +1 -0
- package/dist/esm/{chunk-2VCKY2ZJ.mjs → chunk-QFK75K2K.mjs} +2 -2
- package/dist/esm/chunk-S5YUB2BI.mjs +2 -0
- package/dist/esm/chunk-S5YUB2BI.mjs.map +1 -0
- package/dist/esm/{chunk-YIG37BG2.mjs → chunk-SC7NXRMV.mjs} +2 -2
- package/dist/esm/chunk-SQNDWIVJ.mjs +2 -0
- package/dist/esm/chunk-SQNDWIVJ.mjs.map +1 -0
- package/dist/esm/{chunk-VAZQVN5V.mjs → chunk-TCMSBGBS.mjs} +1 -1
- package/dist/esm/chunk-TCMSBGBS.mjs.map +1 -0
- package/dist/esm/chunk-UAFAZSOH.mjs +2 -0
- package/dist/esm/chunk-UAFAZSOH.mjs.map +1 -0
- package/dist/esm/{chunk-OVXWFD2N.mjs → chunk-UMFYNNCG.mjs} +2 -2
- package/dist/esm/{chunk-OVXWFD2N.mjs.map → chunk-UMFYNNCG.mjs.map} +1 -1
- package/dist/esm/{chunk-2Z4N3GLA.mjs → chunk-VG2J3UTS.mjs} +2 -2
- package/dist/esm/{chunk-2Z4N3GLA.mjs.map → chunk-VG2J3UTS.mjs.map} +1 -1
- package/dist/esm/{chunk-TT2VLL52.mjs → chunk-VSPQRNEG.mjs} +2 -2
- package/dist/esm/chunk-VSPQRNEG.mjs.map +1 -0
- package/dist/esm/{chunk-ZG6HOK6A.mjs → chunk-VSWIMQAB.mjs} +2 -2
- package/dist/esm/{chunk-ZG6HOK6A.mjs.map → chunk-VSWIMQAB.mjs.map} +1 -1
- package/dist/esm/{chunk-EY3FIYMV.mjs → chunk-W2MKEIHI.mjs} +2 -2
- package/dist/esm/{chunk-CYWA4AJF.mjs → chunk-WAWBXQ6B.mjs} +2 -2
- package/dist/esm/{chunk-2QGT5DK3.mjs → chunk-WR5L4STD.mjs} +2 -2
- package/dist/esm/{chunk-SCPXFKEK.mjs → chunk-Y4VKIX2V.mjs} +2 -2
- package/dist/esm/{chunk-SCPXFKEK.mjs.map → chunk-Y4VKIX2V.mjs.map} +1 -1
- package/dist/esm/{chunk-V7VV5QW4.mjs → chunk-Y5DMKMLF.mjs} +2 -2
- package/dist/esm/chunk-YE5B2S5L.mjs +2 -0
- package/dist/esm/{chunk-2HXKDHMA.mjs.map → chunk-YE5B2S5L.mjs.map} +1 -1
- package/dist/esm/{chunk-5D65Z2SG.mjs → chunk-YGWIVUJP.mjs} +2 -2
- package/dist/esm/{chunk-MKHPGY3O.mjs → chunk-YIIDPNGQ.mjs} +2 -2
- package/dist/esm/{chunk-U426PZNM.mjs → chunk-YMVFNEBO.mjs} +2 -2
- 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/index.d.mts +12 -0
- package/dist/esm/core/account/index.mjs +2 -0
- package/dist/esm/core/account/index.mjs.map +1 -0
- 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.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +2 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +2 -2
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- 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.mjs +1 -1
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +3 -3
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +9 -9
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +13 -13
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +2 -4
- package/dist/esm/internal/keyless.mjs +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.mjs +1 -1
- 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.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs +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.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +1 -1
- 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.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- 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/types/index.mjs +1 -1
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.d.mts +2 -2
- package/dist/esm/utils/const.mjs +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/account/Ed25519Account.ts +1 -1
- package/src/account/EphemeralKeyPair.ts +39 -10
- package/src/account/KeylessAccount.ts +38 -18
- package/src/account/MultiKeyAccount.ts +1 -3
- package/src/account/SingleKeyAccount.ts +3 -4
- package/src/api/account.ts +1 -1
- package/src/api/ans.ts +1 -1
- package/src/api/aptosConfig.ts +1 -1
- package/src/api/digitalAsset.ts +1 -1
- package/src/api/fungibleAsset.ts +1 -1
- package/src/api/keyless.ts +3 -22
- package/src/api/transaction.ts +1 -1
- package/src/client/post.ts +1 -2
- package/src/core/account/index.ts +2 -0
- package/src/core/crypto/ed25519.ts +4 -6
- package/src/core/crypto/ephemeral.ts +4 -2
- package/src/core/crypto/keyless.ts +9 -3
- package/src/core/crypto/multiKey.ts +3 -5
- package/src/core/crypto/singleKey.ts +3 -3
- package/src/internal/ans.ts +1 -1
- package/src/internal/digitalAsset.ts +1 -1
- package/src/internal/fungibleAsset.ts +1 -1
- package/src/internal/keyless.ts +3 -19
- package/src/internal/transactionSubmission.ts +3 -1
- package/src/transactions/transactionBuilder/index.ts +0 -1
- package/src/transactions/transactionBuilder/signingMessage.ts +13 -18
- package/src/transactions/transactionBuilder/transactionBuilder.ts +48 -37
- package/src/types/index.ts +0 -1
- package/src/utils/apiEndpoints.ts +1 -0
- package/src/utils/const.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/esm/chunk-2HXKDHMA.mjs +0 -2
- package/dist/esm/chunk-2MPLQPZT.mjs +0 -2
- package/dist/esm/chunk-2MPLQPZT.mjs.map +0 -1
- package/dist/esm/chunk-3J2Q7O57.mjs +0 -2
- package/dist/esm/chunk-3J2Q7O57.mjs.map +0 -1
- package/dist/esm/chunk-6OKRMOWR.mjs +0 -2
- package/dist/esm/chunk-6OKRMOWR.mjs.map +0 -1
- package/dist/esm/chunk-ACOL3VVP.mjs.map +0 -1
- package/dist/esm/chunk-ATXQWKVH.mjs +0 -2
- package/dist/esm/chunk-ATXQWKVH.mjs.map +0 -1
- package/dist/esm/chunk-LVYKZS54.mjs +0 -2
- package/dist/esm/chunk-MAFSWKAF.mjs +0 -2
- package/dist/esm/chunk-MAFSWKAF.mjs.map +0 -1
- package/dist/esm/chunk-MX3YIOU5.mjs +0 -2
- package/dist/esm/chunk-MX3YIOU5.mjs.map +0 -1
- package/dist/esm/chunk-TT2VLL52.mjs.map +0 -1
- package/dist/esm/chunk-VAZQVN5V.mjs.map +0 -1
- package/dist/esm/chunk-WF737YNO.mjs +0 -2
- package/dist/esm/chunk-XJ3HRNOP.mjs.map +0 -1
- package/dist/esm/chunk-XJFGX3E4.mjs.map +0 -1
- package/dist/esm/chunk-YPBHGSXY.mjs +0 -2
- package/dist/esm/chunk-YPBHGSXY.mjs.map +0 -1
- package/dist/esm/chunk-YU7DNMEA.mjs +0 -2
- package/dist/esm/chunk-YU7DNMEA.mjs.map +0 -1
- package/dist/esm/chunk-ZUDMSBVZ.mjs.map +0 -1
- /package/dist/esm/{chunk-OAOJVE5X.mjs.map → chunk-2OTMSEHI.mjs.map} +0 -0
- /package/dist/esm/{chunk-CHL5NDZD.mjs.map → chunk-534GCQ37.mjs.map} +0 -0
- /package/dist/esm/{chunk-KMHJNUXU.mjs.map → chunk-6DA64TSG.mjs.map} +0 -0
- /package/dist/esm/{chunk-ODA4KV4Q.mjs.map → chunk-ASRAJ24P.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q6CZDSLM.mjs.map → chunk-BIU5KNPT.mjs.map} +0 -0
- /package/dist/esm/{chunk-4AOGG725.mjs.map → chunk-C2HDZYYQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-J5SQQQPI.mjs.map → chunk-EGTGR3R4.mjs.map} +0 -0
- /package/dist/esm/{chunk-YNBWXDRS.mjs.map → chunk-FB6T6ZQP.mjs.map} +0 -0
- /package/dist/esm/{chunk-2I2XAOH7.mjs.map → chunk-GVZZTEYV.mjs.map} +0 -0
- /package/dist/esm/{chunk-NU6UF6RM.mjs.map → chunk-I657KZIO.mjs.map} +0 -0
- /package/dist/esm/{chunk-EMFDNUP2.mjs.map → chunk-IO2NZ5PR.mjs.map} +0 -0
- /package/dist/esm/{chunk-TR6Q7RSZ.mjs.map → chunk-JP6UNRLO.mjs.map} +0 -0
- /package/dist/esm/{chunk-BQCIUNLZ.mjs.map → chunk-KFKE46CF.mjs.map} +0 -0
- /package/dist/esm/{chunk-KBSAS57Q.mjs.map → chunk-MUEDPI2Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-RXMGJBCP.mjs.map → chunk-N35ARFH3.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZGWWPB3D.mjs.map → chunk-NKSAU5OX.mjs.map} +0 -0
- /package/dist/esm/{chunk-YP3RMVL3.mjs.map → chunk-OQKD5SSG.mjs.map} +0 -0
- /package/dist/esm/{chunk-P4UY6YKM.mjs.map → chunk-P2JP6PSD.mjs.map} +0 -0
- /package/dist/esm/{chunk-7M3U2I23.mjs.map → chunk-PCLBZIT4.mjs.map} +0 -0
- /package/dist/esm/{chunk-VJCQBX6V.mjs.map → chunk-QBWI223M.mjs.map} +0 -0
- /package/dist/esm/{chunk-2VCKY2ZJ.mjs.map → chunk-QFK75K2K.mjs.map} +0 -0
- /package/dist/esm/{chunk-YIG37BG2.mjs.map → chunk-SC7NXRMV.mjs.map} +0 -0
- /package/dist/esm/{chunk-EY3FIYMV.mjs.map → chunk-W2MKEIHI.mjs.map} +0 -0
- /package/dist/esm/{chunk-CYWA4AJF.mjs.map → chunk-WAWBXQ6B.mjs.map} +0 -0
- /package/dist/esm/{chunk-2QGT5DK3.mjs.map → chunk-WR5L4STD.mjs.map} +0 -0
- /package/dist/esm/{chunk-V7VV5QW4.mjs.map → chunk-Y5DMKMLF.mjs.map} +0 -0
- /package/dist/esm/{chunk-5D65Z2SG.mjs.map → chunk-YGWIVUJP.mjs.map} +0 -0
- /package/dist/esm/{chunk-MKHPGY3O.mjs.map → chunk-YIIDPNGQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-U426PZNM.mjs.map → chunk-YMVFNEBO.mjs.map} +0 -0
|
@@ -3,16 +3,22 @@
|
|
|
3
3
|
|
|
4
4
|
import { randomBytes } from "@noble/hashes/utils";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
EPK_HORIZON_SECS,
|
|
8
|
+
Ed25519PrivateKey,
|
|
9
|
+
EphemeralPublicKey,
|
|
10
|
+
EphemeralSignature,
|
|
11
|
+
PrivateKey,
|
|
12
|
+
} from "../core/crypto";
|
|
8
13
|
import { Hex } from "../core/hex";
|
|
9
14
|
import { bytesToBigIntLE, padAndPackBytesWithLen, poseidonHash } from "../core/crypto/poseidon";
|
|
10
|
-
import { HexInput, SigningSchemeInput } from "../types";
|
|
15
|
+
import { EphemeralPublicKeyVariant, HexInput, SigningSchemeInput } from "../types";
|
|
16
|
+
import { Deserializer, Serializable, Serializer } from "../bcs";
|
|
11
17
|
|
|
12
|
-
export class EphemeralKeyPair {
|
|
18
|
+
export class EphemeralKeyPair extends Serializable{
|
|
13
19
|
readonly blinder: Uint8Array;
|
|
14
20
|
|
|
15
|
-
readonly expiryDateSecs: bigint;
|
|
21
|
+
readonly expiryDateSecs: bigint | number;
|
|
16
22
|
|
|
17
23
|
readonly nonce: string;
|
|
18
24
|
|
|
@@ -20,7 +26,8 @@ export class EphemeralKeyPair {
|
|
|
20
26
|
|
|
21
27
|
readonly publicKey: EphemeralPublicKey;
|
|
22
28
|
|
|
23
|
-
constructor(args: { privateKey: PrivateKey; expiryDateSecs?: bigint; blinder?: HexInput }) {
|
|
29
|
+
constructor(args: { privateKey: PrivateKey; expiryDateSecs?: bigint | number; blinder?: HexInput }) {
|
|
30
|
+
super()
|
|
24
31
|
const { privateKey, expiryDateSecs, blinder } = args;
|
|
25
32
|
this.privateKey = privateKey;
|
|
26
33
|
this.publicKey = new EphemeralPublicKey(privateKey.publicKey());
|
|
@@ -29,7 +36,29 @@ export class EphemeralKeyPair {
|
|
|
29
36
|
this.nonce = this.generateNonce();
|
|
30
37
|
}
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
serialize(serializer: Serializer): void {
|
|
40
|
+
serializer.serializeU32AsUleb128(this.publicKey.variant);
|
|
41
|
+
serializer.serializeBytes(this.privateKey.toUint8Array())
|
|
42
|
+
serializer.serializeU64(this.expiryDateSecs)
|
|
43
|
+
serializer.serializeFixedBytes(this.blinder)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static deserialize(deserializer: Deserializer): EphemeralKeyPair {
|
|
47
|
+
const variantIndex = deserializer.deserializeUleb128AsU32();
|
|
48
|
+
let privateKey: PrivateKey;
|
|
49
|
+
switch (variantIndex) {
|
|
50
|
+
case EphemeralPublicKeyVariant.Ed25519:
|
|
51
|
+
privateKey = Ed25519PrivateKey.deserialize(deserializer);
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
throw new Error(`Unknown variant index for EphemeralPublicKey: ${variantIndex}`);
|
|
55
|
+
}
|
|
56
|
+
const expiryDateSecs = deserializer.deserializeU64();
|
|
57
|
+
const blinder = deserializer.deserializeFixedBytes(31);
|
|
58
|
+
return new EphemeralKeyPair({privateKey, expiryDateSecs, blinder});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static generate(args?: { scheme: SigningSchemeInput }): EphemeralKeyPair {
|
|
33
62
|
let privateKey: PrivateKey;
|
|
34
63
|
|
|
35
64
|
switch (args?.scheme) {
|
|
@@ -43,8 +72,8 @@ export class EphemeralKeyPair {
|
|
|
43
72
|
|
|
44
73
|
generateNonce(): string {
|
|
45
74
|
const fields = padAndPackBytesWithLen(this.publicKey.bcsToBytes(), 93);
|
|
46
|
-
fields.push(BigInt(this.expiryDateSecs))
|
|
47
|
-
fields.push(bytesToBigIntLE(this.blinder))
|
|
75
|
+
fields.push(BigInt(this.expiryDateSecs));
|
|
76
|
+
fields.push(bytesToBigIntLE(this.blinder));
|
|
48
77
|
const nonceHash = poseidonHash(fields);
|
|
49
78
|
return nonceHash.toString();
|
|
50
79
|
}
|
|
@@ -65,7 +94,7 @@ function generateBlinder(): Uint8Array {
|
|
|
65
94
|
}
|
|
66
95
|
|
|
67
96
|
function currentTimeInSeconds(): number {
|
|
68
|
-
return Math.floor(new Date().getTime() / 1000)
|
|
97
|
+
return Math.floor(new Date().getTime() / 1000);
|
|
69
98
|
}
|
|
70
99
|
|
|
71
100
|
function floorToWholeHour(timestampInSeconds: number): number {
|
|
@@ -22,7 +22,7 @@ import { Account } from "./Account";
|
|
|
22
22
|
import { EphemeralKeyPair } from "./EphemeralKeyPair";
|
|
23
23
|
import { Hex } from "../core/hex";
|
|
24
24
|
import { AccountAuthenticatorSingleKey } from "../transactions/authenticator/account";
|
|
25
|
-
import { Serializer } from "../bcs";
|
|
25
|
+
import { Deserializer, Serializer } from "../bcs";
|
|
26
26
|
import { deriveTransactionType, generateSigningMessage } from "../transactions/transactionBuilder/signingMessage";
|
|
27
27
|
import { AnyRawTransaction } from "../transactions/types";
|
|
28
28
|
|
|
@@ -44,9 +44,6 @@ export class KeylessAccount implements Account {
|
|
|
44
44
|
|
|
45
45
|
static readonly SLIP_0010_SEED: string = "32 bytes";
|
|
46
46
|
|
|
47
|
-
static readonly APTOS_CONNECT_CLIENT_ID: string =
|
|
48
|
-
"734998116548-ib6ircv72o1b6l0no9ol4spnnkr8gm69.apps.googleusercontent.com";
|
|
49
|
-
|
|
50
47
|
publicKey: KeylessPublicKey;
|
|
51
48
|
|
|
52
49
|
ephemeralKeyPair: EphemeralKeyPair;
|
|
@@ -102,6 +99,41 @@ export class KeylessAccount implements Account {
|
|
|
102
99
|
this.pepper = pepperBytes;
|
|
103
100
|
}
|
|
104
101
|
|
|
102
|
+
async serialize(serializer: Serializer): Promise<void> {
|
|
103
|
+
serializer.serializeStr(this.jwt);
|
|
104
|
+
serializer.serializeStr(this.uidKey);
|
|
105
|
+
serializer.serializeFixedBytes(this.pepper);
|
|
106
|
+
this.ephemeralKeyPair.serialize(serializer);
|
|
107
|
+
const proof = await this.proof;
|
|
108
|
+
proof.serialize(serializer);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
static deserialize(deserializer: Deserializer): KeylessAccount {
|
|
112
|
+
const jwt = deserializer.deserializeStr();
|
|
113
|
+
const uidKey = deserializer.deserializeStr();
|
|
114
|
+
const pepper = deserializer.deserializeFixedBytes(31);
|
|
115
|
+
const ephemeralKeyPair = EphemeralKeyPair.deserialize(deserializer);
|
|
116
|
+
const proof = SignedGroth16Signature.deserialize(deserializer);
|
|
117
|
+
return KeylessAccount.fromJWTAndProof({
|
|
118
|
+
proofFetcherOrData: proof,
|
|
119
|
+
pepper,
|
|
120
|
+
uidKey,
|
|
121
|
+
jwt,
|
|
122
|
+
ephemeralKeyPair,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async bcsToBytes(): Promise<Uint8Array> {
|
|
127
|
+
const serializer = new Serializer();
|
|
128
|
+
await this.serialize(serializer);
|
|
129
|
+
return serializer.toUint8Array();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async bcsToHex(): Promise<Hex> {
|
|
133
|
+
const bcsBytes = await this.bcsToBytes();
|
|
134
|
+
return Hex.fromHexInput(bcsBytes);
|
|
135
|
+
}
|
|
136
|
+
|
|
105
137
|
private async initialize(promise: Promise<SignedGroth16Signature>) {
|
|
106
138
|
try {
|
|
107
139
|
this.proof = await promise;
|
|
@@ -119,7 +151,7 @@ export class KeylessAccount implements Account {
|
|
|
119
151
|
|
|
120
152
|
async waitForProofFetch() {
|
|
121
153
|
if (this.proof instanceof Promise) {
|
|
122
|
-
await this.proof
|
|
154
|
+
await this.proof;
|
|
123
155
|
}
|
|
124
156
|
}
|
|
125
157
|
|
|
@@ -138,7 +170,7 @@ export class KeylessAccount implements Account {
|
|
|
138
170
|
const serializer = new Serializer();
|
|
139
171
|
serializer.serializeFixedBytes(Hex.fromHexInput(data).toUint8Array());
|
|
140
172
|
serializer.serializeOption(this.proof.proof);
|
|
141
|
-
const signMess = generateSigningMessage(serializer.toUint8Array(), "TransactionAndProof");
|
|
173
|
+
const signMess = generateSigningMessage(serializer.toUint8Array(), "APTOS::TransactionAndProof");
|
|
142
174
|
|
|
143
175
|
const ephemeralSignature = this.ephemeralKeyPair.sign(signMess);
|
|
144
176
|
|
|
@@ -178,18 +210,6 @@ export class KeylessAccount implements Account {
|
|
|
178
210
|
});
|
|
179
211
|
}
|
|
180
212
|
|
|
181
|
-
deriveAptosConnectPublicKey(): KeylessPublicKey {
|
|
182
|
-
const { uidKey, uidVal, pepper } = this;
|
|
183
|
-
const { iss } = this.publicKey;
|
|
184
|
-
const addressSeed = computeAddressSeed({
|
|
185
|
-
uidKey,
|
|
186
|
-
uidVal,
|
|
187
|
-
aud: KeylessAccount.APTOS_CONNECT_CLIENT_ID,
|
|
188
|
-
pepper,
|
|
189
|
-
});
|
|
190
|
-
return new KeylessPublicKey(iss, addressSeed);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
213
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this
|
|
194
214
|
verifySignature(args: { message: HexInput; signature: Signature }): boolean {
|
|
195
215
|
return true;
|
|
@@ -78,9 +78,7 @@ export class MultiKeyAccount implements Account {
|
|
|
78
78
|
|
|
79
79
|
async waitForProofFetch() {
|
|
80
80
|
const keylessSigners = this.signers.filter((signer) => signer instanceof KeylessAccount) as KeylessAccount[];
|
|
81
|
-
await Promise.all(
|
|
82
|
-
keylessSigners.filter((signer) => signer.proof instanceof Promise).map( (signer) => signer.proof),
|
|
83
|
-
);
|
|
81
|
+
await Promise.all(keylessSigners.filter((signer) => signer.proof instanceof Promise).map((signer) => signer.proof));
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
/**
|
|
@@ -109,17 +109,16 @@ export class SingleKeyAccount implements Account {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
signWithAuthenticator(transaction: AnyRawTransaction) {
|
|
112
|
-
const
|
|
113
|
-
const signature = new AnySignature(innerSignature);
|
|
112
|
+
const signature = this.sign(generateSigningMessageForTransaction(transaction));
|
|
114
113
|
return new AccountAuthenticatorSingleKey(this.publicKey, signature);
|
|
115
114
|
}
|
|
116
115
|
|
|
117
116
|
sign(message: HexInput) {
|
|
118
|
-
return this.privateKey.sign(message);
|
|
117
|
+
return new AnySignature(this.privateKey.sign(message));
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
signTransaction(transaction: AnyRawTransaction) {
|
|
122
|
-
return this.sign(generateSigningMessageForTransaction(transaction))
|
|
121
|
+
return this.sign(generateSigningMessageForTransaction(transaction));
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
// endregion
|
package/src/api/account.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { Account as AccountModule} from "../account"
|
|
4
|
+
import { Account as AccountModule } from "../account";
|
|
5
5
|
import { AccountAddress, PrivateKey, AccountAddressInput } from "../core";
|
|
6
6
|
import {
|
|
7
7
|
AccountData,
|
package/src/api/ans.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
import { Account } from "../account";
|
|
4
5
|
import { AccountAddress, AccountAddressInput } from "../core";
|
|
5
6
|
import {
|
|
6
7
|
RegisterNameParameters,
|
|
@@ -26,7 +27,6 @@ import { GetANSNameResponse } from "../types";
|
|
|
26
27
|
import { InputGenerateTransactionOptions } from "../transactions/types";
|
|
27
28
|
import { AptosConfig } from "./aptosConfig";
|
|
28
29
|
import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
|
|
29
|
-
import { Account } from "../account";
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* A class to handle all `ANS` operations
|
package/src/api/aptosConfig.ts
CHANGED
package/src/api/digitalAsset.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
TokenStandardArg,
|
|
15
15
|
} from "../types";
|
|
16
16
|
import { AccountAddress, AccountAddressInput } from "../core";
|
|
17
|
+
import { Account } from "../account";
|
|
17
18
|
import { InputGenerateTransactionOptions } from "../transactions/types";
|
|
18
19
|
import {
|
|
19
20
|
addDigitalAssetPropertyTransaction,
|
|
@@ -45,7 +46,6 @@ import {
|
|
|
45
46
|
import { ProcessorType } from "../utils/const";
|
|
46
47
|
import { AptosConfig } from "./aptosConfig";
|
|
47
48
|
import { waitForIndexerOnVersion } from "./utils";
|
|
48
|
-
import { Account } from "../account";
|
|
49
49
|
import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
|
|
50
50
|
|
|
51
51
|
/**
|
package/src/api/fungibleAsset.ts
CHANGED
|
@@ -23,9 +23,9 @@ import {
|
|
|
23
23
|
import { ProcessorType } from "../utils/const";
|
|
24
24
|
import { AptosConfig } from "./aptosConfig";
|
|
25
25
|
import { waitForIndexerOnVersion } from "./utils";
|
|
26
|
+
import { Account } from "../account";
|
|
26
27
|
import { AccountAddressInput } from "../core";
|
|
27
28
|
import { InputGenerateTransactionOptions } from "../transactions";
|
|
28
|
-
import { Account } from "../account";
|
|
29
29
|
import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
|
|
30
30
|
|
|
31
31
|
/**
|
package/src/api/keyless.ts
CHANGED
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { EphemeralKeyPair, KeylessAccount } from "../account";
|
|
5
5
|
import { deriveKeylessAccount, getPepper } from "../internal/keyless";
|
|
6
6
|
import { HexInput } from "../types";
|
|
7
7
|
import { AptosConfig } from "./aptosConfig";
|
|
8
8
|
|
|
9
|
-
interface BaseDeriveKeylessAccountArgs {
|
|
10
|
-
jwt: string;
|
|
11
|
-
ephemeralKeyPair: EphemeralKeyPair;
|
|
12
|
-
uidKey?: string;
|
|
13
|
-
pepper?: HexInput;
|
|
14
|
-
extraFieldKey?: string;
|
|
15
|
-
fetchProofAsync?: boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface DeriveKeylessAccountArgs extends BaseDeriveKeylessAccountArgs {
|
|
19
|
-
disableConnect: true;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
interface DeriveKeylessAccountWithConnectArgs extends BaseDeriveKeylessAccountArgs {
|
|
23
|
-
disableConnect?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
9
|
/**
|
|
27
10
|
* A class to query all `OIDB` related queries on Aptos.
|
|
28
11
|
*/
|
|
@@ -35,12 +18,10 @@ export class Keyless {
|
|
|
35
18
|
* @param args.jwt jwt token
|
|
36
19
|
* @returns The pepper
|
|
37
20
|
*/
|
|
38
|
-
async getPepper(args: { jwt: string
|
|
21
|
+
async getPepper(args: { jwt: string; ephemeralKeyPair: EphemeralKeyPair }): Promise<Uint8Array> {
|
|
39
22
|
return getPepper({ aptosConfig: this.config, ...args });
|
|
40
23
|
}
|
|
41
24
|
|
|
42
|
-
async deriveKeylessAccount(args: DeriveKeylessAccountArgs): Promise<KeylessAccount>;
|
|
43
|
-
async deriveKeylessAccount(args: DeriveKeylessAccountWithConnectArgs): Promise<MultiKeyAccount>;
|
|
44
25
|
async deriveKeylessAccount(args: {
|
|
45
26
|
jwt: string;
|
|
46
27
|
ephemeralKeyPair: EphemeralKeyPair;
|
|
@@ -49,7 +30,7 @@ export class Keyless {
|
|
|
49
30
|
extraFieldKey?: string;
|
|
50
31
|
disableConnect?: boolean;
|
|
51
32
|
fetchProofAsync?: boolean;
|
|
52
|
-
}): Promise<
|
|
33
|
+
}): Promise<KeylessAccount> {
|
|
53
34
|
return deriveKeylessAccount({ aptosConfig: this.config, ...args });
|
|
54
35
|
}
|
|
55
36
|
}
|
package/src/api/transaction.ts
CHANGED
|
@@ -34,11 +34,11 @@ import {
|
|
|
34
34
|
InputGenerateTransactionPayloadData,
|
|
35
35
|
} from "../transactions";
|
|
36
36
|
import { AccountAddressInput, PrivateKey } from "../core";
|
|
37
|
+
import { Account } from "../account";
|
|
37
38
|
import { Build } from "./transactionSubmission/build";
|
|
38
39
|
import { Simulate } from "./transactionSubmission/simulate";
|
|
39
40
|
import { Submit } from "./transactionSubmission/submit";
|
|
40
41
|
import { TransactionManagement } from "./transactionSubmission/management";
|
|
41
|
-
import { Account } from "../account/Account";
|
|
42
42
|
import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
|
|
43
43
|
|
|
44
44
|
export class Transaction {
|
package/src/client/post.ts
CHANGED
|
@@ -136,7 +136,6 @@ export async function postAptosFaucet<Req extends {}, Res extends {}>(
|
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
|
|
140
139
|
export async function postAptosPepperService<Req extends {}, Res extends {}>(
|
|
141
140
|
options: PostAptosRequestOptions,
|
|
142
141
|
): Promise<AptosResponse<Req, Res>> {
|
|
@@ -147,4 +146,4 @@ export async function postAptosProvingService<Req extends {}, Res extends {}>(
|
|
|
147
146
|
options: PostAptosRequestOptions,
|
|
148
147
|
): Promise<AptosResponse<Req, Res>> {
|
|
149
148
|
return post<Req, Res>({ ...options, type: AptosApiType.PROVER });
|
|
150
|
-
}
|
|
149
|
+
}
|
|
@@ -7,11 +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 {
|
|
11
|
-
isValidHardenedPath,
|
|
12
|
-
fromDerivationPath as fromDerivationPathInner,
|
|
13
|
-
mnemonicToSeed,
|
|
14
|
-
} from "./hdKey";
|
|
10
|
+
import { isValidHardenedPath, fromDerivationPath as fromDerivationPathInner, mnemonicToSeed } from "./hdKey";
|
|
15
11
|
import { PrivateKey } from "./privateKey";
|
|
16
12
|
import { AccountPublicKey, VerifySignatureArgs } from "./publicKey";
|
|
17
13
|
import { Signature } from "./signature";
|
|
@@ -189,7 +185,9 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
|
|
|
189
185
|
if (!isValidHardenedPath(path)) {
|
|
190
186
|
throw new Error(`Invalid derivation path ${path}`);
|
|
191
187
|
}
|
|
192
|
-
return new Ed25519PrivateKey(
|
|
188
|
+
return new Ed25519PrivateKey(
|
|
189
|
+
fromDerivationPathInner(path, Ed25519PrivateKey.SLIP_0010_SEED, mnemonicToSeed(mnemonics)),
|
|
190
|
+
);
|
|
193
191
|
}
|
|
194
192
|
|
|
195
193
|
// endregion
|
|
@@ -16,12 +16,15 @@ export class EphemeralPublicKey extends PublicKey {
|
|
|
16
16
|
*/
|
|
17
17
|
public readonly publicKey: PublicKey;
|
|
18
18
|
|
|
19
|
+
public readonly variant: EphemeralPublicKeyVariant;
|
|
20
|
+
|
|
19
21
|
constructor(publicKey: PublicKey) {
|
|
20
22
|
super();
|
|
21
23
|
const publicKeyType = publicKey.constructor.name;
|
|
22
24
|
switch (publicKeyType) {
|
|
23
25
|
case Ed25519PublicKey.name:
|
|
24
26
|
this.publicKey = publicKey;
|
|
27
|
+
this.variant = EphemeralPublicKeyVariant.Ed25519;
|
|
25
28
|
break;
|
|
26
29
|
default:
|
|
27
30
|
throw new Error(`Unsupported key for EphemeralPublicKey - ${publicKeyType}`);
|
|
@@ -43,7 +46,7 @@ export class EphemeralPublicKey extends PublicKey {
|
|
|
43
46
|
* @returns string representation of the public key
|
|
44
47
|
*/
|
|
45
48
|
toString(): string {
|
|
46
|
-
return this.bcsToHex().toString()
|
|
49
|
+
return this.bcsToHex().toString();
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
/**
|
|
@@ -86,7 +89,6 @@ export class EphemeralPublicKey extends PublicKey {
|
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
|
|
89
|
-
|
|
90
92
|
export class EphemeralSignature extends Signature {
|
|
91
93
|
public readonly signature: Signature;
|
|
92
94
|
|
|
@@ -243,7 +243,13 @@ export class SignedGroth16Signature extends Signature {
|
|
|
243
243
|
trainingWheelsSignature?: EphemeralSignature;
|
|
244
244
|
}) {
|
|
245
245
|
super();
|
|
246
|
-
const {
|
|
246
|
+
const {
|
|
247
|
+
proof,
|
|
248
|
+
expHorizonSecs = BigInt(EPK_HORIZON_SECS),
|
|
249
|
+
trainingWheelsSignature,
|
|
250
|
+
extraField,
|
|
251
|
+
overrideAudVal,
|
|
252
|
+
} = args;
|
|
247
253
|
this.proof = proof;
|
|
248
254
|
this.expHorizonSecs = expHorizonSecs;
|
|
249
255
|
this.trainingWheelsSignature = trainingWheelsSignature;
|
|
@@ -413,7 +419,7 @@ export class KeylessSignature extends Signature {
|
|
|
413
419
|
|
|
414
420
|
readonly jwtHeader: string;
|
|
415
421
|
|
|
416
|
-
readonly expiryDateSecs: bigint;
|
|
422
|
+
readonly expiryDateSecs: bigint | number;
|
|
417
423
|
|
|
418
424
|
readonly ephemeralPublicKey: EphemeralPublicKey;
|
|
419
425
|
|
|
@@ -427,7 +433,7 @@ export class KeylessSignature extends Signature {
|
|
|
427
433
|
constructor(args: {
|
|
428
434
|
jwtHeader: string;
|
|
429
435
|
openIdSignatureOrZkProof: OpenIdSignatureOrZkProof;
|
|
430
|
-
expiryDateSecs: bigint;
|
|
436
|
+
expiryDateSecs: bigint | number;
|
|
431
437
|
ephemeralPublicKey: EphemeralPublicKey;
|
|
432
438
|
ephemeralSignature: EphemeralSignature;
|
|
433
439
|
}) {
|
|
@@ -141,15 +141,13 @@ export class MultiKey extends AccountPublicKey {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
getIndex(publicKey: PublicKey): number {
|
|
144
|
-
|
|
145
|
-
const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey)
|
|
144
|
+
const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);
|
|
146
145
|
const index = this.publicKeys.findIndex((pk) => pk.toString() === anyPublicKey.toString());
|
|
147
146
|
|
|
148
147
|
if (index !== -1) {
|
|
149
|
-
|
|
150
|
-
}
|
|
148
|
+
return index;
|
|
149
|
+
}
|
|
151
150
|
throw new Error("Public key not found in MultiKey");
|
|
152
|
-
|
|
153
151
|
}
|
|
154
152
|
}
|
|
155
153
|
|
|
@@ -178,9 +178,9 @@ export class AnySignature extends Signature {
|
|
|
178
178
|
case AnySignatureVariant.Secp256k1:
|
|
179
179
|
signature = Secp256k1Signature.deserialize(deserializer);
|
|
180
180
|
break;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
case AnySignatureVariant.Keyless:
|
|
182
|
+
signature = KeylessSignature.deserialize(deserializer);
|
|
183
|
+
break;
|
|
184
184
|
default:
|
|
185
185
|
throw new Error(`Unknown variant index for AnySignature: ${variantIndex}`);
|
|
186
186
|
}
|
package/src/internal/ans.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* name namespace and without having a dependency cycle error.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { Account } from "../account";
|
|
12
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
|
+
import { Account } from "../account";
|
|
13
13
|
import { AccountAddress, AccountAddressInput } from "../core";
|
|
14
14
|
import { InputGenerateTransactionOptions } from "../transactions/types";
|
|
15
15
|
import { GetANSNameResponse, MoveAddressType, OrderByArg, PaginationArgs, WhereArg } from "../types";
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
12
|
import { Bool, MoveString, MoveVector, U64 } from "../bcs";
|
|
13
13
|
import { AccountAddress, AccountAddressInput } from "../core";
|
|
14
|
+
import { Account } from "../account";
|
|
14
15
|
import { EntryFunctionABI, InputGenerateTransactionOptions } from "../transactions/types";
|
|
15
16
|
import {
|
|
16
17
|
AnyNumber,
|
|
@@ -53,7 +54,6 @@ import {
|
|
|
53
54
|
TypeTagU64,
|
|
54
55
|
TypeTagVector,
|
|
55
56
|
} from "../transactions";
|
|
56
|
-
import { Account } from "../account";
|
|
57
57
|
import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
|
|
58
58
|
|
|
59
59
|
// A property type map for the user input and what Move expects
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
FungibleAssetMetadataBoolExp,
|
|
35
35
|
} from "../types/generated/types";
|
|
36
36
|
import { AccountAddressInput } from "../core";
|
|
37
|
+
import { Account } from "../account";
|
|
37
38
|
import {
|
|
38
39
|
EntryFunctionABI,
|
|
39
40
|
InputGenerateTransactionOptions,
|
|
@@ -42,7 +43,6 @@ import {
|
|
|
42
43
|
TypeTagU64,
|
|
43
44
|
} from "../transactions";
|
|
44
45
|
import { generateTransaction } from "./transactionSubmission";
|
|
45
|
-
import { Account } from "../account";
|
|
46
46
|
import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
|
|
47
47
|
|
|
48
48
|
export async function getFungibleAssetMetadata(args: {
|
package/src/internal/keyless.ts
CHANGED
|
@@ -18,12 +18,11 @@ import {
|
|
|
18
18
|
EphemeralSignature,
|
|
19
19
|
Groth16Zkp,
|
|
20
20
|
Hex,
|
|
21
|
-
MultiKey,
|
|
22
21
|
SignedGroth16Signature,
|
|
23
22
|
} from "../core";
|
|
24
23
|
import { HexInput } from "../types";
|
|
25
24
|
import { Serializer } from "../bcs";
|
|
26
|
-
import { EphemeralKeyPair, KeylessAccount
|
|
25
|
+
import { EphemeralKeyPair, KeylessAccount } from "../account";
|
|
27
26
|
import { PepperFetchResponse, ProverResponse } from "../types/keyless";
|
|
28
27
|
|
|
29
28
|
const APTOS_KEYLESS_PEPPER_PINKAS_VUF_DST = "APTOS_KEYLESS_PEPPER_PINKAS_VUF_DST";
|
|
@@ -171,15 +170,10 @@ export async function deriveKeylessAccount(args: {
|
|
|
171
170
|
uidKey?: string;
|
|
172
171
|
pepper?: HexInput;
|
|
173
172
|
extraFieldKey?: string;
|
|
174
|
-
disableConnect?: boolean;
|
|
175
173
|
fetchProofAsync?: boolean;
|
|
176
|
-
}): Promise<KeylessAccount
|
|
174
|
+
}): Promise<KeylessAccount> {
|
|
177
175
|
const { fetchProofAsync } = args;
|
|
178
|
-
let { pepper
|
|
179
|
-
|
|
180
|
-
if (pepper || disableConnect) {
|
|
181
|
-
disableConnect = true;
|
|
182
|
-
}
|
|
176
|
+
let { pepper } = args;
|
|
183
177
|
if (pepper === undefined) {
|
|
184
178
|
pepper = await getPepper(args);
|
|
185
179
|
} else if (Hex.fromHexInput(pepper).toUint8Array().length !== 31) {
|
|
@@ -191,15 +185,5 @@ export async function deriveKeylessAccount(args: {
|
|
|
191
185
|
|
|
192
186
|
const keylessAccount = KeylessAccount.fromJWTAndProof({ ...args, proofFetcherOrData: proof, pepper });
|
|
193
187
|
|
|
194
|
-
if (disableConnect === true) {
|
|
195
188
|
return keylessAccount;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const aptosConnectPublicKey = keylessAccount.deriveAptosConnectPublicKey();
|
|
199
|
-
|
|
200
|
-
const multiKey = new MultiKey({
|
|
201
|
-
publicKeys: [keylessAccount.publicKey, aptosConnectPublicKey],
|
|
202
|
-
signaturesRequired: 1,
|
|
203
|
-
});
|
|
204
|
-
return new MultiKeyAccount({ multiKey, signers: [keylessAccount] });
|
|
205
189
|
}
|
|
@@ -100,10 +100,10 @@ export async function buildTransactionPayload(
|
|
|
100
100
|
args: { aptosConfig: AptosConfig } & InputGenerateTransactionData,
|
|
101
101
|
): Promise<AnyTransactionPayloadInstance> {
|
|
102
102
|
const { aptosConfig, data } = args;
|
|
103
|
-
|
|
104
103
|
// Merge in aptosConfig for remote ABI on non-script payloads
|
|
105
104
|
let generateTransactionPayloadData: InputGenerateTransactionPayloadDataWithRemoteABI;
|
|
106
105
|
let payload: AnyTransactionPayloadInstance;
|
|
106
|
+
|
|
107
107
|
if ("bytecode" in data) {
|
|
108
108
|
// TODO: Add ABI checking later
|
|
109
109
|
payload = await generateTransactionPayload(data);
|
|
@@ -114,6 +114,7 @@ export async function buildTransactionPayload(
|
|
|
114
114
|
function: data.function,
|
|
115
115
|
functionArguments: data.functionArguments,
|
|
116
116
|
typeArguments: data.typeArguments,
|
|
117
|
+
abi: data.abi,
|
|
117
118
|
};
|
|
118
119
|
payload = await generateTransactionPayload(generateTransactionPayloadData);
|
|
119
120
|
} else {
|
|
@@ -122,6 +123,7 @@ export async function buildTransactionPayload(
|
|
|
122
123
|
function: data.function,
|
|
123
124
|
functionArguments: data.functionArguments,
|
|
124
125
|
typeArguments: data.typeArguments,
|
|
126
|
+
abi: data.abi,
|
|
125
127
|
};
|
|
126
128
|
payload = await generateTransactionPayload(generateTransactionPayloadData);
|
|
127
129
|
}
|