@aptos-labs/ts-sdk 1.22.2 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/{accountAddress-NYtf3uZq.d.ts → accountAddress-D9blTwwp.d.ts} +57 -15
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/index.d.ts +41 -16
- package/dist/common/index.js +28 -26
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +13 -2
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/api/account.d.mts +4 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- 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.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.mjs +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.mjs +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-GGU4XOUO.mjs → chunk-25ZFJIIK.mjs} +2 -2
- package/dist/esm/chunk-2BJ23DXY.mjs +2 -0
- package/dist/esm/chunk-2BJ23DXY.mjs.map +1 -0
- package/dist/esm/chunk-375GMLWG.mjs +2 -0
- package/dist/esm/chunk-375GMLWG.mjs.map +1 -0
- package/dist/esm/chunk-3A6HUKXW.mjs +2 -0
- package/dist/esm/{chunk-Y2DHN4CV.mjs.map → chunk-3A6HUKXW.mjs.map} +1 -1
- package/dist/esm/{chunk-DM6HVA4K.mjs → chunk-3XFAQ6KR.mjs} +2 -2
- package/dist/esm/chunk-4GETVCGY.mjs +2 -0
- package/dist/esm/chunk-4GETVCGY.mjs.map +1 -0
- package/dist/esm/chunk-4LQKLXHW.mjs +2 -0
- package/dist/esm/chunk-4LQKLXHW.mjs.map +1 -0
- package/dist/esm/{chunk-K7Y2SC65.mjs → chunk-4TXG2LSP.mjs} +2 -2
- package/dist/esm/chunk-4YR6QO63.mjs +2 -0
- package/dist/esm/chunk-4YR6QO63.mjs.map +1 -0
- package/dist/esm/{chunk-UYF7AQLE.mjs → chunk-5JTED2JJ.mjs} +2 -2
- package/dist/esm/chunk-75U3LEBF.mjs +2 -0
- package/dist/esm/chunk-75U3LEBF.mjs.map +1 -0
- package/dist/esm/{chunk-OYLT6IVC.mjs → chunk-7X67Z6NJ.mjs} +2 -2
- package/dist/esm/chunk-ALRQRVDX.mjs +2 -0
- package/dist/esm/chunk-ALRQRVDX.mjs.map +1 -0
- package/dist/esm/{chunk-FC7IRFFN.mjs → chunk-AVNNYI7R.mjs} +2 -2
- package/dist/esm/{chunk-VBPDZZXC.mjs → chunk-BSAYHZ2R.mjs} +2 -2
- package/dist/esm/{chunk-RFMLKHUD.mjs → chunk-BTLHVOIC.mjs} +2 -2
- package/dist/esm/chunk-C6VIBT2D.mjs +2 -0
- package/dist/esm/{chunk-QA7VTFUT.mjs.map → chunk-C6VIBT2D.mjs.map} +1 -1
- package/dist/esm/chunk-CDLMUY5H.mjs +2 -0
- package/dist/esm/chunk-CDLMUY5H.mjs.map +1 -0
- package/dist/esm/{chunk-WL4FXFAM.mjs → chunk-CNNDK6OL.mjs} +2 -2
- package/dist/esm/{chunk-B6PLCJJ2.mjs → chunk-CQPJZUKQ.mjs} +2 -2
- package/dist/esm/{chunk-EKZHYOQH.mjs → chunk-CSW2QEVU.mjs} +2 -2
- package/dist/esm/{chunk-Z4OZBMSL.mjs → chunk-D3PBEHCP.mjs} +2 -2
- package/dist/esm/{chunk-EIKBYKIJ.mjs → chunk-DAZTLM55.mjs} +2 -2
- package/dist/esm/{chunk-XYWMFCL6.mjs → chunk-ETWZV5XK.mjs} +2 -2
- package/dist/esm/{chunk-2ZAYK464.mjs → chunk-FAHN3AZI.mjs} +2 -2
- package/dist/esm/{chunk-IMF5XUVW.mjs → chunk-FFF7M7E4.mjs} +2 -2
- package/dist/esm/{chunk-37Y7VAN7.mjs → chunk-G23ZPQCJ.mjs} +2 -2
- package/dist/esm/{chunk-77NXCSLY.mjs → chunk-G5MGSV7Y.mjs} +2 -2
- package/dist/esm/{chunk-5IRM54PL.mjs → chunk-GJWCKVN5.mjs} +2 -2
- package/dist/esm/{chunk-JY5LTRTM.mjs → chunk-GK7TQDBN.mjs} +2 -2
- package/dist/esm/{chunk-W5ZII3JO.mjs → chunk-GLUCMQZK.mjs} +2 -2
- package/dist/esm/{chunk-HFOLSSAQ.mjs → chunk-GYIYUBYT.mjs} +2 -2
- package/dist/esm/{chunk-5E672SHG.mjs → chunk-HBECYNQ6.mjs} +2 -2
- package/dist/esm/{chunk-5E672SHG.mjs.map → chunk-HBECYNQ6.mjs.map} +1 -1
- package/dist/esm/{chunk-GCPWPGCS.mjs → chunk-HKMG3LZX.mjs} +2 -2
- package/dist/esm/{chunk-XBTCOCZJ.mjs → chunk-HLXD3KWO.mjs} +2 -2
- package/dist/esm/{chunk-UIJK42CX.mjs → chunk-HWYAQTV3.mjs} +2 -2
- package/dist/esm/{chunk-6XCZ56O7.mjs → chunk-IG7R65TF.mjs} +2 -2
- package/dist/esm/{chunk-PVEPP4HR.mjs → chunk-INZXND6M.mjs} +2 -2
- package/dist/esm/{chunk-CPCS5KIA.mjs → chunk-ISUHNAU4.mjs} +2 -2
- package/dist/esm/{chunk-XT2VVDT3.mjs → chunk-J2YQTDZL.mjs} +2 -2
- package/dist/esm/{chunk-O4O7HSUQ.mjs → chunk-JDTU6Z6C.mjs} +2 -2
- package/dist/esm/{chunk-BN2PXCFR.mjs → chunk-LKLHNQF5.mjs} +2 -2
- package/dist/esm/{chunk-C2IJG37E.mjs → chunk-MULJ2GLJ.mjs} +2 -2
- package/dist/esm/{chunk-XFBB7YYI.mjs → chunk-NV5YQZ3R.mjs} +2 -2
- package/dist/esm/{chunk-3VUSIKCF.mjs → chunk-NWOMSL6K.mjs} +2 -2
- package/dist/esm/{chunk-OTK3HBAU.mjs → chunk-O2M3QKKS.mjs} +2 -2
- package/dist/esm/{chunk-BF46IXHH.mjs → chunk-OHRL766V.mjs} +2 -2
- package/dist/esm/chunk-OHRL766V.mjs.map +1 -0
- package/dist/esm/{chunk-4EPLOSKY.mjs → chunk-PR6363Y6.mjs} +2 -2
- package/dist/esm/{chunk-U7I7YKWD.mjs → chunk-PSCDBITI.mjs} +2 -2
- package/dist/esm/chunk-QFORDQCU.mjs +2 -0
- package/dist/esm/chunk-QFORDQCU.mjs.map +1 -0
- package/dist/esm/{chunk-U2QQD2ER.mjs → chunk-QITCB4PW.mjs} +2 -2
- package/dist/esm/chunk-QITCB4PW.mjs.map +1 -0
- package/dist/esm/{chunk-NRAQZUD5.mjs → chunk-QNTQPWLK.mjs} +2 -2
- package/dist/esm/{chunk-D6WTINSF.mjs → chunk-QQWBR4SK.mjs} +2 -2
- package/dist/esm/{chunk-FEGCUPGO.mjs → chunk-QVJV46XS.mjs} +2 -2
- package/dist/esm/{chunk-6AJLTBXC.mjs → chunk-RP5444TL.mjs} +2 -2
- package/dist/esm/{chunk-OAKHR7AG.mjs → chunk-S36XP4IE.mjs} +2 -2
- package/dist/esm/{chunk-RFA7BIDN.mjs → chunk-SUJLWCRN.mjs} +2 -2
- package/dist/esm/{chunk-4ZXCQXVC.mjs → chunk-TBJ7W5NC.mjs} +2 -2
- package/dist/esm/chunk-TDGQGILY.mjs +2 -0
- package/dist/esm/chunk-TDGQGILY.mjs.map +1 -0
- package/dist/esm/{chunk-EPVAT625.mjs → chunk-TX2IYMFV.mjs} +2 -2
- package/dist/esm/chunk-UC5BZJ23.mjs +2 -0
- package/dist/esm/chunk-UC5BZJ23.mjs.map +1 -0
- package/dist/esm/{chunk-GEP4HPQ6.mjs → chunk-URCQOJ55.mjs} +2 -2
- package/dist/esm/{chunk-6DDSU7HN.mjs → chunk-V3OYNKY5.mjs} +2 -2
- package/dist/esm/{chunk-YMFEA2TJ.mjs → chunk-VHNX2NUR.mjs} +3 -1
- package/dist/esm/chunk-VHNX2NUR.mjs.map +1 -0
- package/dist/esm/chunk-VTPF7AYM.mjs +2 -0
- package/dist/esm/chunk-VTPF7AYM.mjs.map +1 -0
- package/dist/esm/{chunk-WTJCMD4D.mjs → chunk-VTTT2G7F.mjs} +2 -2
- package/dist/esm/{chunk-YDXU6ALO.mjs → chunk-WMHYIP3S.mjs} +2 -2
- package/dist/esm/{chunk-OPGMT27G.mjs → chunk-WRRQ7L5K.mjs} +2 -2
- package/dist/esm/{chunk-BF3D6ADE.mjs → chunk-WUJ7XNQD.mjs} +2 -2
- package/dist/esm/{chunk-EOJWPF3P.mjs → chunk-X27JKATG.mjs} +2 -2
- package/dist/esm/{chunk-XWAOZPIP.mjs → chunk-XVJI5XXW.mjs} +2 -2
- package/dist/esm/{chunk-TY4IEDJD.mjs → chunk-YDZBU2DJ.mjs} +2 -2
- package/dist/esm/{chunk-RS2FIBMQ.mjs → chunk-YMVD7Z7Z.mjs} +2 -2
- package/dist/esm/{chunk-6TWRNWC3.mjs → chunk-ZW2R6VQE.mjs} +2 -2
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/client/core.d.mts +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/client/types.d.mts +8 -1
- package/dist/esm/client/types.mjs +1 -1
- 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.d.mts +1 -0
- 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 -9
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +1 -0
- 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/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +1 -0
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +2 -0
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/index.d.mts +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +2 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +17 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- 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.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +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.mjs +1 -1
- package/dist/esm/transactions/management/index.mjs +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/generated/operations.d.mts +16 -12
- package/dist/esm/types/generated/queries.d.mts +2 -2
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +365 -761
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +42 -3
- package/dist/esm/types/index.mjs +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 -1
- package/src/account/KeylessAccount.ts +20 -4
- package/src/api/account.ts +4 -1
- package/src/api/faucet.ts +6 -1
- package/src/client/core.ts +25 -52
- package/src/client/types.ts +60 -7
- package/src/core/accountAddress.ts +8 -6
- package/src/core/crypto/ed25519.ts +28 -28
- package/src/core/crypto/ephemeral.ts +1 -1
- package/src/core/crypto/keyless.ts +9 -0
- package/src/core/crypto/secp256k1.ts +4 -3
- package/src/core/crypto/singleKey.ts +20 -1
- package/src/internal/account.ts +35 -4
- package/src/internal/ans.ts +36 -4
- package/src/internal/queries/ansTokenFragment.graphql +2 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +17 -27
- package/src/types/generated/operations.ts +16 -12
- package/src/types/generated/queries.ts +2 -0
- package/src/types/generated/types.ts +387 -835
- package/src/types/index.ts +48 -1
- package/src/version.ts +1 -1
- package/dist/esm/chunk-42XNGDUC.mjs +0 -2
- package/dist/esm/chunk-42XNGDUC.mjs.map +0 -1
- package/dist/esm/chunk-6ZQWPHLV.mjs +0 -2
- package/dist/esm/chunk-6ZQWPHLV.mjs.map +0 -1
- package/dist/esm/chunk-7LY73OAN.mjs +0 -2
- package/dist/esm/chunk-7LY73OAN.mjs.map +0 -1
- package/dist/esm/chunk-A2Z7I2EY.mjs +0 -2
- package/dist/esm/chunk-A2Z7I2EY.mjs.map +0 -1
- package/dist/esm/chunk-BF46IXHH.mjs.map +0 -1
- package/dist/esm/chunk-FPDE5EYE.mjs +0 -2
- package/dist/esm/chunk-FPDE5EYE.mjs.map +0 -1
- package/dist/esm/chunk-GHYE26Q5.mjs +0 -2
- package/dist/esm/chunk-GHYE26Q5.mjs.map +0 -1
- package/dist/esm/chunk-H4XMI4WZ.mjs +0 -2
- package/dist/esm/chunk-H4XMI4WZ.mjs.map +0 -1
- package/dist/esm/chunk-MI732NUU.mjs +0 -2
- package/dist/esm/chunk-MI732NUU.mjs.map +0 -1
- package/dist/esm/chunk-NBJFTE2P.mjs +0 -2
- package/dist/esm/chunk-NBJFTE2P.mjs.map +0 -1
- package/dist/esm/chunk-Q6LFIZ3L.mjs +0 -2
- package/dist/esm/chunk-Q6LFIZ3L.mjs.map +0 -1
- package/dist/esm/chunk-QA7VTFUT.mjs +0 -2
- package/dist/esm/chunk-U2QQD2ER.mjs.map +0 -1
- package/dist/esm/chunk-U6X2FYNI.mjs +0 -2
- package/dist/esm/chunk-U6X2FYNI.mjs.map +0 -1
- package/dist/esm/chunk-XCNNMSVO.mjs +0 -2
- package/dist/esm/chunk-XCNNMSVO.mjs.map +0 -1
- package/dist/esm/chunk-Y2DHN4CV.mjs +0 -2
- package/dist/esm/chunk-YMFEA2TJ.mjs.map +0 -1
- /package/dist/esm/{chunk-GGU4XOUO.mjs.map → chunk-25ZFJIIK.mjs.map} +0 -0
- /package/dist/esm/{chunk-DM6HVA4K.mjs.map → chunk-3XFAQ6KR.mjs.map} +0 -0
- /package/dist/esm/{chunk-K7Y2SC65.mjs.map → chunk-4TXG2LSP.mjs.map} +0 -0
- /package/dist/esm/{chunk-UYF7AQLE.mjs.map → chunk-5JTED2JJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-OYLT6IVC.mjs.map → chunk-7X67Z6NJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-FC7IRFFN.mjs.map → chunk-AVNNYI7R.mjs.map} +0 -0
- /package/dist/esm/{chunk-VBPDZZXC.mjs.map → chunk-BSAYHZ2R.mjs.map} +0 -0
- /package/dist/esm/{chunk-RFMLKHUD.mjs.map → chunk-BTLHVOIC.mjs.map} +0 -0
- /package/dist/esm/{chunk-WL4FXFAM.mjs.map → chunk-CNNDK6OL.mjs.map} +0 -0
- /package/dist/esm/{chunk-B6PLCJJ2.mjs.map → chunk-CQPJZUKQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-EKZHYOQH.mjs.map → chunk-CSW2QEVU.mjs.map} +0 -0
- /package/dist/esm/{chunk-Z4OZBMSL.mjs.map → chunk-D3PBEHCP.mjs.map} +0 -0
- /package/dist/esm/{chunk-EIKBYKIJ.mjs.map → chunk-DAZTLM55.mjs.map} +0 -0
- /package/dist/esm/{chunk-XYWMFCL6.mjs.map → chunk-ETWZV5XK.mjs.map} +0 -0
- /package/dist/esm/{chunk-2ZAYK464.mjs.map → chunk-FAHN3AZI.mjs.map} +0 -0
- /package/dist/esm/{chunk-IMF5XUVW.mjs.map → chunk-FFF7M7E4.mjs.map} +0 -0
- /package/dist/esm/{chunk-37Y7VAN7.mjs.map → chunk-G23ZPQCJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-77NXCSLY.mjs.map → chunk-G5MGSV7Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-5IRM54PL.mjs.map → chunk-GJWCKVN5.mjs.map} +0 -0
- /package/dist/esm/{chunk-JY5LTRTM.mjs.map → chunk-GK7TQDBN.mjs.map} +0 -0
- /package/dist/esm/{chunk-W5ZII3JO.mjs.map → chunk-GLUCMQZK.mjs.map} +0 -0
- /package/dist/esm/{chunk-HFOLSSAQ.mjs.map → chunk-GYIYUBYT.mjs.map} +0 -0
- /package/dist/esm/{chunk-GCPWPGCS.mjs.map → chunk-HKMG3LZX.mjs.map} +0 -0
- /package/dist/esm/{chunk-XBTCOCZJ.mjs.map → chunk-HLXD3KWO.mjs.map} +0 -0
- /package/dist/esm/{chunk-UIJK42CX.mjs.map → chunk-HWYAQTV3.mjs.map} +0 -0
- /package/dist/esm/{chunk-6XCZ56O7.mjs.map → chunk-IG7R65TF.mjs.map} +0 -0
- /package/dist/esm/{chunk-PVEPP4HR.mjs.map → chunk-INZXND6M.mjs.map} +0 -0
- /package/dist/esm/{chunk-CPCS5KIA.mjs.map → chunk-ISUHNAU4.mjs.map} +0 -0
- /package/dist/esm/{chunk-XT2VVDT3.mjs.map → chunk-J2YQTDZL.mjs.map} +0 -0
- /package/dist/esm/{chunk-O4O7HSUQ.mjs.map → chunk-JDTU6Z6C.mjs.map} +0 -0
- /package/dist/esm/{chunk-BN2PXCFR.mjs.map → chunk-LKLHNQF5.mjs.map} +0 -0
- /package/dist/esm/{chunk-C2IJG37E.mjs.map → chunk-MULJ2GLJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-XFBB7YYI.mjs.map → chunk-NV5YQZ3R.mjs.map} +0 -0
- /package/dist/esm/{chunk-3VUSIKCF.mjs.map → chunk-NWOMSL6K.mjs.map} +0 -0
- /package/dist/esm/{chunk-OTK3HBAU.mjs.map → chunk-O2M3QKKS.mjs.map} +0 -0
- /package/dist/esm/{chunk-4EPLOSKY.mjs.map → chunk-PR6363Y6.mjs.map} +0 -0
- /package/dist/esm/{chunk-U7I7YKWD.mjs.map → chunk-PSCDBITI.mjs.map} +0 -0
- /package/dist/esm/{chunk-NRAQZUD5.mjs.map → chunk-QNTQPWLK.mjs.map} +0 -0
- /package/dist/esm/{chunk-D6WTINSF.mjs.map → chunk-QQWBR4SK.mjs.map} +0 -0
- /package/dist/esm/{chunk-FEGCUPGO.mjs.map → chunk-QVJV46XS.mjs.map} +0 -0
- /package/dist/esm/{chunk-6AJLTBXC.mjs.map → chunk-RP5444TL.mjs.map} +0 -0
- /package/dist/esm/{chunk-OAKHR7AG.mjs.map → chunk-S36XP4IE.mjs.map} +0 -0
- /package/dist/esm/{chunk-RFA7BIDN.mjs.map → chunk-SUJLWCRN.mjs.map} +0 -0
- /package/dist/esm/{chunk-4ZXCQXVC.mjs.map → chunk-TBJ7W5NC.mjs.map} +0 -0
- /package/dist/esm/{chunk-EPVAT625.mjs.map → chunk-TX2IYMFV.mjs.map} +0 -0
- /package/dist/esm/{chunk-GEP4HPQ6.mjs.map → chunk-URCQOJ55.mjs.map} +0 -0
- /package/dist/esm/{chunk-6DDSU7HN.mjs.map → chunk-V3OYNKY5.mjs.map} +0 -0
- /package/dist/esm/{chunk-WTJCMD4D.mjs.map → chunk-VTTT2G7F.mjs.map} +0 -0
- /package/dist/esm/{chunk-YDXU6ALO.mjs.map → chunk-WMHYIP3S.mjs.map} +0 -0
- /package/dist/esm/{chunk-OPGMT27G.mjs.map → chunk-WRRQ7L5K.mjs.map} +0 -0
- /package/dist/esm/{chunk-BF3D6ADE.mjs.map → chunk-WUJ7XNQD.mjs.map} +0 -0
- /package/dist/esm/{chunk-EOJWPF3P.mjs.map → chunk-X27JKATG.mjs.map} +0 -0
- /package/dist/esm/{chunk-XWAOZPIP.mjs.map → chunk-XVJI5XXW.mjs.map} +0 -0
- /package/dist/esm/{chunk-TY4IEDJD.mjs.map → chunk-YDZBU2DJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-RS2FIBMQ.mjs.map → chunk-YMVD7Z7Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-6TWRNWC3.mjs.map → chunk-ZW2R6VQE.mjs.map} +0 -0
|
@@ -298,16 +298,18 @@ declare enum TransactionResponseType {
|
|
|
298
298
|
Genesis = "genesis_transaction",
|
|
299
299
|
BlockMetadata = "block_metadata_transaction",
|
|
300
300
|
StateCheckpoint = "state_checkpoint_transaction",
|
|
301
|
-
Validator = "validator_transaction"
|
|
301
|
+
Validator = "validator_transaction",
|
|
302
|
+
BlockEpilogue = "block_epilogue_transaction"
|
|
302
303
|
}
|
|
303
304
|
type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;
|
|
304
|
-
type CommittedTransactionResponse = UserTransactionResponse | GenesisTransactionResponse | BlockMetadataTransactionResponse | StateCheckpointTransactionResponse | ValidatorTransactionResponse;
|
|
305
|
+
type CommittedTransactionResponse = UserTransactionResponse | GenesisTransactionResponse | BlockMetadataTransactionResponse | StateCheckpointTransactionResponse | ValidatorTransactionResponse | BlockEpilogueTransactionResponse;
|
|
305
306
|
declare function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse;
|
|
306
307
|
declare function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse;
|
|
307
308
|
declare function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse;
|
|
308
309
|
declare function isBlockMetadataTransactionResponse(response: TransactionResponse): response is BlockMetadataTransactionResponse;
|
|
309
310
|
declare function isStateCheckpointTransactionResponse(response: TransactionResponse): response is StateCheckpointTransactionResponse;
|
|
310
311
|
declare function isValidatorTransactionResponse(response: TransactionResponse): response is ValidatorTransactionResponse;
|
|
312
|
+
declare function isBlockEpilogueTransactionResponse(response: TransactionResponse): response is BlockEpilogueTransactionResponse;
|
|
311
313
|
type PendingTransactionResponse = {
|
|
312
314
|
type: TransactionResponseType.Pending;
|
|
313
315
|
hash: string;
|
|
@@ -469,6 +471,43 @@ type ValidatorTransactionResponse = {
|
|
|
469
471
|
events: Array<Event>;
|
|
470
472
|
timestamp: string;
|
|
471
473
|
};
|
|
474
|
+
/**
|
|
475
|
+
* BlockEndInfo describes the gas state of the block
|
|
476
|
+
*/
|
|
477
|
+
type BlockEndInfo = {
|
|
478
|
+
block_gas_limit_reached: boolean;
|
|
479
|
+
block_output_limit_reached: boolean;
|
|
480
|
+
block_effective_block_gas_units: number;
|
|
481
|
+
block_approx_output_size: number;
|
|
482
|
+
};
|
|
483
|
+
/**
|
|
484
|
+
* BlockEpilogueTransactionResponse is a transaction that is executed at the end of a block keeping track of data from
|
|
485
|
+
* the whole block
|
|
486
|
+
*/
|
|
487
|
+
type BlockEpilogueTransactionResponse = {
|
|
488
|
+
type: TransactionResponseType.BlockEpilogue;
|
|
489
|
+
version: string;
|
|
490
|
+
hash: string;
|
|
491
|
+
state_change_hash: string;
|
|
492
|
+
event_root_hash: string;
|
|
493
|
+
state_checkpoint_hash: string | null;
|
|
494
|
+
gas_used: string;
|
|
495
|
+
/**
|
|
496
|
+
* Whether the transaction was successful
|
|
497
|
+
*/
|
|
498
|
+
success: boolean;
|
|
499
|
+
/**
|
|
500
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
501
|
+
*/
|
|
502
|
+
vm_status: string;
|
|
503
|
+
accumulator_root_hash: string;
|
|
504
|
+
/**
|
|
505
|
+
* Final state of resources changed by the transaction
|
|
506
|
+
*/
|
|
507
|
+
changes: Array<WriteSetChange>;
|
|
508
|
+
timestamp: string;
|
|
509
|
+
block_end_info: BlockEndInfo | null;
|
|
510
|
+
};
|
|
472
511
|
/**
|
|
473
512
|
* WRITESET CHANGE TYPES
|
|
474
513
|
*/
|
|
@@ -951,4 +990,4 @@ type GenerateAccountWithSingleSignerSecp256k1Key = {
|
|
|
951
990
|
};
|
|
952
991
|
type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;
|
|
953
992
|
|
|
954
|
-
export { AccountAuthenticatorVariant, type AccountData, type AccountSignature, type AnyNumber, AnyPublicKeyVariant, AnySignatureVariant, type AptosRequest, type AptosSettings, type AuthenticationKeyScheme, type Block, type BlockMetadataTransactionResponse, type Client, type ClientConfig, type ClientHeadersType, type ClientRequest, type ClientResponse, type CommittedTransactionResponse, type DecodedTableData, type DeletedTableData, DeriveScheme, type DirectWriteSet, type EntryFunctionPayloadResponse, EphemeralCertificateVariant, EphemeralPublicKeyVariant, EphemeralSignatureVariant, type Event, type EventGuid, type FaucetConfig, type FullNodeConfig, type GasEstimation, type GenerateAccount, type GenerateAccountWithEd25519, type GenerateAccountWithSingleSignerSecp256k1Key, type GenesisPayload, type GenesisTransactionResponse, type HexInput, type IndexerConfig, type LedgerInfo, type LedgerVersionArg, MimeType, MoveAbility, type MoveAddressType, type MoveFunction, type MoveFunctionGenericTypeParam, type MoveFunctionId, MoveFunctionVisibility, type MoveModule, type MoveModuleBytecode, type MoveModuleId, type MoveObjectType, type MoveOptionType, type MoveResource, type MoveScriptBytecode, type MoveStruct, type MoveStructField, type MoveStructId, type MoveStructType, type MoveType, type MoveUint128Type, type MoveUint16Type, type MoveUint256Type, type MoveUint32Type, type MoveUint64Type, type MoveUint8Type, type MoveValue, type MultisigPayloadResponse, OrderBy, type OrderByArg, type PaginationArgs, type PendingTransactionResponse, RoleType, type ScriptPayloadResponse, ScriptTransactionArgumentVariants, type ScriptWriteSet, SigningScheme, SigningSchemeInput, type StateCheckpointTransactionResponse, type TableItemRequest, TokenStandard, type TokenStandardArg, TransactionAuthenticatorVariant, type TransactionEd25519Signature, type TransactionFeePayerSignature, type TransactionMultiAgentSignature, type TransactionMultiEd25519Signature, type TransactionPayloadResponse, TransactionPayloadVariants, type TransactionResponse, TransactionResponseType, type TransactionSecp256k1Signature, type TransactionSignature, TransactionVariants, TypeTagVariants, type Uint128, type Uint16, type Uint256, type Uint32, type Uint64, type Uint8, type UserTransactionResponse, type ValidatorTransactionResponse, type WaitForTransactionOptions, type WhereArg, type WriteSet, type WriteSetChange, type WriteSetChangeDeleteModule, type WriteSetChangeDeleteResource, type WriteSetChangeDeleteTableItem, type WriteSetChangeWriteModule, type WriteSetChangeWriteResource, type WriteSetChangeWriteTableItem, ZkpVariant, isBlockMetadataTransactionResponse, isEd25519Signature, isFeePayerSignature, isGenesisTransactionResponse, isMultiAgentSignature, isMultiEd25519Signature, isPendingTransactionResponse, isSecp256k1Signature, isStateCheckpointTransactionResponse, isUserTransactionResponse, isValidatorTransactionResponse };
|
|
993
|
+
export { AccountAuthenticatorVariant, type AccountData, type AccountSignature, type AnyNumber, AnyPublicKeyVariant, AnySignatureVariant, type AptosRequest, type AptosSettings, type AuthenticationKeyScheme, type Block, type BlockEndInfo, type BlockEpilogueTransactionResponse, type BlockMetadataTransactionResponse, type Client, type ClientConfig, type ClientHeadersType, type ClientRequest, type ClientResponse, type CommittedTransactionResponse, type DecodedTableData, type DeletedTableData, DeriveScheme, type DirectWriteSet, type EntryFunctionPayloadResponse, EphemeralCertificateVariant, EphemeralPublicKeyVariant, EphemeralSignatureVariant, type Event, type EventGuid, type FaucetConfig, type FullNodeConfig, type GasEstimation, type GenerateAccount, type GenerateAccountWithEd25519, type GenerateAccountWithSingleSignerSecp256k1Key, type GenesisPayload, type GenesisTransactionResponse, type HexInput, type IndexerConfig, type LedgerInfo, type LedgerVersionArg, MimeType, MoveAbility, type MoveAddressType, type MoveFunction, type MoveFunctionGenericTypeParam, type MoveFunctionId, MoveFunctionVisibility, type MoveModule, type MoveModuleBytecode, type MoveModuleId, type MoveObjectType, type MoveOptionType, type MoveResource, type MoveScriptBytecode, type MoveStruct, type MoveStructField, type MoveStructId, type MoveStructType, type MoveType, type MoveUint128Type, type MoveUint16Type, type MoveUint256Type, type MoveUint32Type, type MoveUint64Type, type MoveUint8Type, type MoveValue, type MultisigPayloadResponse, OrderBy, type OrderByArg, type PaginationArgs, type PendingTransactionResponse, RoleType, type ScriptPayloadResponse, ScriptTransactionArgumentVariants, type ScriptWriteSet, SigningScheme, SigningSchemeInput, type StateCheckpointTransactionResponse, type TableItemRequest, TokenStandard, type TokenStandardArg, TransactionAuthenticatorVariant, type TransactionEd25519Signature, type TransactionFeePayerSignature, type TransactionMultiAgentSignature, type TransactionMultiEd25519Signature, type TransactionPayloadResponse, TransactionPayloadVariants, type TransactionResponse, TransactionResponseType, type TransactionSecp256k1Signature, type TransactionSignature, TransactionVariants, TypeTagVariants, type Uint128, type Uint16, type Uint256, type Uint32, type Uint64, type Uint8, type UserTransactionResponse, type ValidatorTransactionResponse, type WaitForTransactionOptions, type WhereArg, type WriteSet, type WriteSetChange, type WriteSetChangeDeleteModule, type WriteSetChangeDeleteResource, type WriteSetChangeDeleteTableItem, type WriteSetChangeWriteModule, type WriteSetChangeWriteResource, type WriteSetChangeWriteTableItem, ZkpVariant, isBlockEpilogueTransactionResponse, isBlockMetadataTransactionResponse, isEd25519Signature, isFeePayerSignature, isGenesisTransactionResponse, isMultiAgentSignature, isMultiEd25519Signature, isPendingTransactionResponse, isSecp256k1Signature, isStateCheckpointTransactionResponse, isUserTransactionResponse, isValidatorTransactionResponse };
|
package/dist/esm/types/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A,B,C,D,E,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-
|
|
1
|
+
import{A,B,C,D,E,F,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-2BJ23DXY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-FVA2OPG4.mjs";export{g as AccountAuthenticatorVariant,h as AnyPublicKeyVariant,i as AnySignatureVariant,F as DeriveScheme,l as EphemeralCertificateVariant,j as EphemeralPublicKeyVariant,k as EphemeralSignatureVariant,a as MimeType,B as MoveAbility,A as MoveFunctionVisibility,C as RoleType,c as ScriptTransactionArgumentVariants,D as SigningScheme,E as SigningSchemeInput,f as TransactionAuthenticatorVariant,d as TransactionPayloadVariants,n as TransactionResponseType,e as TransactionVariants,b as TypeTagVariants,m as ZkpVariant,u as isBlockEpilogueTransactionResponse,r as isBlockMetadataTransactionResponse,v as isEd25519Signature,y as isFeePayerSignature,q as isGenesisTransactionResponse,x as isMultiAgentSignature,z as isMultiEd25519Signature,o as isPendingTransactionResponse,w as isSecp256k1Signature,s as isStateCheckpointTransactionResponse,p as isUserTransactionResponse,t as isValidatorTransactionResponse};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-GED6IT3S.mjs";import{a as q}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-
|
|
1
|
+
import"../chunk-GED6IT3S.mjs";import{a as q}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-2BJ23DXY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o,h as p}from"../chunk-SCHZ67F3.mjs";import{a,b,c,d,e,f,g,h}from"../chunk-L36ZHC7J.mjs";import"../chunk-FVA2OPG4.mjs";export{e as APTOS_COIN,a as AptosApiType,b as DEFAULT_MAX_GAS_AMOUNT,c as DEFAULT_TXN_EXP_SEC_FROM_NOW,d as DEFAULT_TXN_TIMEOUT_SEC,n as Network,o as NetworkToChainId,k as NetworkToFaucetAPI,i as NetworkToIndexerAPI,p as NetworkToNetworkName,j as NetworkToNodeAPI,l as NetworkToPepperAPI,m as NetworkToProverAPI,h as ProcessorType,f as RAW_TRANSACTION_SALT,g as RAW_TRANSACTION_WITH_DATA_SALT,q as normalizeBundle};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-
|
|
1
|
+
import{a}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-2BJ23DXY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{a as normalizeBundle};
|
|
2
2
|
//# sourceMappingURL=normalizeBundle.mjs.map
|
package/dist/esm/version.d.mts
CHANGED
package/dist/esm/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-C6VIBT2D.mjs";import"./chunk-FVA2OPG4.mjs";export{a as VERSION};
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/package.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build:clean": "rm -rf dist",
|
|
37
37
|
"build": "pnpm build:clean && tsup",
|
|
38
|
+
"prepublishOnly": "pnpm run build",
|
|
38
39
|
"_fmt": "prettier 'src/**/*.ts' 'tests/**/*.ts' 'examples/**/*.js' 'examples/**/*.ts' '.eslintrc.js'",
|
|
39
40
|
"fmt": "pnpm _fmt --write",
|
|
40
41
|
"lint": "eslint 'src/**/*.ts' 'tests/**/*.ts' 'examples/**/*.ts'",
|
|
@@ -91,5 +92,5 @@
|
|
|
91
92
|
"typedoc": "^0.25.4",
|
|
92
93
|
"typescript": "^5.3.3"
|
|
93
94
|
},
|
|
94
|
-
"version": "1.
|
|
95
|
+
"version": "1.24.0"
|
|
95
96
|
}
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
KeylessPublicKey,
|
|
12
12
|
KeylessSignature,
|
|
13
13
|
EphemeralCertificate,
|
|
14
|
-
Signature,
|
|
15
14
|
ZeroKnowledgeSig,
|
|
16
15
|
ZkProof,
|
|
17
16
|
} from "../core/crypto";
|
|
@@ -269,9 +268,26 @@ export class KeylessAccount extends Serializable implements Account {
|
|
|
269
268
|
return this.sign(signMess);
|
|
270
269
|
}
|
|
271
270
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
271
|
+
/**
|
|
272
|
+
* Note - This function is currently incomplete and should only be used to verify ownership of the KeylessAccount
|
|
273
|
+
*
|
|
274
|
+
* Verifies a signature given the message.
|
|
275
|
+
*
|
|
276
|
+
* TODO: Groth16 proof verification
|
|
277
|
+
*
|
|
278
|
+
* @param args.message the message that was signed.
|
|
279
|
+
* @param args.signature the KeylessSignature to verify
|
|
280
|
+
* @returns boolean
|
|
281
|
+
*/
|
|
282
|
+
verifySignature(args: { message: HexInput; signature: KeylessSignature }): boolean {
|
|
283
|
+
const { message, signature } = args;
|
|
284
|
+
if (this.isExpired()) {
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
if (!this.ephemeralKeyPair.getPublicKey().verifySignature({ message, signature: signature.ephemeralSignature })) {
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
return true;
|
|
275
291
|
}
|
|
276
292
|
|
|
277
293
|
static fromBytes(bytes: Uint8Array): KeylessAccount {
|
package/src/api/account.ts
CHANGED
|
@@ -439,12 +439,15 @@ export class Account {
|
|
|
439
439
|
*
|
|
440
440
|
* @param args.accountAddress The account address we want to get the total count for
|
|
441
441
|
* @param args.coinType The coin type to query
|
|
442
|
+
* @param args.faMetadataAddress The fungible asset metadata address to query.
|
|
443
|
+
* Note: coinType will automatically fill this in if not provided when migrated to fungible assets
|
|
442
444
|
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
443
445
|
* @returns Current amount of account's coin
|
|
444
446
|
*/
|
|
445
447
|
async getAccountCoinAmount(args: {
|
|
446
448
|
accountAddress: AccountAddressInput;
|
|
447
|
-
coinType
|
|
449
|
+
coinType?: MoveStructId;
|
|
450
|
+
faMetadataAddress?: AccountAddressInput;
|
|
448
451
|
minimumLedgerVersion?: AnyNumber;
|
|
449
452
|
}): Promise<number> {
|
|
450
453
|
await waitForIndexerOnVersion({
|
package/src/api/faucet.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { UserTransactionResponse, WaitForTransactionOptions } from "../types";
|
|
|
6
6
|
import { AccountAddressInput } from "../core";
|
|
7
7
|
import { AptosConfig } from "./aptosConfig";
|
|
8
8
|
import { waitForIndexer } from "../internal/transaction";
|
|
9
|
+
import { ProcessorType } from "../utils";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* A class to query all `Faucet` related queries on Aptos.
|
|
@@ -33,7 +34,11 @@ export class Faucet {
|
|
|
33
34
|
const fundTxn = await fundAccount({ aptosConfig: this.config, ...args });
|
|
34
35
|
|
|
35
36
|
if (args.options?.waitForIndexer !== false) {
|
|
36
|
-
await waitForIndexer({
|
|
37
|
+
await waitForIndexer({
|
|
38
|
+
aptosConfig: this.config,
|
|
39
|
+
minimumLedgerVersion: BigInt(fundTxn.version),
|
|
40
|
+
processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,
|
|
41
|
+
});
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
return fundTxn;
|
package/src/client/core.ts
CHANGED
|
@@ -7,20 +7,6 @@ import { VERSION } from "../version";
|
|
|
7
7
|
import { AnyNumber, AptosRequest, Client, ClientRequest, ClientResponse, MimeType } from "../types";
|
|
8
8
|
import { AptosApiType } from "../utils";
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* Meaningful errors map
|
|
12
|
-
*/
|
|
13
|
-
const errors: Record<number, string> = {
|
|
14
|
-
400: "Bad Request",
|
|
15
|
-
401: "Unauthorized",
|
|
16
|
-
403: "Forbidden",
|
|
17
|
-
404: "Not Found",
|
|
18
|
-
429: "Too Many Requests",
|
|
19
|
-
500: "Internal Server Error",
|
|
20
|
-
502: "Bad Gateway",
|
|
21
|
-
503: "Service Unavailable",
|
|
22
|
-
};
|
|
23
|
-
|
|
24
10
|
/**
|
|
25
11
|
* Given a url and method, sends the request with axios and
|
|
26
12
|
* returns the response.
|
|
@@ -58,71 +44,58 @@ export async function request<Req, Res>(options: ClientRequest<Req>, client: Cli
|
|
|
58
44
|
/**
|
|
59
45
|
* The main function to use when doing an API request.
|
|
60
46
|
*
|
|
61
|
-
* @param
|
|
47
|
+
* @param aptosRequestOpts AptosRequest
|
|
62
48
|
* @param aptosConfig The config information for the SDK client instance
|
|
63
49
|
* @returns the response or AptosApiError
|
|
64
50
|
*/
|
|
65
51
|
export async function aptosRequest<Req extends {}, Res extends {}>(
|
|
66
|
-
|
|
52
|
+
aptosRequestOpts: AptosRequest,
|
|
67
53
|
aptosConfig: AptosConfig,
|
|
68
54
|
apiType: AptosApiType,
|
|
69
55
|
): Promise<AptosResponse<Req, Res>> {
|
|
70
|
-
const { url, path } =
|
|
56
|
+
const { url, path } = aptosRequestOpts;
|
|
71
57
|
const fullUrl = path ? `${url}/${path}` : url;
|
|
72
|
-
const
|
|
58
|
+
const clientResponse = await request<Req, Res>({ ...aptosRequestOpts, url: fullUrl }, aptosConfig.client);
|
|
73
59
|
|
|
74
|
-
const
|
|
75
|
-
status:
|
|
76
|
-
statusText:
|
|
77
|
-
data:
|
|
78
|
-
headers:
|
|
79
|
-
config:
|
|
80
|
-
request:
|
|
60
|
+
const aptosResponse: AptosResponse<Req, Res> = {
|
|
61
|
+
status: clientResponse.status,
|
|
62
|
+
statusText: clientResponse.statusText!,
|
|
63
|
+
data: clientResponse.data,
|
|
64
|
+
headers: clientResponse.headers,
|
|
65
|
+
config: clientResponse.config,
|
|
66
|
+
request: clientResponse.request,
|
|
81
67
|
url: fullUrl,
|
|
82
68
|
};
|
|
83
69
|
|
|
84
70
|
// Handle case for `Unauthorized` error (i.e API_KEY error)
|
|
85
|
-
if (
|
|
86
|
-
throw new AptosApiError(
|
|
71
|
+
if (aptosResponse.status === 401) {
|
|
72
|
+
throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });
|
|
87
73
|
}
|
|
88
74
|
|
|
89
75
|
// to support both fullnode and indexer responses,
|
|
90
76
|
// check if it is an indexer query, and adjust response.data
|
|
91
77
|
if (apiType === AptosApiType.INDEXER) {
|
|
92
|
-
const indexerResponse =
|
|
78
|
+
const indexerResponse = aptosResponse.data as any;
|
|
93
79
|
// Handle Indexer general errors
|
|
94
80
|
if (indexerResponse.errors) {
|
|
95
|
-
throw new AptosApiError(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
);
|
|
81
|
+
throw new AptosApiError({
|
|
82
|
+
apiType,
|
|
83
|
+
aptosRequest: aptosRequestOpts,
|
|
84
|
+
aptosResponse,
|
|
85
|
+
});
|
|
101
86
|
}
|
|
102
|
-
|
|
87
|
+
aptosResponse.data = indexerResponse.data as Res;
|
|
103
88
|
} else if (apiType === AptosApiType.PEPPER || apiType === AptosApiType.PROVER) {
|
|
104
|
-
if (
|
|
105
|
-
throw new AptosApiError(
|
|
89
|
+
if (aptosResponse.status >= 400) {
|
|
90
|
+
throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });
|
|
106
91
|
}
|
|
107
92
|
}
|
|
108
93
|
|
|
109
|
-
if (
|
|
110
|
-
return
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
let errorMessage: string;
|
|
114
|
-
|
|
115
|
-
if (result && result.data && "message" in result.data && "error_code" in result.data) {
|
|
116
|
-
errorMessage = JSON.stringify(result.data);
|
|
117
|
-
} else if (result.status in errors) {
|
|
118
|
-
// If it's not an API type, it must come form infra, these are prehandled
|
|
119
|
-
errorMessage = errors[result.status];
|
|
120
|
-
} else {
|
|
121
|
-
// Everything else is unhandled
|
|
122
|
-
errorMessage = `Unhandled Error ${result.status} : ${result.statusText}`;
|
|
94
|
+
if (aptosResponse.status >= 200 && aptosResponse.status < 300) {
|
|
95
|
+
return aptosResponse;
|
|
123
96
|
}
|
|
124
97
|
|
|
125
98
|
// We have to explicitly check for all request types, because if the error is a non-indexer error, but
|
|
126
99
|
// comes from an indexer request (e.g. 404), we'll need to mention it appropriately
|
|
127
|
-
throw new AptosApiError(
|
|
100
|
+
throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });
|
|
128
101
|
}
|
package/src/client/types.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { AptosRequest } from "../types";
|
|
5
|
+
import { AptosApiType } from "../utils/const.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* The API response type
|
|
@@ -24,6 +25,12 @@ export interface AptosResponse<Req, Res> {
|
|
|
24
25
|
request?: Req;
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
type AptosApiErrorOpts = {
|
|
29
|
+
apiType: AptosApiType;
|
|
30
|
+
aptosRequest: AptosRequest;
|
|
31
|
+
aptosResponse: AptosResponse<any, any>;
|
|
32
|
+
};
|
|
33
|
+
|
|
27
34
|
/**
|
|
28
35
|
* The type returned from an API error
|
|
29
36
|
*
|
|
@@ -45,14 +52,60 @@ export class AptosApiError extends Error {
|
|
|
45
52
|
|
|
46
53
|
readonly request: AptosRequest;
|
|
47
54
|
|
|
48
|
-
constructor
|
|
49
|
-
|
|
55
|
+
/** @internal this constructor is for sdk internal use - do not instantiate outside of the SDK codebase */
|
|
56
|
+
constructor({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts) {
|
|
57
|
+
super(deriveErrorMessage({ apiType, aptosRequest, aptosResponse }));
|
|
50
58
|
|
|
51
59
|
this.name = "AptosApiError";
|
|
52
|
-
this.url =
|
|
53
|
-
this.status =
|
|
54
|
-
this.statusText =
|
|
55
|
-
this.data =
|
|
56
|
-
this.request =
|
|
60
|
+
this.url = aptosResponse.url;
|
|
61
|
+
this.status = aptosResponse.status;
|
|
62
|
+
this.statusText = aptosResponse.statusText;
|
|
63
|
+
this.data = aptosResponse.data;
|
|
64
|
+
this.request = aptosRequest;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function deriveErrorMessage({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts): string {
|
|
69
|
+
// extract the W3C trace_id from the response headers if it exists. Some services set this in the response and it's useful for debugging.
|
|
70
|
+
// See https://www.w3.org/TR/trace-context/#relationship-between-the-headers .
|
|
71
|
+
const traceId = aptosResponse.headers?.traceparent?.split("-")[1];
|
|
72
|
+
const traceIdString = traceId ? `(trace_id:${traceId}) ` : "";
|
|
73
|
+
|
|
74
|
+
const errorPrelude: string = `Request to [${apiType}]: ${aptosRequest.method} ${
|
|
75
|
+
aptosResponse.url ?? aptosRequest.url
|
|
76
|
+
} ${traceIdString}failed with`;
|
|
77
|
+
|
|
78
|
+
// handle graphql responses from indexer api and extract the error message of the first error
|
|
79
|
+
if (apiType === AptosApiType.INDEXER && aptosResponse.data?.errors?.[0]?.message != null) {
|
|
80
|
+
return `${errorPrelude}: ${aptosResponse.data.errors[0].message}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Received well-known structured error response body - simply serialize and return it.
|
|
84
|
+
// We don't need http status codes etc. in this case.
|
|
85
|
+
if (aptosResponse.data?.message != null && aptosResponse.data?.error_code != null) {
|
|
86
|
+
return `${errorPrelude}: ${JSON.stringify(aptosResponse.data)}`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// This is the generic/catch-all case. We received some response from the API but it doesn't appear to be a well-known structure.
|
|
90
|
+
// We print http status codes and the response body (after some trimming),
|
|
91
|
+
// in the hope that this gives enough context what went wrong without printing overly huge messages.
|
|
92
|
+
return `${errorPrelude} status: ${aptosResponse.statusText}(code:${
|
|
93
|
+
aptosResponse.status
|
|
94
|
+
}) and response body: ${serializeAnyPayloadForErrorMessage(aptosResponse.data)}`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH = 400;
|
|
98
|
+
|
|
99
|
+
// this function accepts a payload of any type (probably an object) and serializes it to a string
|
|
100
|
+
// Since we don't know the type or size of the payload and we don't want to add a huge object in full to the error message
|
|
101
|
+
// we limit the to the first 200 and last 200 characters of the serialized payload and put a "..." in the middle.
|
|
102
|
+
function serializeAnyPayloadForErrorMessage(payload: any): string {
|
|
103
|
+
const serializedPayload = JSON.stringify(payload);
|
|
104
|
+
if (serializedPayload.length <= SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH) {
|
|
105
|
+
return serializedPayload;
|
|
57
106
|
}
|
|
107
|
+
return `truncated(original_size:${serializedPayload.length}): ${serializedPayload.slice(
|
|
108
|
+
0,
|
|
109
|
+
SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH / 2,
|
|
110
|
+
)}...${serializedPayload.slice(-SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH / 2)}`;
|
|
58
111
|
}
|
|
@@ -65,6 +65,8 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
65
65
|
|
|
66
66
|
static FOUR: AccountAddress = AccountAddress.from("0x4");
|
|
67
67
|
|
|
68
|
+
static A: AccountAddress = AccountAddress.from("0xA");
|
|
69
|
+
|
|
68
70
|
/**
|
|
69
71
|
* Creates an instance of AccountAddress from a Uint8Array.
|
|
70
72
|
*
|
|
@@ -342,13 +344,13 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
342
344
|
* @param input
|
|
343
345
|
*/
|
|
344
346
|
static from(input: AccountAddressInput): AccountAddress {
|
|
345
|
-
if (input
|
|
346
|
-
return input;
|
|
347
|
+
if (typeof input === "string") {
|
|
348
|
+
return AccountAddress.fromString(input);
|
|
347
349
|
}
|
|
348
350
|
if (input instanceof Uint8Array) {
|
|
349
351
|
return new AccountAddress(input);
|
|
350
352
|
}
|
|
351
|
-
return
|
|
353
|
+
return input;
|
|
352
354
|
}
|
|
353
355
|
|
|
354
356
|
/**
|
|
@@ -358,13 +360,13 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
358
360
|
* @param input
|
|
359
361
|
*/
|
|
360
362
|
static fromStrict(input: AccountAddressInput): AccountAddress {
|
|
361
|
-
if (input
|
|
362
|
-
return input;
|
|
363
|
+
if (typeof input === "string") {
|
|
364
|
+
return AccountAddress.fromStringStrict(input);
|
|
363
365
|
}
|
|
364
366
|
if (input instanceof Uint8Array) {
|
|
365
367
|
return new AccountAddress(input);
|
|
366
368
|
}
|
|
367
|
-
return
|
|
369
|
+
return input;
|
|
368
370
|
}
|
|
369
371
|
|
|
370
372
|
// ===
|
|
@@ -9,7 +9,7 @@ import { Hex } from "../hex";
|
|
|
9
9
|
import { HexInput, SigningScheme as AuthenticationKeyScheme } from "../../types";
|
|
10
10
|
import { CKDPriv, deriveKey, HARDENED_OFFSET, isValidHardenedPath, mnemonicToSeed, splitPath } from "./hdKey";
|
|
11
11
|
import { PrivateKey } from "./privateKey";
|
|
12
|
-
import { AccountPublicKey, VerifySignatureArgs } from "./publicKey";
|
|
12
|
+
import { AccountPublicKey, PublicKey, VerifySignatureArgs } from "./publicKey";
|
|
13
13
|
import { Signature } from "./signature";
|
|
14
14
|
import { convertSigningMessage } from "./utils";
|
|
15
15
|
|
|
@@ -21,6 +21,26 @@ const L: number[] = [
|
|
|
21
21
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
|
|
22
22
|
];
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Checks if an ED25519 signature is non-canonical.
|
|
26
|
+
*
|
|
27
|
+
* Comes from Aptos Core
|
|
28
|
+
* https://github.com/aptos-labs/aptos-core/blob/main/crates/aptos-crypto/src/ed25519/ed25519_sigs.rs#L47-L85
|
|
29
|
+
*/
|
|
30
|
+
export function isCanonicalEd25519Signature(signature: Signature): boolean {
|
|
31
|
+
const s = signature.toUint8Array().slice(32);
|
|
32
|
+
for (let i = L.length - 1; i >= 0; i -= 1) {
|
|
33
|
+
if (s[i] < L[i]) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
if (s[i] > L[i]) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// As this stage S == L which implies a non-canonical S.
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
24
44
|
/**
|
|
25
45
|
* Represents the public key of an Ed25519 key pair.
|
|
26
46
|
*
|
|
@@ -66,18 +86,15 @@ export class Ed25519PublicKey extends AccountPublicKey {
|
|
|
66
86
|
*/
|
|
67
87
|
verifySignature(args: VerifySignatureArgs): boolean {
|
|
68
88
|
const { message, signature } = args;
|
|
69
|
-
|
|
89
|
+
// Verify malleability
|
|
90
|
+
if (!isCanonicalEd25519Signature(signature)) {
|
|
70
91
|
return false;
|
|
71
92
|
}
|
|
93
|
+
|
|
72
94
|
const messageToVerify = convertSigningMessage(message);
|
|
73
95
|
const messageBytes = Hex.fromHexInput(messageToVerify).toUint8Array();
|
|
74
96
|
const signatureBytes = signature.toUint8Array();
|
|
75
97
|
const publicKeyBytes = this.key.toUint8Array();
|
|
76
|
-
// Also verify malleability
|
|
77
|
-
if (!signature.isCanonicalSignature()) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
98
|
return ed25519.verify(signatureBytes, messageBytes, publicKeyBytes);
|
|
82
99
|
}
|
|
83
100
|
|
|
@@ -118,6 +135,10 @@ export class Ed25519PublicKey extends AccountPublicKey {
|
|
|
118
135
|
static isPublicKey(publicKey: AccountPublicKey): publicKey is Ed25519PublicKey {
|
|
119
136
|
return publicKey instanceof Ed25519PublicKey;
|
|
120
137
|
}
|
|
138
|
+
|
|
139
|
+
static isInstance(publicKey: PublicKey): publicKey is Ed25519PublicKey {
|
|
140
|
+
return "key" in publicKey && (publicKey.key as any)?.data?.length === Ed25519PublicKey.LENGTH;
|
|
141
|
+
}
|
|
121
142
|
}
|
|
122
143
|
|
|
123
144
|
/**
|
|
@@ -325,26 +346,5 @@ export class Ed25519Signature extends Signature {
|
|
|
325
346
|
return new Ed25519Signature(bytes);
|
|
326
347
|
}
|
|
327
348
|
|
|
328
|
-
/**
|
|
329
|
-
* Checks if an ED25519 signature is non-canonical.
|
|
330
|
-
*
|
|
331
|
-
* Comes from Aptos Core
|
|
332
|
-
* https://github.com/aptos-labs/aptos-core/blob/main/crates/aptos-crypto/src/ed25519/ed25519_sigs.rs#L47-L85
|
|
333
|
-
*/
|
|
334
|
-
isCanonicalSignature(): boolean {
|
|
335
|
-
const s = this.toUint8Array().slice(32);
|
|
336
|
-
|
|
337
|
-
for (let i = s.length - 1; i >= 0; i -= 1) {
|
|
338
|
-
if (s[i] < L[i]) {
|
|
339
|
-
return true;
|
|
340
|
-
}
|
|
341
|
-
if (s[i] > L[i]) {
|
|
342
|
-
return false;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
// As this stage S == L which implies a non-canonical S.
|
|
346
|
-
return false;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
349
|
// endregion
|
|
350
350
|
}
|
|
@@ -52,7 +52,7 @@ export class EphemeralPublicKey extends PublicKey {
|
|
|
52
52
|
*/
|
|
53
53
|
verifySignature(args: { message: HexInput; signature: EphemeralSignature }): boolean {
|
|
54
54
|
const { message, signature } = args;
|
|
55
|
-
return this.publicKey.verifySignature({ message, signature });
|
|
55
|
+
return this.publicKey.verifySignature({ message, signature: signature.signature });
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
serialize(serializer: Serializer): void {
|
|
@@ -166,6 +166,15 @@ export class KeylessPublicKey extends AccountPublicKey {
|
|
|
166
166
|
const uidVal = jwtPayload[uidKey];
|
|
167
167
|
return KeylessPublicKey.create({ iss, uidKey, uidVal, aud, pepper });
|
|
168
168
|
}
|
|
169
|
+
|
|
170
|
+
static isInstance(publicKey: PublicKey) {
|
|
171
|
+
return (
|
|
172
|
+
"iss" in publicKey &&
|
|
173
|
+
typeof publicKey.iss === "string" &&
|
|
174
|
+
"idCommitment" in publicKey &&
|
|
175
|
+
publicKey.idCommitment instanceof Uint8Array
|
|
176
|
+
);
|
|
177
|
+
}
|
|
169
178
|
}
|
|
170
179
|
|
|
171
180
|
function computeIdCommitment(args: { uidKey: string; uidVal: string; aud: string; pepper: HexInput }): Uint8Array {
|
|
@@ -48,9 +48,6 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
48
48
|
*/
|
|
49
49
|
verifySignature(args: VerifySignatureArgs): boolean {
|
|
50
50
|
const { message, signature } = args;
|
|
51
|
-
if (!(signature instanceof Secp256k1Signature)) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
51
|
const messageToVerify = convertSigningMessage(message);
|
|
55
52
|
const messageBytes = Hex.fromHexInput(messageToVerify).toUint8Array();
|
|
56
53
|
const messageSha3Bytes = sha3_256(messageBytes);
|
|
@@ -84,6 +81,10 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
84
81
|
static isPublicKey(publicKey: PublicKey): publicKey is Secp256k1PublicKey {
|
|
85
82
|
return publicKey instanceof Secp256k1PublicKey;
|
|
86
83
|
}
|
|
84
|
+
|
|
85
|
+
static isInstance(publicKey: PublicKey): publicKey is Secp256k1PublicKey {
|
|
86
|
+
return "key" in publicKey && (publicKey.key as any)?.data?.length === Secp256k1PublicKey.LENGTH;
|
|
87
|
+
}
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
/**
|
|
@@ -48,7 +48,7 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
48
48
|
|
|
49
49
|
verifySignature(args: VerifySignatureArgs): boolean {
|
|
50
50
|
const { message, signature } = args;
|
|
51
|
-
if (!(signature
|
|
51
|
+
if (!AnySignature.isInstance(signature)) {
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -119,6 +119,10 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
119
119
|
isSecp256k1PublicKey(): boolean {
|
|
120
120
|
return this.publicKey instanceof Secp256k1PublicKey;
|
|
121
121
|
}
|
|
122
|
+
|
|
123
|
+
static isInstance(publicKey: PublicKey): publicKey is AnyPublicKey {
|
|
124
|
+
return "publicKey" in publicKey && "variant" in publicKey;
|
|
125
|
+
}
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
/**
|
|
@@ -156,6 +160,12 @@ export class AnySignature extends Signature {
|
|
|
156
160
|
// region AccountSignature
|
|
157
161
|
|
|
158
162
|
toUint8Array() {
|
|
163
|
+
// TODO: keep this warning around for a bit, and eventually change this to return `this.signature.toUint8Array()`.
|
|
164
|
+
// eslint-disable-next-line no-console
|
|
165
|
+
console.warn(
|
|
166
|
+
"[Aptos SDK] Calls to AnySignature.toUint8Array() will soon return the underlying signature bytes. " +
|
|
167
|
+
"Use AnySignature.bcsToBytes() instead.",
|
|
168
|
+
);
|
|
159
169
|
return this.bcsToBytes();
|
|
160
170
|
}
|
|
161
171
|
|
|
@@ -188,4 +198,13 @@ export class AnySignature extends Signature {
|
|
|
188
198
|
}
|
|
189
199
|
|
|
190
200
|
// endregion
|
|
201
|
+
|
|
202
|
+
static isInstance(signature: Signature): signature is AnySignature {
|
|
203
|
+
return (
|
|
204
|
+
"signature" in signature &&
|
|
205
|
+
typeof signature.signature === "object" &&
|
|
206
|
+
signature.signature !== null &&
|
|
207
|
+
"toUint8Array" in signature.signature
|
|
208
|
+
);
|
|
209
|
+
}
|
|
191
210
|
}
|