@aptos-labs/ts-sdk 1.22.2 → 1.23.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 +28 -8
- 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-2ZAYK464.mjs → chunk-243IMA3Y.mjs} +2 -2
- package/dist/esm/chunk-2BJ23DXY.mjs +2 -0
- package/dist/esm/chunk-2BJ23DXY.mjs.map +1 -0
- package/dist/esm/chunk-2M45ESQN.mjs +2 -0
- package/dist/esm/{chunk-QA7VTFUT.mjs.map → chunk-2M45ESQN.mjs.map} +1 -1
- package/dist/esm/{chunk-D6WTINSF.mjs → chunk-2SGICMXB.mjs} +2 -2
- package/dist/esm/{chunk-GEP4HPQ6.mjs → chunk-3CB53WTP.mjs} +2 -2
- package/dist/esm/{chunk-5IRM54PL.mjs → chunk-3JFX3XDA.mjs} +2 -2
- package/dist/esm/{chunk-XYWMFCL6.mjs → chunk-4FMAPHUM.mjs} +2 -2
- package/dist/esm/{chunk-UYF7AQLE.mjs → chunk-4R7FL2G2.mjs} +2 -2
- package/dist/esm/{chunk-W5ZII3JO.mjs → chunk-4ZDOOSRJ.mjs} +2 -2
- package/dist/esm/{chunk-OAKHR7AG.mjs → chunk-5OR2POPO.mjs} +2 -2
- package/dist/esm/{chunk-A2Z7I2EY.mjs → chunk-6WAXFWLH.mjs} +2 -2
- package/dist/esm/{chunk-XCNNMSVO.mjs → chunk-72QKG5N2.mjs} +2 -2
- package/dist/esm/{chunk-Z4OZBMSL.mjs → chunk-7F7AIMGB.mjs} +2 -2
- package/dist/esm/{chunk-U2QQD2ER.mjs → chunk-B4ROOQE3.mjs} +2 -2
- package/dist/esm/chunk-B4ROOQE3.mjs.map +1 -0
- package/dist/esm/{chunk-HFOLSSAQ.mjs → chunk-BDD6OBUV.mjs} +2 -2
- package/dist/esm/{chunk-O4O7HSUQ.mjs → chunk-BEXHZ5XT.mjs} +2 -2
- package/dist/esm/{chunk-TY4IEDJD.mjs → chunk-BFRFAX5I.mjs} +2 -2
- package/dist/esm/{chunk-37Y7VAN7.mjs → chunk-BQ7OOQRE.mjs} +2 -2
- package/dist/esm/{chunk-IMF5XUVW.mjs → chunk-BQIT7TKM.mjs} +2 -2
- package/dist/esm/{chunk-BF3D6ADE.mjs → chunk-D6DCZULX.mjs} +2 -2
- package/dist/esm/chunk-D6QSRB4J.mjs +2 -0
- package/dist/esm/chunk-D6QSRB4J.mjs.map +1 -0
- package/dist/esm/{chunk-WTJCMD4D.mjs → chunk-DAEUQBVZ.mjs} +2 -2
- package/dist/esm/{chunk-4EPLOSKY.mjs → chunk-EMFVGL2Y.mjs} +2 -2
- package/dist/esm/{chunk-OTK3HBAU.mjs → chunk-ES5Z33UX.mjs} +2 -2
- package/dist/esm/{chunk-XBTCOCZJ.mjs → chunk-F435LQUS.mjs} +2 -2
- package/dist/esm/{chunk-DM6HVA4K.mjs → chunk-FAFN34ZH.mjs} +2 -2
- package/dist/esm/{chunk-4ZXCQXVC.mjs → chunk-FE6CYBDF.mjs} +2 -2
- package/dist/esm/{chunk-6DDSU7HN.mjs → chunk-FRUEQTCC.mjs} +2 -2
- package/dist/esm/{chunk-H4XMI4WZ.mjs → chunk-FSTRZMCK.mjs} +2 -2
- package/dist/esm/{chunk-OPGMT27G.mjs → chunk-FZ3HMVKE.mjs} +2 -2
- package/dist/esm/{chunk-RFA7BIDN.mjs → chunk-GBZOWPC6.mjs} +2 -2
- package/dist/esm/{chunk-PVEPP4HR.mjs → chunk-GP3RTNYN.mjs} +2 -2
- package/dist/esm/chunk-IR6L77JS.mjs +2 -0
- package/dist/esm/chunk-IR6L77JS.mjs.map +1 -0
- package/dist/esm/{chunk-6XCZ56O7.mjs → chunk-IUAAMX5V.mjs} +2 -2
- package/dist/esm/{chunk-XFBB7YYI.mjs → chunk-IZ7OGJBY.mjs} +2 -2
- package/dist/esm/{chunk-UIJK42CX.mjs → chunk-J26STL4T.mjs} +2 -2
- package/dist/esm/{chunk-3VUSIKCF.mjs → chunk-J4KAYDPB.mjs} +2 -2
- package/dist/esm/chunk-J6NLU6QX.mjs +2 -0
- package/dist/esm/chunk-J6NLU6QX.mjs.map +1 -0
- package/dist/esm/{chunk-U7I7YKWD.mjs → chunk-K7OBPPSF.mjs} +2 -2
- package/dist/esm/{chunk-XWAOZPIP.mjs → chunk-L7FA4ISG.mjs} +2 -2
- package/dist/esm/{chunk-WL4FXFAM.mjs → chunk-MA7TL5VN.mjs} +2 -2
- package/dist/esm/{chunk-XT2VVDT3.mjs → chunk-ME2PENQD.mjs} +2 -2
- package/dist/esm/{chunk-RFMLKHUD.mjs → chunk-MG3T24A3.mjs} +2 -2
- package/dist/esm/{chunk-RS2FIBMQ.mjs → chunk-NC3KKAAK.mjs} +2 -2
- package/dist/esm/{chunk-K7Y2SC65.mjs → chunk-NJ2IXXY2.mjs} +2 -2
- package/dist/esm/{chunk-EIKBYKIJ.mjs → chunk-OBKVMO7I.mjs} +2 -2
- package/dist/esm/{chunk-6AJLTBXC.mjs → chunk-ODYVU346.mjs} +2 -2
- package/dist/esm/{chunk-NBJFTE2P.mjs → chunk-OID45FCB.mjs} +2 -2
- package/dist/esm/{chunk-EPVAT625.mjs → chunk-OUAQKVIC.mjs} +2 -2
- package/dist/esm/{chunk-C2IJG37E.mjs → chunk-PDOQLTXA.mjs} +2 -2
- package/dist/esm/{chunk-B6PLCJJ2.mjs → chunk-PF54PEHF.mjs} +2 -2
- package/dist/esm/{chunk-GCPWPGCS.mjs → chunk-PIUICROW.mjs} +2 -2
- package/dist/esm/{chunk-GGU4XOUO.mjs → chunk-QLKTSSVC.mjs} +2 -2
- package/dist/esm/chunk-QUMSKIYX.mjs +2 -0
- package/dist/esm/{chunk-Y2DHN4CV.mjs.map → chunk-QUMSKIYX.mjs.map} +1 -1
- package/dist/esm/{chunk-NRAQZUD5.mjs → chunk-RBIJJSGB.mjs} +2 -2
- package/dist/esm/{chunk-JY5LTRTM.mjs → chunk-RZKLIZ2D.mjs} +2 -2
- package/dist/esm/chunk-T52HPGL5.mjs +2 -0
- package/dist/esm/chunk-T52HPGL5.mjs.map +1 -0
- package/dist/esm/{chunk-6TWRNWC3.mjs → chunk-T7MGIHWV.mjs} +2 -2
- package/dist/esm/{chunk-5E672SHG.mjs → chunk-T7WBGP37.mjs} +2 -2
- package/dist/esm/{chunk-5E672SHG.mjs.map → chunk-T7WBGP37.mjs.map} +1 -1
- package/dist/esm/chunk-TDGQGILY.mjs +2 -0
- package/dist/esm/chunk-TDGQGILY.mjs.map +1 -0
- package/dist/esm/{chunk-CPCS5KIA.mjs → chunk-UY4EIN3P.mjs} +2 -2
- package/dist/esm/{chunk-EKZHYOQH.mjs → chunk-V3NKDUY5.mjs} +2 -2
- package/dist/esm/{chunk-FEGCUPGO.mjs → chunk-VA4HKHNV.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-77NXCSLY.mjs → chunk-WPYVWZQS.mjs} +2 -2
- package/dist/esm/{chunk-BF46IXHH.mjs → chunk-WSE653RS.mjs} +2 -2
- package/dist/esm/chunk-WSE653RS.mjs.map +1 -0
- package/dist/esm/{chunk-EOJWPF3P.mjs → chunk-X2QSDREG.mjs} +2 -2
- package/dist/esm/{chunk-6ZQWPHLV.mjs → chunk-XWVMFCW3.mjs} +2 -2
- package/dist/esm/{chunk-FC7IRFFN.mjs → chunk-Y5AY3QBY.mjs} +2 -2
- package/dist/esm/{chunk-BN2PXCFR.mjs → chunk-YEISKUKC.mjs} +2 -2
- package/dist/esm/{chunk-OYLT6IVC.mjs → chunk-ZE2TCKUL.mjs} +2 -2
- package/dist/esm/{chunk-VBPDZZXC.mjs → chunk-ZHNCJSXO.mjs} +2 -2
- package/dist/esm/{chunk-42XNGDUC.mjs → chunk-ZKCSQAGW.mjs} +2 -2
- package/dist/esm/{chunk-YDXU6ALO.mjs → chunk-ZMFVKUFD.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.mjs +1 -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.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.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 +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/client/core.ts +25 -52
- package/src/client/types.ts +60 -7
- package/src/core/accountAddress.ts +2 -0
- package/src/core/crypto/ephemeral.ts +1 -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/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-7LY73OAN.mjs +0 -2
- package/dist/esm/chunk-7LY73OAN.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-MI732NUU.mjs +0 -2
- package/dist/esm/chunk-MI732NUU.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-Y2DHN4CV.mjs +0 -2
- package/dist/esm/chunk-YMFEA2TJ.mjs.map +0 -1
- /package/dist/esm/{chunk-2ZAYK464.mjs.map → chunk-243IMA3Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-D6WTINSF.mjs.map → chunk-2SGICMXB.mjs.map} +0 -0
- /package/dist/esm/{chunk-GEP4HPQ6.mjs.map → chunk-3CB53WTP.mjs.map} +0 -0
- /package/dist/esm/{chunk-5IRM54PL.mjs.map → chunk-3JFX3XDA.mjs.map} +0 -0
- /package/dist/esm/{chunk-XYWMFCL6.mjs.map → chunk-4FMAPHUM.mjs.map} +0 -0
- /package/dist/esm/{chunk-UYF7AQLE.mjs.map → chunk-4R7FL2G2.mjs.map} +0 -0
- /package/dist/esm/{chunk-W5ZII3JO.mjs.map → chunk-4ZDOOSRJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-OAKHR7AG.mjs.map → chunk-5OR2POPO.mjs.map} +0 -0
- /package/dist/esm/{chunk-A2Z7I2EY.mjs.map → chunk-6WAXFWLH.mjs.map} +0 -0
- /package/dist/esm/{chunk-XCNNMSVO.mjs.map → chunk-72QKG5N2.mjs.map} +0 -0
- /package/dist/esm/{chunk-Z4OZBMSL.mjs.map → chunk-7F7AIMGB.mjs.map} +0 -0
- /package/dist/esm/{chunk-HFOLSSAQ.mjs.map → chunk-BDD6OBUV.mjs.map} +0 -0
- /package/dist/esm/{chunk-O4O7HSUQ.mjs.map → chunk-BEXHZ5XT.mjs.map} +0 -0
- /package/dist/esm/{chunk-TY4IEDJD.mjs.map → chunk-BFRFAX5I.mjs.map} +0 -0
- /package/dist/esm/{chunk-37Y7VAN7.mjs.map → chunk-BQ7OOQRE.mjs.map} +0 -0
- /package/dist/esm/{chunk-IMF5XUVW.mjs.map → chunk-BQIT7TKM.mjs.map} +0 -0
- /package/dist/esm/{chunk-BF3D6ADE.mjs.map → chunk-D6DCZULX.mjs.map} +0 -0
- /package/dist/esm/{chunk-WTJCMD4D.mjs.map → chunk-DAEUQBVZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-4EPLOSKY.mjs.map → chunk-EMFVGL2Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-OTK3HBAU.mjs.map → chunk-ES5Z33UX.mjs.map} +0 -0
- /package/dist/esm/{chunk-XBTCOCZJ.mjs.map → chunk-F435LQUS.mjs.map} +0 -0
- /package/dist/esm/{chunk-DM6HVA4K.mjs.map → chunk-FAFN34ZH.mjs.map} +0 -0
- /package/dist/esm/{chunk-4ZXCQXVC.mjs.map → chunk-FE6CYBDF.mjs.map} +0 -0
- /package/dist/esm/{chunk-6DDSU7HN.mjs.map → chunk-FRUEQTCC.mjs.map} +0 -0
- /package/dist/esm/{chunk-H4XMI4WZ.mjs.map → chunk-FSTRZMCK.mjs.map} +0 -0
- /package/dist/esm/{chunk-OPGMT27G.mjs.map → chunk-FZ3HMVKE.mjs.map} +0 -0
- /package/dist/esm/{chunk-RFA7BIDN.mjs.map → chunk-GBZOWPC6.mjs.map} +0 -0
- /package/dist/esm/{chunk-PVEPP4HR.mjs.map → chunk-GP3RTNYN.mjs.map} +0 -0
- /package/dist/esm/{chunk-6XCZ56O7.mjs.map → chunk-IUAAMX5V.mjs.map} +0 -0
- /package/dist/esm/{chunk-XFBB7YYI.mjs.map → chunk-IZ7OGJBY.mjs.map} +0 -0
- /package/dist/esm/{chunk-UIJK42CX.mjs.map → chunk-J26STL4T.mjs.map} +0 -0
- /package/dist/esm/{chunk-3VUSIKCF.mjs.map → chunk-J4KAYDPB.mjs.map} +0 -0
- /package/dist/esm/{chunk-U7I7YKWD.mjs.map → chunk-K7OBPPSF.mjs.map} +0 -0
- /package/dist/esm/{chunk-XWAOZPIP.mjs.map → chunk-L7FA4ISG.mjs.map} +0 -0
- /package/dist/esm/{chunk-WL4FXFAM.mjs.map → chunk-MA7TL5VN.mjs.map} +0 -0
- /package/dist/esm/{chunk-XT2VVDT3.mjs.map → chunk-ME2PENQD.mjs.map} +0 -0
- /package/dist/esm/{chunk-RFMLKHUD.mjs.map → chunk-MG3T24A3.mjs.map} +0 -0
- /package/dist/esm/{chunk-RS2FIBMQ.mjs.map → chunk-NC3KKAAK.mjs.map} +0 -0
- /package/dist/esm/{chunk-K7Y2SC65.mjs.map → chunk-NJ2IXXY2.mjs.map} +0 -0
- /package/dist/esm/{chunk-EIKBYKIJ.mjs.map → chunk-OBKVMO7I.mjs.map} +0 -0
- /package/dist/esm/{chunk-6AJLTBXC.mjs.map → chunk-ODYVU346.mjs.map} +0 -0
- /package/dist/esm/{chunk-NBJFTE2P.mjs.map → chunk-OID45FCB.mjs.map} +0 -0
- /package/dist/esm/{chunk-EPVAT625.mjs.map → chunk-OUAQKVIC.mjs.map} +0 -0
- /package/dist/esm/{chunk-C2IJG37E.mjs.map → chunk-PDOQLTXA.mjs.map} +0 -0
- /package/dist/esm/{chunk-B6PLCJJ2.mjs.map → chunk-PF54PEHF.mjs.map} +0 -0
- /package/dist/esm/{chunk-GCPWPGCS.mjs.map → chunk-PIUICROW.mjs.map} +0 -0
- /package/dist/esm/{chunk-GGU4XOUO.mjs.map → chunk-QLKTSSVC.mjs.map} +0 -0
- /package/dist/esm/{chunk-NRAQZUD5.mjs.map → chunk-RBIJJSGB.mjs.map} +0 -0
- /package/dist/esm/{chunk-JY5LTRTM.mjs.map → chunk-RZKLIZ2D.mjs.map} +0 -0
- /package/dist/esm/{chunk-6TWRNWC3.mjs.map → chunk-T7MGIHWV.mjs.map} +0 -0
- /package/dist/esm/{chunk-CPCS5KIA.mjs.map → chunk-UY4EIN3P.mjs.map} +0 -0
- /package/dist/esm/{chunk-EKZHYOQH.mjs.map → chunk-V3NKDUY5.mjs.map} +0 -0
- /package/dist/esm/{chunk-FEGCUPGO.mjs.map → chunk-VA4HKHNV.mjs.map} +0 -0
- /package/dist/esm/{chunk-77NXCSLY.mjs.map → chunk-WPYVWZQS.mjs.map} +0 -0
- /package/dist/esm/{chunk-EOJWPF3P.mjs.map → chunk-X2QSDREG.mjs.map} +0 -0
- /package/dist/esm/{chunk-6ZQWPHLV.mjs.map → chunk-XWVMFCW3.mjs.map} +0 -0
- /package/dist/esm/{chunk-FC7IRFFN.mjs.map → chunk-Y5AY3QBY.mjs.map} +0 -0
- /package/dist/esm/{chunk-BN2PXCFR.mjs.map → chunk-YEISKUKC.mjs.map} +0 -0
- /package/dist/esm/{chunk-OYLT6IVC.mjs.map → chunk-ZE2TCKUL.mjs.map} +0 -0
- /package/dist/esm/{chunk-VBPDZZXC.mjs.map → chunk-ZHNCJSXO.mjs.map} +0 -0
- /package/dist/esm/{chunk-42XNGDUC.mjs.map → chunk-ZKCSQAGW.mjs.map} +0 -0
- /package/dist/esm/{chunk-YDXU6ALO.mjs.map → chunk-ZMFVKUFD.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-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-
|
|
1
|
+
import"../chunk-GED6IT3S.mjs";import{a as q}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-2BJ23DXY.mjs";import"../chunk-4WPQQPUF.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-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-
|
|
1
|
+
import{a}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-2BJ23DXY.mjs";import"../chunk-4WPQQPUF.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-2M45ESQN.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.23.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/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
|
*
|
|
@@ -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 {
|
package/src/internal/account.ts
CHANGED
|
@@ -52,9 +52,10 @@ import {
|
|
|
52
52
|
GetAccountTransactionsCount,
|
|
53
53
|
} from "../types/generated/queries";
|
|
54
54
|
import { memoizeAsync } from "../utils/memoize";
|
|
55
|
-
import { Secp256k1PrivateKey, AuthenticationKey, Ed25519PrivateKey } from "../core";
|
|
55
|
+
import { Secp256k1PrivateKey, AuthenticationKey, Ed25519PrivateKey, createObjectAddress } from "../core";
|
|
56
56
|
import { CurrentFungibleAssetBalancesBoolExp } from "../types/generated/types";
|
|
57
57
|
import { getTableItem } from "./table";
|
|
58
|
+
import { APTOS_COIN } from "../utils";
|
|
58
59
|
|
|
59
60
|
export async function getInfo(args: {
|
|
60
61
|
aptosConfig: AptosConfig;
|
|
@@ -404,16 +405,46 @@ export async function getAccountTransactionsCount(args: {
|
|
|
404
405
|
export async function getAccountCoinAmount(args: {
|
|
405
406
|
aptosConfig: AptosConfig;
|
|
406
407
|
accountAddress: AccountAddressInput;
|
|
407
|
-
coinType
|
|
408
|
+
coinType?: MoveStructId;
|
|
409
|
+
faMetadataAddress?: AccountAddressInput;
|
|
408
410
|
}): Promise<number> {
|
|
409
|
-
const { aptosConfig, accountAddress, coinType } = args;
|
|
411
|
+
const { aptosConfig, accountAddress, coinType, faMetadataAddress } = args;
|
|
412
|
+
let coinAssetType: string | undefined;
|
|
413
|
+
let faAddress: string;
|
|
414
|
+
|
|
415
|
+
if (coinType !== undefined && faMetadataAddress !== undefined) {
|
|
416
|
+
faAddress = AccountAddress.from(faMetadataAddress).toStringLong();
|
|
417
|
+
} else if (coinType !== undefined && faMetadataAddress === undefined) {
|
|
418
|
+
coinAssetType = coinType;
|
|
419
|
+
// TODO Move to a separate function as defined in the AIP for coin migration
|
|
420
|
+
if (args.coinType === APTOS_COIN) {
|
|
421
|
+
faAddress = AccountAddress.A.toStringLong();
|
|
422
|
+
} else {
|
|
423
|
+
faAddress = createObjectAddress(AccountAddress.A, coinType).toStringLong();
|
|
424
|
+
}
|
|
425
|
+
} else if (coinType === undefined && faMetadataAddress !== undefined) {
|
|
426
|
+
// TODO: add a view function lookup for non-APT migrated coins
|
|
427
|
+
const addr = AccountAddress.from(faMetadataAddress);
|
|
428
|
+
faAddress = addr.toStringLong();
|
|
429
|
+
if (addr === AccountAddress.A) {
|
|
430
|
+
coinAssetType = APTOS_COIN;
|
|
431
|
+
}
|
|
432
|
+
} else {
|
|
433
|
+
throw new Error("Either coinType, fungibleAssetAddress, or both must be provided");
|
|
434
|
+
}
|
|
410
435
|
const address = AccountAddress.from(accountAddress).toStringLong();
|
|
411
436
|
|
|
437
|
+
// Search by fungible asset address, unless it has a coin it migrated from
|
|
438
|
+
let where: any = { asset_type: { _eq: faAddress } };
|
|
439
|
+
if (coinType !== undefined) {
|
|
440
|
+
where = { asset_type: { _in: [coinAssetType, faAddress] } };
|
|
441
|
+
}
|
|
442
|
+
|
|
412
443
|
const data = await getAccountCoinsData({
|
|
413
444
|
aptosConfig,
|
|
414
445
|
accountAddress: address,
|
|
415
446
|
options: {
|
|
416
|
-
where
|
|
447
|
+
where,
|
|
417
448
|
},
|
|
418
449
|
});
|
|
419
450
|
|
package/src/internal/ans.ts
CHANGED
|
@@ -68,6 +68,40 @@ export function isValidANSName(name: string): { domainName: string; subdomainNam
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
export enum SubdomainExpirationPolicy {
|
|
72
|
+
Independent = 0,
|
|
73
|
+
FollowsDomain = 1,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A helper function to determine if a given ANS name is considered active or
|
|
78
|
+
* not. Domains are considered active if their expiration date is in the
|
|
79
|
+
* future. Subdomains have two policies which modify their behavior. They can
|
|
80
|
+
* follow their parent's expiration (1) in which they ignore their own
|
|
81
|
+
* expiration timestamp or they can expire independently (0) in which they can
|
|
82
|
+
* expire before their parent but not afterwards.
|
|
83
|
+
*
|
|
84
|
+
* @param name - An ANS name returned from one of the functions of the SDK
|
|
85
|
+
* @returns A boolean representing if the contract considers the name active or not
|
|
86
|
+
*/
|
|
87
|
+
export function isActiveANSName(name: GetANSNameResponse[0]): boolean {
|
|
88
|
+
if (!name) return false;
|
|
89
|
+
|
|
90
|
+
const isTLDExpired = new Date(name.domain_expiration_timestamp).getTime() < Date.now();
|
|
91
|
+
const isExpired = new Date(name.expiration_timestamp).getTime() < Date.now();
|
|
92
|
+
|
|
93
|
+
// If we are a subdomain, if our parent is expired we are always expired
|
|
94
|
+
if (name.subdomain && isTLDExpired) return false;
|
|
95
|
+
|
|
96
|
+
// If we are a subdomain and our expiration policy is to follow the domain, we
|
|
97
|
+
// are active (since we know our parent is not expired by this point)
|
|
98
|
+
if (name.subdomain && name.subdomain_expiration_policy === SubdomainExpirationPolicy.FollowsDomain) return true;
|
|
99
|
+
|
|
100
|
+
// At this point, we are either a TLD or a subdomain with an independent
|
|
101
|
+
// expiration policy, we are active as long as we the expiration timestamp
|
|
102
|
+
return !isExpired;
|
|
103
|
+
}
|
|
104
|
+
|
|
71
105
|
export const LOCAL_ANS_ACCOUNT_PK =
|
|
72
106
|
process.env.ANS_TEST_ACCOUNT_PRIVATE_KEY ?? "0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221";
|
|
73
107
|
export const LOCAL_ANS_ACCOUNT_ADDRESS =
|
|
@@ -344,7 +378,6 @@ export async function getName(args: {
|
|
|
344
378
|
const where: CurrentAptosNamesBoolExp = {
|
|
345
379
|
domain: { _eq: domainName },
|
|
346
380
|
subdomain: { _eq: subdomainName },
|
|
347
|
-
is_active: { _eq: true },
|
|
348
381
|
};
|
|
349
382
|
|
|
350
383
|
const data = await queryIndexer<GetNamesQuery>({
|
|
@@ -365,7 +398,7 @@ export async function getName(args: {
|
|
|
365
398
|
res = sanitizeANSName(res);
|
|
366
399
|
}
|
|
367
400
|
|
|
368
|
-
return res;
|
|
401
|
+
return isActiveANSName(res) ? res : undefined;
|
|
369
402
|
}
|
|
370
403
|
|
|
371
404
|
interface QueryNamesOptions {
|
|
@@ -492,13 +525,12 @@ export async function getDomainSubdomains(
|
|
|
492
525
|
...(args.options?.where ?? {}),
|
|
493
526
|
domain: { _eq: domain },
|
|
494
527
|
subdomain: { _neq: "" },
|
|
495
|
-
is_active: { _eq: true },
|
|
496
528
|
},
|
|
497
529
|
},
|
|
498
530
|
},
|
|
499
531
|
});
|
|
500
532
|
|
|
501
|
-
return data.current_aptos_names.map(sanitizeANSName);
|
|
533
|
+
return data.current_aptos_names.map(sanitizeANSName).filter(isActiveANSName);
|
|
502
534
|
}
|
|
503
535
|
|
|
504
536
|
/**
|
|
@@ -26,6 +26,8 @@ export type AnsTokenFragmentFragment = {
|
|
|
26
26
|
token_standard?: string | null;
|
|
27
27
|
is_primary?: boolean | null;
|
|
28
28
|
owner_address?: string | null;
|
|
29
|
+
subdomain_expiration_policy?: any | null;
|
|
30
|
+
domain_expiration_timestamp?: any | null;
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
export type CurrentTokenOwnershipFieldsFragment = {
|
|
@@ -94,15 +96,15 @@ export type GetAccountCoinsDataQueryVariables = Types.Exact<{
|
|
|
94
96
|
|
|
95
97
|
export type GetAccountCoinsDataQuery = {
|
|
96
98
|
current_fungible_asset_balances: Array<{
|
|
97
|
-
amount
|
|
98
|
-
asset_type
|
|
99
|
+
amount?: any | null;
|
|
100
|
+
asset_type?: string | null;
|
|
99
101
|
is_frozen: boolean;
|
|
100
|
-
is_primary
|
|
101
|
-
last_transaction_timestamp
|
|
102
|
-
last_transaction_version
|
|
102
|
+
is_primary?: boolean | null;
|
|
103
|
+
last_transaction_timestamp?: any | null;
|
|
104
|
+
last_transaction_version?: any | null;
|
|
103
105
|
owner_address: string;
|
|
104
106
|
storage_id: string;
|
|
105
|
-
token_standard
|
|
107
|
+
token_standard?: string | null;
|
|
106
108
|
metadata?: {
|
|
107
109
|
token_standard: string;
|
|
108
110
|
symbol: string;
|
|
@@ -392,15 +394,15 @@ export type GetCurrentFungibleAssetBalancesQueryVariables = Types.Exact<{
|
|
|
392
394
|
|
|
393
395
|
export type GetCurrentFungibleAssetBalancesQuery = {
|
|
394
396
|
current_fungible_asset_balances: Array<{
|
|
395
|
-
amount
|
|
396
|
-
asset_type
|
|
397
|
+
amount?: any | null;
|
|
398
|
+
asset_type?: string | null;
|
|
397
399
|
is_frozen: boolean;
|
|
398
|
-
is_primary
|
|
399
|
-
last_transaction_timestamp
|
|
400
|
-
last_transaction_version
|
|
400
|
+
is_primary?: boolean | null;
|
|
401
|
+
last_transaction_timestamp?: any | null;
|
|
402
|
+
last_transaction_version?: any | null;
|
|
401
403
|
owner_address: string;
|
|
402
404
|
storage_id: string;
|
|
403
|
-
token_standard
|
|
405
|
+
token_standard?: string | null;
|
|
404
406
|
}>;
|
|
405
407
|
};
|
|
406
408
|
|
|
@@ -509,6 +511,8 @@ export type GetNamesQuery = {
|
|
|
509
511
|
token_standard?: string | null;
|
|
510
512
|
is_primary?: boolean | null;
|
|
511
513
|
owner_address?: string | null;
|
|
514
|
+
subdomain_expiration_policy?: any | null;
|
|
515
|
+
domain_expiration_timestamp?: any | null;
|
|
512
516
|
}>;
|
|
513
517
|
};
|
|
514
518
|
|