@aptos-labs/ts-sdk 0.0.4 → 0.0.6
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/README.md +3 -3
- package/dist/{cjs → browser}/index.d.ts +357 -297
- package/dist/browser/index.global.js +72 -47
- package/dist/browser/index.global.js.map +1 -1
- package/dist/{esm → common}/index.d.ts +357 -297
- package/dist/common/index.js +406 -0
- package/dist/common/index.js.map +1 -0
- package/dist/esm/api/account.d.mts +292 -0
- package/dist/esm/api/account.mjs +2 -0
- package/dist/esm/api/account.mjs.map +1 -0
- package/dist/esm/api/ans.d.mts +79 -0
- package/dist/esm/api/ans.mjs +2 -0
- package/dist/esm/api/ans.mjs.map +1 -0
- package/dist/esm/api/aptos.d.mts +72 -0
- package/dist/esm/api/aptos.mjs +2 -0
- package/dist/esm/api/aptos.mjs.map +1 -0
- package/dist/esm/api/aptosConfig.d.mts +51 -0
- package/dist/esm/api/aptosConfig.mjs +2 -0
- package/dist/esm/api/aptosConfig.mjs.map +1 -0
- package/dist/esm/api/coin.d.mts +59 -0
- package/dist/esm/api/coin.mjs +2 -0
- package/dist/esm/api/coin.mjs.map +1 -0
- package/dist/esm/api/digitalAsset.d.mts +174 -0
- package/dist/esm/api/digitalAsset.mjs +2 -0
- package/dist/esm/api/digitalAsset.mjs.map +1 -0
- package/dist/esm/api/event.d.mts +74 -0
- package/dist/esm/api/event.mjs +2 -0
- package/dist/esm/api/event.mjs.map +1 -0
- package/dist/esm/api/faucet.d.mts +37 -0
- package/dist/esm/api/faucet.mjs +2 -0
- package/dist/esm/api/faucet.mjs.map +1 -0
- package/dist/esm/api/fungibleAsset.d.mts +72 -0
- package/dist/esm/api/fungibleAsset.mjs +2 -0
- package/dist/esm/api/fungibleAsset.mjs.map +1 -0
- package/dist/esm/api/general.d.mts +150 -0
- package/dist/esm/api/general.mjs +2 -0
- package/dist/esm/api/general.mjs.map +1 -0
- package/dist/esm/api/index.d.mts +46 -0
- package/dist/esm/api/index.mjs +2 -0
- package/dist/esm/api/index.mjs.map +1 -0
- package/dist/esm/api/staking.d.mts +53 -0
- package/dist/esm/api/staking.mjs +2 -0
- package/dist/esm/api/staking.mjs.map +1 -0
- package/dist/esm/api/transaction.d.mts +101 -0
- package/dist/esm/api/transaction.mjs +2 -0
- package/dist/esm/api/transaction.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission.d.mts +142 -0
- package/dist/esm/api/transactionSubmission.mjs +2 -0
- package/dist/esm/api/transactionSubmission.mjs.map +1 -0
- package/dist/esm/bcs/consts.d.mts +14 -0
- package/dist/esm/bcs/consts.mjs +2 -0
- package/dist/esm/bcs/consts.mjs.map +1 -0
- package/dist/esm/bcs/deserializer.d.mts +150 -0
- package/dist/esm/bcs/deserializer.mjs +2 -0
- package/dist/esm/bcs/deserializer.mjs.map +1 -0
- package/dist/esm/bcs/index.d.mts +14 -0
- package/dist/esm/bcs/index.mjs +2 -0
- package/dist/esm/bcs/index.mjs.map +1 -0
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +40 -0
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +2 -0
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +1 -0
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +52 -0
- package/dist/esm/bcs/serializable/fixedBytes.mjs +2 -0
- package/dist/esm/bcs/serializable/fixedBytes.mjs.map +1 -0
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +69 -0
- package/dist/esm/bcs/serializable/movePrimitives.mjs +2 -0
- package/dist/esm/bcs/serializable/movePrimitives.mjs.map +1 -0
- package/dist/esm/bcs/serializable/moveStructs.d.mts +284 -0
- package/dist/esm/bcs/serializable/moveStructs.mjs +2 -0
- package/dist/esm/bcs/serializable/moveStructs.mjs.map +1 -0
- package/dist/esm/bcs/serializer.d.mts +192 -0
- package/dist/esm/bcs/serializer.mjs +2 -0
- package/dist/esm/bcs/serializer.mjs.map +1 -0
- package/dist/esm/chunk-2W744GUN.mjs +2 -0
- package/dist/esm/chunk-2W744GUN.mjs.map +1 -0
- package/dist/esm/chunk-3JPVQHOR.mjs +2 -0
- package/dist/esm/chunk-3JPVQHOR.mjs.map +1 -0
- package/dist/esm/chunk-3JVGSFHP.mjs +2 -0
- package/dist/esm/chunk-3JVGSFHP.mjs.map +1 -0
- package/dist/esm/chunk-44MGBJ73.mjs +2 -0
- package/dist/esm/chunk-44MGBJ73.mjs.map +1 -0
- package/dist/esm/chunk-4ADA5BE7.mjs +2 -0
- package/dist/esm/chunk-4ADA5BE7.mjs.map +1 -0
- package/dist/esm/chunk-4RVIA63I.mjs +2 -0
- package/dist/esm/chunk-4RVIA63I.mjs.map +1 -0
- package/dist/esm/chunk-4WPQQPUF.mjs +1 -0
- package/dist/esm/chunk-4WPQQPUF.mjs.map +1 -0
- package/dist/esm/chunk-62SCW5NH.mjs +2 -0
- package/dist/esm/chunk-62SCW5NH.mjs.map +1 -0
- package/dist/esm/chunk-6FBKUTGF.mjs +2 -0
- package/dist/esm/chunk-6FBKUTGF.mjs.map +1 -0
- package/dist/esm/chunk-7MNEEVXY.mjs +2 -0
- package/dist/esm/chunk-7MNEEVXY.mjs.map +1 -0
- package/dist/esm/chunk-AAIBCWZY.mjs +2 -0
- package/dist/esm/chunk-AAIBCWZY.mjs.map +1 -0
- package/dist/esm/chunk-AH44UPM4.mjs +2 -0
- package/dist/esm/chunk-AH44UPM4.mjs.map +1 -0
- package/dist/esm/chunk-ARVSIDVB.mjs +2 -0
- package/dist/esm/chunk-ARVSIDVB.mjs.map +1 -0
- package/dist/esm/chunk-BFSEVKNA.mjs +2 -0
- package/dist/esm/chunk-BFSEVKNA.mjs.map +1 -0
- package/dist/esm/chunk-BP5ZO7NK.mjs +2 -0
- package/dist/esm/chunk-BP5ZO7NK.mjs.map +1 -0
- package/dist/esm/chunk-BPYLPPEQ.mjs +2 -0
- package/dist/esm/chunk-BPYLPPEQ.mjs.map +1 -0
- package/dist/esm/chunk-BSCOVLWS.mjs +1 -0
- package/dist/esm/chunk-BSCOVLWS.mjs.map +1 -0
- package/dist/esm/chunk-BV4OOU5Y.mjs +2 -0
- package/dist/esm/chunk-BV4OOU5Y.mjs.map +1 -0
- package/dist/esm/chunk-BWMNPUTK.mjs +2 -0
- package/dist/esm/chunk-BWMNPUTK.mjs.map +1 -0
- package/dist/esm/chunk-CYDWEPFL.mjs +1 -0
- package/dist/esm/chunk-CYDWEPFL.mjs.map +1 -0
- package/dist/esm/chunk-DNDWTM7A.mjs +2 -0
- package/dist/esm/chunk-DNDWTM7A.mjs.map +1 -0
- package/dist/esm/chunk-E7FWVXGX.mjs +1 -0
- package/dist/esm/chunk-E7FWVXGX.mjs.map +1 -0
- package/dist/esm/chunk-EFIYW4WK.mjs +2 -0
- package/dist/esm/chunk-EFIYW4WK.mjs.map +1 -0
- package/dist/esm/chunk-EGOYLZBU.mjs +2 -0
- package/dist/esm/chunk-EGOYLZBU.mjs.map +1 -0
- package/dist/esm/chunk-EQ5BEDJ7.mjs +2 -0
- package/dist/esm/chunk-EQ5BEDJ7.mjs.map +1 -0
- package/dist/esm/chunk-EWTHPMEE.mjs +2 -0
- package/dist/esm/chunk-EWTHPMEE.mjs.map +1 -0
- package/dist/esm/chunk-EYXHVA6W.mjs +2 -0
- package/dist/esm/chunk-EYXHVA6W.mjs.map +1 -0
- package/dist/esm/chunk-FBPNHF54.mjs +2 -0
- package/dist/esm/chunk-FBPNHF54.mjs.map +1 -0
- package/dist/esm/chunk-FYIFBLHU.mjs +2 -0
- package/dist/esm/chunk-FYIFBLHU.mjs.map +1 -0
- package/dist/esm/chunk-FZY4PMEE.mjs +1 -0
- package/dist/esm/chunk-FZY4PMEE.mjs.map +1 -0
- package/dist/esm/chunk-GEFQFRL3.mjs +2 -0
- package/dist/esm/chunk-GEFQFRL3.mjs.map +1 -0
- package/dist/esm/chunk-GTC7WHMV.mjs +2 -0
- package/dist/esm/chunk-GTC7WHMV.mjs.map +1 -0
- package/dist/esm/chunk-HA6JD5R6.mjs +2 -0
- package/dist/esm/chunk-HA6JD5R6.mjs.map +1 -0
- package/dist/esm/chunk-HTZTTZQJ.mjs +1 -0
- package/dist/esm/chunk-HTZTTZQJ.mjs.map +1 -0
- package/dist/esm/chunk-HVADSXTB.mjs +2 -0
- package/dist/esm/chunk-HVADSXTB.mjs.map +1 -0
- package/dist/esm/chunk-I5OYNCZS.mjs +1 -0
- package/dist/esm/chunk-I5OYNCZS.mjs.map +1 -0
- package/dist/esm/chunk-IG5CHHSI.mjs +2 -0
- package/dist/esm/chunk-IG5CHHSI.mjs.map +1 -0
- package/dist/esm/chunk-IXMB2GOK.mjs +2 -0
- package/dist/esm/chunk-IXMB2GOK.mjs.map +1 -0
- package/dist/esm/chunk-J5ZFOJN2.mjs +2 -0
- package/dist/esm/chunk-J5ZFOJN2.mjs.map +1 -0
- package/dist/esm/chunk-JDS7K2WI.mjs +2 -0
- package/dist/esm/chunk-JDS7K2WI.mjs.map +1 -0
- package/dist/esm/chunk-JZNLZMUC.mjs +2 -0
- package/dist/esm/chunk-JZNLZMUC.mjs.map +1 -0
- package/dist/esm/chunk-KC64ESLO.mjs +2 -0
- package/dist/esm/chunk-KC64ESLO.mjs.map +1 -0
- package/dist/esm/chunk-KQXRH5FK.mjs +2 -0
- package/dist/esm/chunk-KQXRH5FK.mjs.map +1 -0
- package/dist/esm/chunk-LR65XHSF.mjs +2 -0
- package/dist/esm/chunk-LR65XHSF.mjs.map +1 -0
- package/dist/esm/chunk-LV33NV4J.mjs +2 -0
- package/dist/esm/chunk-LV33NV4J.mjs.map +1 -0
- package/dist/esm/chunk-N2FKVZ4D.mjs +1 -0
- package/dist/esm/chunk-N2FKVZ4D.mjs.map +1 -0
- package/dist/esm/chunk-NGCFPQ22.mjs +2 -0
- package/dist/esm/chunk-NGCFPQ22.mjs.map +1 -0
- package/dist/esm/chunk-NTD3H2S4.mjs +2 -0
- package/dist/esm/chunk-NTD3H2S4.mjs.map +1 -0
- package/dist/esm/chunk-NYFVEKF6.mjs +2 -0
- package/dist/esm/chunk-NYFVEKF6.mjs.map +1 -0
- package/dist/esm/chunk-NZIJV4O2.mjs +2 -0
- package/dist/esm/chunk-NZIJV4O2.mjs.map +1 -0
- package/dist/esm/chunk-P32MY5YF.mjs +2 -0
- package/dist/esm/chunk-P32MY5YF.mjs.map +1 -0
- package/dist/esm/chunk-Q6N6QACD.mjs +2 -0
- package/dist/esm/chunk-Q6N6QACD.mjs.map +1 -0
- package/dist/esm/chunk-QWVR4RCV.mjs +2 -0
- package/dist/esm/chunk-QWVR4RCV.mjs.map +1 -0
- package/dist/esm/chunk-R26XML3D.mjs +2 -0
- package/dist/esm/chunk-R26XML3D.mjs.map +1 -0
- package/dist/esm/chunk-R3KWVOFG.mjs +2 -0
- package/dist/esm/chunk-R3KWVOFG.mjs.map +1 -0
- package/dist/esm/chunk-R7G3CLRI.mjs +1 -0
- package/dist/esm/chunk-R7G3CLRI.mjs.map +1 -0
- package/dist/esm/chunk-RMMOF53Q.mjs +1 -0
- package/dist/esm/chunk-RMMOF53Q.mjs.map +1 -0
- package/dist/esm/chunk-RYETO74W.mjs +2 -0
- package/dist/esm/chunk-RYETO74W.mjs.map +1 -0
- package/dist/esm/chunk-S36IYY6K.mjs +2 -0
- package/dist/esm/chunk-S36IYY6K.mjs.map +1 -0
- package/dist/esm/chunk-TCTZCPQ6.mjs +1 -0
- package/dist/esm/chunk-TCTZCPQ6.mjs.map +1 -0
- package/dist/esm/chunk-TIH6ARYP.mjs +2 -0
- package/dist/esm/chunk-TIH6ARYP.mjs.map +1 -0
- package/dist/esm/chunk-TQD4IGUM.mjs +2 -0
- package/dist/esm/chunk-TQD4IGUM.mjs.map +1 -0
- package/dist/esm/chunk-U25N2VWA.mjs +2 -0
- package/dist/esm/chunk-U25N2VWA.mjs.map +1 -0
- package/dist/esm/chunk-U3LO2FSJ.mjs +2 -0
- package/dist/esm/chunk-U3LO2FSJ.mjs.map +1 -0
- package/dist/esm/chunk-U6SZNNVL.mjs +2 -0
- package/dist/esm/chunk-U6SZNNVL.mjs.map +1 -0
- package/dist/esm/chunk-UAAI3NCA.mjs +2 -0
- package/dist/esm/chunk-UAAI3NCA.mjs.map +1 -0
- package/dist/esm/chunk-UNQNACJT.mjs +2 -0
- package/dist/esm/chunk-UNQNACJT.mjs.map +1 -0
- package/dist/esm/chunk-UPLWWSB4.mjs +2 -0
- package/dist/esm/chunk-UPLWWSB4.mjs.map +1 -0
- package/dist/esm/chunk-UYVPNUH3.mjs +1 -0
- package/dist/esm/chunk-UYVPNUH3.mjs.map +1 -0
- package/dist/esm/chunk-V3MBJJTL.mjs +1 -0
- package/dist/esm/chunk-V3MBJJTL.mjs.map +1 -0
- package/dist/esm/chunk-V45RFKH7.mjs +2 -0
- package/dist/esm/chunk-V45RFKH7.mjs.map +1 -0
- package/dist/esm/chunk-VMQWW5UT.mjs +2 -0
- package/dist/esm/chunk-VMQWW5UT.mjs.map +1 -0
- package/dist/esm/chunk-VOYW2TZW.mjs +2 -0
- package/dist/esm/chunk-VOYW2TZW.mjs.map +1 -0
- package/dist/esm/chunk-VWVEDCBM.mjs +2 -0
- package/dist/esm/chunk-VWVEDCBM.mjs.map +1 -0
- package/dist/esm/chunk-VYAVLUPJ.mjs +2 -0
- package/dist/esm/chunk-VYAVLUPJ.mjs.map +1 -0
- package/dist/esm/chunk-WKY5ENCK.mjs +2 -0
- package/dist/esm/chunk-WKY5ENCK.mjs.map +1 -0
- package/dist/esm/chunk-WX43AJTD.mjs +406 -0
- package/dist/esm/chunk-WX43AJTD.mjs.map +1 -0
- package/dist/esm/chunk-X32O46IB.mjs +2 -0
- package/dist/esm/chunk-X32O46IB.mjs.map +1 -0
- package/dist/esm/chunk-Y5DJPHJT.mjs +2 -0
- package/dist/esm/chunk-Y5DJPHJT.mjs.map +1 -0
- package/dist/esm/chunk-Y7VR7X5W.mjs +2 -0
- package/dist/esm/chunk-Y7VR7X5W.mjs.map +1 -0
- package/dist/esm/chunk-YYRDFZE6.mjs +2 -0
- package/dist/esm/chunk-YYRDFZE6.mjs.map +1 -0
- package/dist/esm/chunk-Z2UDRTHA.mjs +2 -0
- package/dist/esm/chunk-Z2UDRTHA.mjs.map +1 -0
- package/dist/esm/chunk-ZWH2ESXT.mjs +2 -0
- package/dist/esm/chunk-ZWH2ESXT.mjs.map +1 -0
- package/dist/esm/client/core.d.mts +24 -0
- package/dist/esm/client/core.mjs +2 -0
- package/dist/esm/client/core.mjs.map +1 -0
- package/dist/esm/client/get.d.mts +55 -0
- package/dist/esm/client/get.mjs +2 -0
- package/dist/esm/client/get.mjs.map +1 -0
- package/dist/esm/client/index.d.mts +11 -0
- package/dist/esm/client/index.mjs +2 -0
- package/dist/esm/client/index.mjs.map +1 -0
- package/dist/esm/client/post.d.mts +60 -0
- package/dist/esm/client/post.mjs +2 -0
- package/dist/esm/client/post.mjs.map +1 -0
- package/dist/esm/client/types.d.mts +46 -0
- package/dist/esm/client/types.mjs +2 -0
- package/dist/esm/client/types.mjs.map +1 -0
- package/dist/esm/core/account.d.mts +184 -0
- package/dist/esm/core/account.mjs +2 -0
- package/dist/esm/core/account.mjs.map +1 -0
- package/dist/esm/core/accountAddress.d.mts +244 -0
- package/dist/esm/core/accountAddress.mjs +2 -0
- package/dist/esm/core/accountAddress.mjs.map +1 -0
- package/dist/esm/core/authenticationKey.d.mts +74 -0
- package/dist/esm/core/authenticationKey.mjs +2 -0
- package/dist/esm/core/authenticationKey.mjs.map +1 -0
- package/dist/esm/core/common.d.mts +32 -0
- package/dist/esm/core/common.mjs +2 -0
- package/dist/esm/core/common.mjs.map +1 -0
- package/dist/esm/core/crypto/anyPublicKey.d.mts +54 -0
- package/dist/esm/core/crypto/anyPublicKey.mjs +2 -0
- package/dist/esm/core/crypto/anyPublicKey.mjs.map +1 -0
- package/dist/esm/core/crypto/anySignature.d.mts +31 -0
- package/dist/esm/core/crypto/anySignature.mjs +2 -0
- package/dist/esm/core/crypto/anySignature.mjs.map +1 -0
- package/dist/esm/core/crypto/asymmetricCrypto.d.mts +74 -0
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +2 -0
- package/dist/esm/core/crypto/asymmetricCrypto.mjs.map +1 -0
- package/dist/esm/core/crypto/ed25519.d.mts +173 -0
- package/dist/esm/core/crypto/ed25519.mjs +2 -0
- package/dist/esm/core/crypto/ed25519.mjs.map +1 -0
- package/dist/esm/core/crypto/hdKey.d.mts +65 -0
- package/dist/esm/core/crypto/hdKey.mjs +2 -0
- package/dist/esm/core/crypto/hdKey.mjs.map +1 -0
- package/dist/esm/core/crypto/index.d.mts +17 -0
- package/dist/esm/core/crypto/index.mjs +2 -0
- package/dist/esm/core/crypto/index.mjs.map +1 -0
- package/dist/esm/core/crypto/multiEd25519.d.mts +126 -0
- package/dist/esm/core/crypto/multiEd25519.mjs +2 -0
- package/dist/esm/core/crypto/multiEd25519.mjs.map +1 -0
- package/dist/esm/core/crypto/multiKey.d.mts +52 -0
- package/dist/esm/core/crypto/multiKey.mjs +2 -0
- package/dist/esm/core/crypto/multiKey.mjs.map +1 -0
- package/dist/esm/core/crypto/secp256k1.d.mts +161 -0
- package/dist/esm/core/crypto/secp256k1.mjs +2 -0
- package/dist/esm/core/crypto/secp256k1.mjs.map +1 -0
- package/dist/esm/core/hex.d.mts +105 -0
- package/dist/esm/core/hex.mjs +2 -0
- package/dist/esm/core/hex.mjs.map +1 -0
- package/dist/esm/core/index.d.mts +21 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/core/index.mjs.map +1 -0
- package/dist/esm/index.d.mts +60 -0
- package/dist/esm/index.mjs +1 -5706
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/internal/account.d.mts +143 -0
- package/dist/esm/internal/account.mjs +2 -0
- package/dist/esm/internal/account.mjs.map +1 -0
- package/dist/esm/internal/ans.d.mts +83 -0
- package/dist/esm/internal/ans.mjs +2 -0
- package/dist/esm/internal/ans.mjs.map +1 -0
- package/dist/esm/internal/coin.d.mts +43 -0
- package/dist/esm/internal/coin.mjs +2 -0
- package/dist/esm/internal/coin.mjs.map +1 -0
- package/dist/esm/internal/digitalAsset.d.mts +118 -0
- package/dist/esm/internal/digitalAsset.mjs +2 -0
- package/dist/esm/internal/digitalAsset.mjs.map +1 -0
- package/dist/esm/internal/event.d.mts +45 -0
- package/dist/esm/internal/event.mjs +2 -0
- package/dist/esm/internal/event.mjs.map +1 -0
- package/dist/esm/internal/faucet.d.mts +29 -0
- package/dist/esm/internal/faucet.mjs +2 -0
- package/dist/esm/internal/faucet.mjs.map +1 -0
- package/dist/esm/internal/fungibleAsset.d.mts +38 -0
- package/dist/esm/internal/fungibleAsset.mjs +2 -0
- package/dist/esm/internal/fungibleAsset.mjs.map +1 -0
- package/dist/esm/internal/general.d.mts +60 -0
- package/dist/esm/internal/general.mjs +2 -0
- package/dist/esm/internal/general.mjs.map +1 -0
- package/dist/esm/internal/staking.d.mts +38 -0
- package/dist/esm/internal/staking.mjs +2 -0
- package/dist/esm/internal/staking.mjs.map +1 -0
- package/dist/esm/internal/transaction.d.mts +57 -0
- package/dist/esm/internal/transaction.mjs +2 -0
- package/dist/esm/internal/transaction.mjs.map +1 -0
- package/dist/esm/internal/transactionSubmission.d.mts +148 -0
- package/dist/esm/internal/transactionSubmission.mjs +2 -0
- package/dist/esm/internal/transactionSubmission.mjs.map +1 -0
- package/dist/esm/transactions/authenticator/account.d.mts +79 -0
- package/dist/esm/transactions/authenticator/account.mjs +2 -0
- package/dist/esm/transactions/authenticator/account.mjs.map +1 -0
- package/dist/esm/transactions/authenticator/index.d.mts +19 -0
- package/dist/esm/transactions/authenticator/index.mjs +2 -0
- package/dist/esm/transactions/authenticator/index.mjs.map +1 -0
- package/dist/esm/transactions/authenticator/transaction.d.mts +105 -0
- package/dist/esm/transactions/authenticator/transaction.mjs +2 -0
- package/dist/esm/transactions/authenticator/transaction.mjs.map +1 -0
- package/dist/esm/transactions/index.d.mts +39 -0
- package/dist/esm/transactions/index.mjs +2 -0
- package/dist/esm/transactions/index.mjs.map +1 -0
- package/dist/esm/transactions/instances/chainId.d.mts +21 -0
- package/dist/esm/transactions/instances/chainId.mjs +2 -0
- package/dist/esm/transactions/instances/chainId.mjs.map +1 -0
- package/dist/esm/transactions/instances/identifier.d.mts +23 -0
- package/dist/esm/transactions/instances/identifier.mjs +2 -0
- package/dist/esm/transactions/instances/identifier.mjs.map +1 -0
- package/dist/esm/transactions/instances/index.d.mts +29 -0
- package/dist/esm/transactions/instances/index.mjs +2 -0
- package/dist/esm/transactions/instances/index.mjs.map +1 -0
- package/dist/esm/transactions/instances/moduleId.d.mts +37 -0
- package/dist/esm/transactions/instances/moduleId.mjs +2 -0
- package/dist/esm/transactions/instances/moduleId.mjs.map +1 -0
- package/dist/esm/transactions/instances/rawTransaction.d.mts +98 -0
- package/dist/esm/transactions/instances/rawTransaction.mjs +2 -0
- package/dist/esm/transactions/instances/rawTransaction.mjs.map +1 -0
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +37 -0
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +2 -0
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +1 -0
- package/dist/esm/transactions/instances/signedTransaction.d.mts +46 -0
- package/dist/esm/transactions/instances/signedTransaction.mjs +2 -0
- package/dist/esm/transactions/instances/signedTransaction.mjs.map +1 -0
- package/dist/esm/transactions/instances/transactionArgument.d.mts +40 -0
- package/dist/esm/transactions/instances/transactionArgument.mjs +2 -0
- package/dist/esm/transactions/instances/transactionArgument.mjs.map +1 -0
- package/dist/esm/transactions/instances/transactionPayload.d.mts +211 -0
- package/dist/esm/transactions/instances/transactionPayload.mjs +2 -0
- package/dist/esm/transactions/instances/transactionPayload.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +63 -0
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/index.d.mts +35 -0
- package/dist/esm/transactions/transactionBuilder/index.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/index.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +54 -0
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +126 -0
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +1 -0
- package/dist/esm/transactions/typeTag/index.d.mts +127 -0
- package/dist/esm/transactions/typeTag/index.mjs +2 -0
- package/dist/esm/transactions/typeTag/index.mjs.map +1 -0
- package/dist/esm/transactions/typeTag/parser.d.mts +48 -0
- package/dist/esm/transactions/typeTag/parser.mjs +2 -0
- package/dist/esm/transactions/typeTag/parser.mjs.map +1 -0
- package/dist/esm/transactions/types.d.mts +242 -0
- package/dist/esm/transactions/types.mjs +2 -0
- package/dist/esm/transactions/types.mjs.map +1 -0
- package/dist/esm/types/generated/operations.d.mts +604 -0
- package/dist/esm/types/generated/operations.mjs +1 -0
- package/dist/esm/types/generated/operations.mjs.map +1 -0
- package/dist/esm/types/generated/queries.d.mts +55 -0
- package/dist/esm/types/generated/queries.mjs +2 -0
- package/dist/esm/types/generated/queries.mjs.map +1 -0
- package/dist/esm/types/generated/types.d.mts +9496 -0
- package/dist/esm/types/generated/types.mjs +2 -0
- package/dist/esm/types/generated/types.mjs.map +1 -0
- package/dist/esm/types/index.d.mts +886 -0
- package/dist/esm/types/index.mjs +2 -0
- package/dist/esm/types/index.mjs.map +1 -0
- package/dist/esm/types/indexer.d.mts +62 -0
- package/dist/esm/types/indexer.mjs +2 -0
- package/dist/esm/types/indexer.mjs.map +1 -0
- package/dist/esm/utils/apiEndpoints.d.mts +14 -0
- package/dist/esm/utils/apiEndpoints.mjs +2 -0
- package/dist/esm/utils/apiEndpoints.mjs.map +1 -0
- package/dist/esm/utils/const.d.mts +42 -0
- package/dist/esm/utils/const.mjs +2 -0
- package/dist/esm/utils/const.mjs.map +1 -0
- package/dist/esm/utils/helpers.d.mts +7 -0
- package/dist/esm/utils/helpers.mjs +2 -0
- package/dist/esm/utils/helpers.mjs.map +1 -0
- package/dist/esm/utils/index.d.mts +2 -0
- package/dist/esm/utils/index.mjs +2 -0
- package/dist/esm/utils/index.mjs.map +1 -0
- package/dist/esm/utils/memoize.d.mts +20 -0
- package/dist/esm/utils/memoize.mjs +2 -0
- package/dist/esm/utils/memoize.mjs.map +1 -0
- package/dist/esm/version.d.mts +8 -0
- package/dist/esm/version.mjs +2 -0
- package/dist/esm/version.mjs.map +1 -0
- package/package.json +43 -40
- package/src/api/account.ts +2 -2
- package/src/api/coin.ts +2 -2
- package/src/api/event.ts +2 -2
- package/src/api/general.ts +4 -4
- package/src/api/transactionSubmission.ts +20 -3
- package/src/bcs/serializable/moveStructs.ts +8 -4
- package/src/client/core.ts +7 -5
- package/src/client/get.ts +6 -2
- package/src/client/post.ts +12 -4
- package/src/core/account.ts +7 -4
- package/src/index.ts +1 -1
- package/src/internal/account.ts +2 -2
- package/src/internal/ans.ts +4 -6
- package/src/internal/coin.ts +2 -2
- package/src/internal/event.ts +3 -3
- package/src/internal/general.ts +7 -6
- package/src/internal/queries/getEvents.graphql +1 -0
- package/src/internal/transactionSubmission.ts +41 -3
- package/src/transactions/transactionBuilder/helpers.ts +2 -2
- package/src/transactions/transactionBuilder/remoteAbi.ts +1 -1
- package/src/transactions/transactionBuilder/transactionBuilder.ts +15 -20
- package/src/transactions/typeTag/parser.ts +10 -2
- package/src/transactions/types.ts +5 -14
- package/src/types/generated/operations.ts +52 -51
- package/src/types/generated/queries.ts +42 -41
- package/src/types/generated/types.ts +2257 -2249
- package/src/types/index.ts +20 -12
- package/src/utils/index.ts +2 -0
- package/dist/cjs/index.js +0 -5901
- package/dist/cjs/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -1310
- package/dist/types/index.js +0 -176
- package/dist/types/index.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var i=(o=>(o.JSON="application/json",o.BCS="application/x-bcs",o.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",o))(i||{}),p=(t=>(t[t.Bool=0]="Bool",t[t.U8=1]="U8",t[t.U64=2]="U64",t[t.U128=3]="U128",t[t.Address=4]="Address",t[t.Signer=5]="Signer",t[t.Vector=6]="Vector",t[t.Struct=7]="Struct",t[t.U16=8]="U16",t[t.U32=9]="U32",t[t.U256=10]="U256",t[t.Reference=254]="Reference",t[t.Generic=255]="Generic",t))(p||{}),y=(n=>(n[n.U8=0]="U8",n[n.U64=1]="U64",n[n.U128=2]="U128",n[n.Address=3]="Address",n[n.U8Vector=4]="U8Vector",n[n.Bool=5]="Bool",n[n.U16=6]="U16",n[n.U32=7]="U32",n[n.U256=8]="U256",n))(y||{}),g=(o=>(o[o.Script=0]="Script",o[o.EntryFunction=2]="EntryFunction",o[o.Multisig=3]="Multisig",o))(g||{}),a=(r=>(r[r.MultiAgentTransaction=0]="MultiAgentTransaction",r[r.FeePayerTransaction=1]="FeePayerTransaction",r))(a||{}),d=(e=>(e[e.Ed25519=0]="Ed25519",e[e.MultiEd25519=1]="MultiEd25519",e[e.MultiAgent=2]="MultiAgent",e[e.FeePayer=3]="FeePayer",e[e.SingleSender=4]="SingleSender",e))(d||{}),u=(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.SingleKey=2]="SingleKey",s[s.MultiKey=3]="MultiKey",s))(u||{}),c=(r=>(r[r.Ed25519=0]="Ed25519",r[r.Secp256k1=1]="Secp256k1",r))(c||{}),l=(r=>(r[r.Ed25519=0]="Ed25519",r[r.Secp256k1=1]="Secp256k1",r))(l||{}),_=(e=>(e.Pending="pending_transaction",e.User="user_transaction",e.Genesis="genesis_transaction",e.BlockMetadata="block_metadata_transaction",e.StateCheckpoint="state_checkpoint_transaction",e))(_||{}),x=(o=>(o.PRIVATE="private",o.PUBLIC="public",o.FRIEND="friend",o))(x||{}),v=(s=>(s.STORE="store",s.DROP="drop",s.KEY="key",s.COPY="copy",s))(v||{}),M=(r=>(r.VALIDATOR="validator",r.FULL_NODE="full_node",r))(M||{}),h=(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.SingleKey=2]="SingleKey",s[s.MultiKey=3]="MultiKey",s))(h||{}),m=(r=>(r[r.Ed25519=0]="Ed25519",r[r.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",r))(m||{}),b=(e=>(e[e.DeriveAuid=251]="DeriveAuid",e[e.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",e[e.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",e[e.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",e[e.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",e))(b||{});export{i as a,p as b,y as c,g as d,a as e,d as f,u as g,c as h,l as i,_ as j,x as k,v as l,M as m,h as n,m as o,b as p};
|
|
2
|
+
//# sourceMappingURL=chunk-Y7VR7X5W.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Network } from \"../utils/apiEndpoints\";\n\nexport * from \"./indexer\";\n\nexport enum MimeType {\n /**\n * JSON representation, used for transaction submission and accept type JSON output\n */\n JSON = \"application/json\",\n /**\n * BCS representation, used for accept type BCS output\n */\n BCS = \"application/x-bcs\",\n /**\n * BCS representation, used for transaction submission in BCS input\n */\n BCS_SIGNED_TRANSACTION = \"application/x.aptos.signed_transaction+bcs\",\n}\n\n/**\n * Hex data as input to a function\n */\nexport type HexInput = string | Uint8Array;\n\n/**\n * TypeTag enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}\n */\nexport enum TypeTagVariants {\n Bool = 0,\n U8 = 1,\n U64 = 2,\n U128 = 3,\n Address = 4,\n Signer = 5,\n Vector = 6,\n Struct = 7,\n U16 = 8,\n U32 = 9,\n U256 = 10,\n Reference = 254, // This is specifically a placeholder and does not represent a real type\n Generic = 255, // This is specifically a placeholder and does not represent a real type\n}\n\n/**\n * Script transaction arguments enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}\n */\nexport enum ScriptTransactionArgumentVariants {\n U8 = 0,\n U64 = 1,\n U128 = 2,\n Address = 3,\n U8Vector = 4,\n Bool = 5,\n U16 = 6,\n U32 = 7,\n U256 = 8,\n}\n\n/**\n * Transaction payload enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}\n */\nexport enum TransactionPayloadVariants {\n Script = 0,\n EntryFunction = 2,\n Multisig = 3,\n}\n\n/**\n * Transaction variants enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}\n */\nexport enum TransactionVariants {\n MultiAgentTransaction = 0,\n FeePayerTransaction = 1,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}\n */\nexport enum TransactionAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n MultiAgent = 2,\n FeePayer = 3,\n SingleSender = 4,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}\n */\nexport enum AccountAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n SingleKey = 2,\n MultiKey = 3,\n}\n\nexport enum AnyPublicKeyVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n}\n\nexport enum AnySignatureVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n}\n\n/**\n * BCS types\n */\nexport type Uint8 = number;\nexport type Uint16 = number;\nexport type Uint32 = number;\nexport type Uint64 = bigint;\nexport type Uint128 = bigint;\nexport type Uint256 = bigint;\nexport type AnyNumber = number | bigint;\n\n/**\n * Set of configuration options that can be provided when initializing the SDK.\n * The purpose of these options is to configure various aspects of the SDK's\n * behavior and interaction with the Aptos network\n */\nexport type AptosSettings = {\n readonly network?: Network;\n\n readonly fullnode?: string;\n\n readonly faucet?: string;\n\n readonly indexer?: string;\n\n readonly clientConfig?: ClientConfig;\n\n readonly client?: Client;\n};\n\n/**\n *\n * Controls the number of results that are returned and the starting position of those results.\n * @param offset parameter specifies the starting position of the query result within the set of data. Default is 0.\n * @param limit specifies the maximum number of items or records to return in a query result. Default is 25.\n */\nexport interface PaginationArgs {\n offset?: AnyNumber;\n limit?: number;\n}\n\n/**\n * QUERY TYPES\n */\n\n/**\n * A configuration object we can pass with the request to the server.\n *\n * @param AUTH_TOKEN - an auth token to send with a faucet request\n * @param API_KEY - api key generated from developer portal {@link https://developers.aptoslabs.com/manage/api-keys}}\n * @param HEADERS - extra headers we want to send with the request\n * @param WITH_CREDENTIALS - whether to carry cookies. By default, it is set to true and cookies will be sent\n */\nexport type ClientConfig = {\n AUTH_TOKEN?: string;\n API_KEY?: string;\n HEADERS?: Record<string, string | number | boolean>;\n WITH_CREDENTIALS?: boolean;\n};\n\nexport interface ClientRequest<Req> {\n url: string;\n method: \"GET\" | \"POST\";\n body?: Req;\n contentType?: string;\n params?: any;\n overrides?: ClientConfig;\n headers?: Record<string, any>;\n}\n\nexport interface ClientResponse<Res> {\n status: number;\n statusText: string;\n data: Res;\n config?: any;\n request?: any;\n response?: any;\n headers?: any;\n}\n\nexport interface Client {\n provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;\n}\n\n/**\n * The API request type\n *\n * @param url - the url to make the request to, i.e https://fullnode.aptoslabs.devnet.com/v1\n * @param method - the request method \"GET\" | \"POST\"\n * @param endpoint (optional) - the endpoint to make the request to, i.e transactions\n * @param body (optional) - the body of the request\n * @param contentType (optional) - the content type to set the `content-type` header to,\n * by default is set to `application/json`\n * @param params (optional) - query params to add to the request\n * @param originMethod (optional) - the local method the request came from\n * @param overrides (optional) - a `ClientConfig` object type to override request data\n */\nexport type AptosRequest = {\n url: string;\n method: \"GET\" | \"POST\";\n path?: string;\n body?: any;\n contentType?: string;\n acceptType?: string;\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n originMethod?: string;\n overrides?: ClientConfig;\n};\n\n/**\n * Specifies ledger version of transactions. By default latest version will be used\n */\nexport type LedgerVersion = {\n ledgerVersion?: AnyNumber;\n};\n\n/**\n * RESPONSE TYPES\n */\n\n/**\n * Type holding the outputs of the estimate gas API\n */\nexport type GasEstimation = {\n /**\n * The deprioritized estimate for the gas unit price\n */\n deprioritized_gas_estimate?: number;\n /**\n * The current estimate for the gas unit price\n */\n gas_estimate: number;\n /**\n * The prioritized estimate for the gas unit price\n */\n prioritized_gas_estimate?: number;\n};\n\nexport type MoveResource = {\n type: MoveStructId;\n data: {};\n};\n\nexport type AccountData = {\n sequence_number: string;\n authentication_key: string;\n};\n\nexport type MoveModuleBytecode = {\n bytecode: string;\n abi?: MoveModule;\n};\n\n/**\n * TRANSACTION TYPES\n */\n\nexport enum TransactionResponseType {\n Pending = \"pending_transaction\",\n User = \"user_transaction\",\n Genesis = \"genesis_transaction\",\n BlockMetadata = \"block_metadata_transaction\",\n StateCheckpoint = \"state_checkpoint_transaction\",\n}\n\nexport type TransactionResponse =\n | PendingTransactionResponse\n | UserTransactionResponse\n | GenesisTransactionResponse\n | BlockMetadataTransactionResponse\n | StateCheckpointTransactionResponse;\n\nexport type PendingTransactionResponse = {\n type: TransactionResponseType.Pending;\n hash: string;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n};\n\nexport type UserTransactionResponse = {\n type: TransactionResponseType.User;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n /**\n * Events generated by the transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\nexport type GenesisTransactionResponse = {\n type: TransactionResponseType.Genesis;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n payload: GenesisPayload;\n /**\n * Events emitted during genesis\n */\n events: Array<Event>;\n};\n\nexport type BlockMetadataTransactionResponse = {\n type: TransactionResponseType.BlockMetadata;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n id: string;\n epoch: string;\n round: string;\n /**\n * The events emitted at the block creation\n */\n events: Array<Event>;\n /**\n * Previous block votes\n */\n previous_block_votes_bitvec: Array<number>;\n proposer: string;\n /**\n * The indices of the proposers who failed to propose\n */\n failed_proposer_indices: Array<number>;\n timestamp: string;\n};\n\nexport type StateCheckpointTransactionResponse = {\n type: TransactionResponseType.StateCheckpoint;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n};\n\n/**\n * WRITESET CHANGE TYPES\n */\n\nexport type WriteSetChange =\n | WriteSetChangeDeleteModule\n | WriteSetChangeDeleteResource\n | WriteSetChangeDeleteTableItem\n | WriteSetChangeWriteModule\n | WriteSetChangeWriteResource\n | WriteSetChangeWriteTableItem;\n\nexport type WriteSetChangeDeleteModule = {\n type: string;\n address: string;\n /**\n * State key hash\n */\n state_key_hash: string;\n module: MoveModuleId;\n};\n\nexport type WriteSetChangeDeleteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n resource: string;\n};\n\nexport type WriteSetChangeDeleteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n data?: DeletedTableData;\n};\n\nexport type WriteSetChangeWriteModule = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveModuleBytecode;\n};\n\nexport type WriteSetChangeWriteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveResource;\n};\n\nexport type WriteSetChangeWriteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n value: string;\n data?: DecodedTableData;\n};\n\nexport type DecodedTableData = {\n /**\n * Key of table in JSON\n */\n key: any;\n /**\n * Type of key\n */\n key_type: string;\n /**\n * Value of table in JSON\n */\n value: any;\n /**\n * Type of value\n */\n value_type: string;\n};\n\n/**\n * Deleted table data\n */\nexport type DeletedTableData = {\n /**\n * Deleted key\n */\n key: any;\n /**\n * Deleted key type\n */\n key_type: string;\n};\n\nexport type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;\n\nexport type EntryFunctionPayloadResponse = {\n type: string;\n function: MoveFunctionId;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type ScriptPayloadResponse = {\n type: string;\n code: MoveScriptBytecode;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type MultisigPayloadResponse = {\n type: string;\n multisig_address: string;\n transaction_payload?: EntryFunctionPayloadResponse;\n};\n\nexport type GenesisPayload = {\n type: string;\n write_set: WriteSet;\n};\n\n/**\n * Move script bytecode\n */\nexport type MoveScriptBytecode = {\n bytecode: string;\n abi?: MoveFunction;\n};\n\n/**\n * These are the JSON representations of transaction signatures returned from the node API.\n */\nexport type TransactionSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature\n | TransactionMultiAgentSignature\n | TransactionFeePayerSignature;\n\nexport type TransactionEd25519Signature = {\n type: string;\n public_key: string;\n signature: \"ed25519_signature\";\n};\n\nexport type TransactionSecp256k1Signature = {\n type: string;\n public_key: string;\n signature: \"secp256k1_ecdsa_signature\";\n};\n\nexport type TransactionMultiEd25519Signature = {\n type: \"multi_ed25519_signature\";\n /**\n * The public keys for the Ed25519 signature\n */\n public_keys: Array<string>;\n /**\n * Signature associated with the public keys in the same order\n */\n signatures: Array<string>;\n /**\n * The number of signatures required for a successful transaction\n */\n threshold: number;\n bitmap: string;\n};\n\nexport type TransactionMultiAgentSignature = {\n type: \"multi_agent_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n};\n\nexport type TransactionFeePayerSignature = {\n type: \"fee_payer_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n fee_payer_address: string;\n fee_payer_signer: AccountSignature;\n};\n\n/**\n * The union of all single account signatures.\n */\nexport type AccountSignature = AccountEd25519Signature | AccountSecp256k1Signature | AccountMultiEd25519Signature;\n\nexport type AccountEd25519Signature = TransactionEd25519Signature;\n\nexport type AccountSecp256k1Signature = TransactionSecp256k1Signature;\n\nexport type AccountMultiEd25519Signature = TransactionMultiEd25519Signature;\n\nexport type WriteSet = ScriptWriteSet | DirectWriteSet;\n\nexport type ScriptWriteSet = {\n type: string;\n execute_as: string;\n script: ScriptPayloadResponse;\n};\n\nexport type DirectWriteSet = {\n type: string;\n changes: Array<WriteSetChange>;\n events: Array<Event>;\n};\n\nexport type EventGuid = {\n creation_number: string;\n account_address: string;\n};\n\nexport type Event = {\n guid: EventGuid;\n sequence_number: string;\n type: string;\n /**\n * The JSON representation of the event\n */\n data: any;\n};\n\n/**\n * Map of Move types to local TypeScript types\n */\nexport type MoveUint8Type = number;\nexport type MoveUint16Type = number;\nexport type MoveUint32Type = number;\nexport type MoveUint64Type = string;\nexport type MoveUint128Type = string;\nexport type MoveUint256Type = string;\nexport type MoveAddressType = string;\nexport type MoveObjectType = string;\nexport type MoveOptionType = MoveType | null | undefined;\n/**\n * This is the format for a fully qualified struct, resource, or entry function in Move.\n */\nexport type MoveStructId = `${string}::${string}::${string}`;\n// These are the same, unfortunately, it reads really strangely to take a StructId for a Function and there wasn't a\n// good middle ground name.\nexport type MoveFunctionId = MoveStructId;\n\n// TODO: Add support for looking up ABI to add proper typing\nexport type MoveStructType = {};\n\nexport type MoveType =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | Array<MoveType>;\n\n/**\n * Possible Move values acceptable by move functions (entry, view)\n *\n * Map of a Move value to the corresponding TypeScript value\n *\n * `Bool -> boolean`\n *\n * `u8, u16, u32 -> number`\n *\n * `u64, u128, u256 -> string`\n *\n * `String -> string`\n *\n * `Address -> 0x${string}`\n *\n * `Struct - 0x${string}::${string}::${string}`\n *\n * `Object -> 0x${string}`\n *\n * `Vector -> Array<MoveValue>`\n *\n * `Option -> MoveValue | null | undefined`\n */\nexport type MoveValue =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructId\n | MoveOptionType\n | Array<MoveValue>;\n\n/**\n * Move module id is a string representation of Move module.\n * Module name is case-sensitive.\n */\nexport type MoveModuleId = `${string}::${string}`;\n\n/**\n * Move function visibility\n */\nexport enum MoveFunctionVisibility {\n PRIVATE = \"private\",\n PUBLIC = \"public\",\n FRIEND = \"friend\",\n}\n\n/**\n * Move function ability\n */\nexport enum MoveAbility {\n STORE = \"store\",\n DROP = \"drop\",\n KEY = \"key\",\n COPY = \"copy\",\n}\n\n/**\n * Move abilities tied to the generic type param and associated with the function that uses it\n */\nexport type MoveFunctionGenericTypeParam = {\n constraints: Array<MoveAbility>;\n};\n\n/**\n * Move struct field\n */\nexport type MoveStructField = {\n name: string;\n type: string;\n};\n\n/**\n * A Move module\n */\nexport type MoveModule = {\n address: string;\n name: string;\n /**\n * Friends of the module\n */\n friends: Array<MoveModuleId>;\n /**\n * Public functions of the module\n */\n exposed_functions: Array<MoveFunction>;\n /**\n * Structs of the module\n */\n structs: Array<MoveStruct>;\n};\n\n/**\n * A move struct\n */\nexport type MoveStruct = {\n name: string;\n /**\n * Whether the struct is a native struct of Move\n */\n is_native: boolean;\n /**\n * Abilities associated with the struct\n */\n abilities: Array<MoveAbility>;\n /**\n * Generic types associated with the struct\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Fields associated with the struct\n */\n fields: Array<MoveStructField>;\n};\n\n/**\n * Move function\n */\nexport type MoveFunction = {\n name: string;\n visibility: MoveFunctionVisibility;\n /**\n * Whether the function can be called as an entry function directly in a transaction\n */\n is_entry: boolean;\n /**\n * Whether the function is a view function or not\n */\n is_view: boolean;\n /**\n * Generic type params associated with the Move function\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Parameters associated with the move function\n */\n params: Array<string>;\n /**\n * Return type of the function\n */\n return: Array<string>;\n};\n\nexport enum RoleType {\n VALIDATOR = \"validator\",\n FULL_NODE = \"full_node\",\n}\n\nexport type LedgerInfo = {\n /**\n * Chain ID of the current chain\n */\n chain_id: number;\n epoch: string;\n ledger_version: string;\n oldest_ledger_version: string;\n ledger_timestamp: string;\n node_role: RoleType;\n oldest_block_height: string;\n block_height: string;\n /**\n * Git hash of the build of the API endpoint. Can be used to determine the exact\n * software version used by the API endpoint.\n */\n git_hash?: string;\n};\n\n/**\n * A Block type\n */\nexport type Block = {\n block_height: string;\n block_hash: string;\n block_timestamp: string;\n first_version: string;\n last_version: string;\n /**\n * The transactions in the block in sequential order\n */\n transactions?: Array<TransactionResponse>;\n};\n\n/**\n * The data needed to generate a View Request payload\n */\nexport type InputViewRequestData = {\n function: MoveFunctionId;\n typeArguments?: Array<MoveStructId>;\n functionArguments?: Array<MoveValue>;\n};\n\n// REQUEST TYPES\n\n/**\n * View request for the Move view function API\n *\n * `type MoveFunctionId = ${string}::${string}::${string}`;\n */\nexport type ViewRequest = {\n function: MoveFunctionId;\n /**\n * Type arguments of the function\n */\n typeArguments: Array<MoveStructId>;\n /**\n * Arguments of the function\n */\n functionArguments: Array<MoveValue>;\n};\n\n/**\n * Table Item request for the GetTableItem API\n */\nexport type TableItemRequest = {\n key_type: MoveValue;\n value_type: MoveValue;\n /**\n * The value of the table item's key\n */\n key: any;\n};\n\n/**\n * A list of Authentication Key schemes that are supported by Aptos.\n *\n * They are combinations of signing schemes and derive schemes.\n */\nexport type AuthenticationKeyScheme = SigningScheme | DeriveScheme;\n\nexport enum SigningScheme {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For MultiEd25519PublicKey\n */\n MultiEd25519 = 1,\n /**\n * For SingleKey ecdsa\n */\n SingleKey = 2,\n\n MultiKey = 3,\n}\n\nexport enum SigningSchemeInput {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For Secp256k1Ecdsa\n */\n Secp256k1Ecdsa = 2,\n}\n\n/**\n * Scheme used for deriving account addresses from other data\n */\nexport enum DeriveScheme {\n /**\n * Derives an address using an AUID, used for objects\n */\n DeriveAuid = 251,\n /**\n * Derives an address from another object address\n */\n DeriveObjectAddressFromObject = 252,\n /**\n * Derives an address from a GUID, used for objects\n */\n DeriveObjectAddressFromGuid = 253,\n /**\n * Derives an address from seed bytes, used for named objects\n */\n DeriveObjectAddressFromSeed = 254,\n /**\n * Derives an address from seed bytes, used for resource accounts\n */\n DeriveResourceAccountAddress = 255,\n}\n\n/**\n * Option properties to pass for waitForTransaction() function\n */\nexport type WaitForTransactionOptions = {\n timeoutSecs?: number;\n checkSuccess?: boolean;\n indexerVersionCheck?: boolean;\n};\n\n/**\n * Input type to generate an account using Single Signer\n * Ed25519 or Legacy Ed25519\n */\nexport type GenerateAccountWithEd25519 = {\n scheme: SigningSchemeInput.Ed25519;\n legacy: boolean;\n};\n\n/**\n * Input type to generate an account using Single Signer\n * Secp256k1\n */\nexport type GenerateAccountWithSingleSignerSecp256k1Key = {\n scheme: SigningSchemeInput.Secp256k1Ecdsa;\n legacy?: false;\n};\n\nexport type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;\n"],"mappings":"AAOO,IAAKA,OAIVA,EAAA,KAAO,mBAIPA,EAAA,IAAM,oBAINA,EAAA,uBAAyB,6CAZfA,OAAA,IAwBAC,OACVA,IAAA,KAAO,GAAP,OACAA,IAAA,GAAK,GAAL,KACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,GAAP,OACAA,IAAA,QAAU,GAAV,UACAA,IAAA,OAAS,GAAT,SACAA,IAAA,OAAS,GAAT,SACAA,IAAA,OAAS,GAAT,SACAA,IAAA,IAAM,GAAN,MACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,IAAP,OACAA,IAAA,UAAY,KAAZ,YACAA,IAAA,QAAU,KAAV,UAbUA,OAAA,IAoBAC,OACVA,IAAA,GAAK,GAAL,KACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,GAAP,OACAA,IAAA,QAAU,GAAV,UACAA,IAAA,SAAW,GAAX,WACAA,IAAA,KAAO,GAAP,OACAA,IAAA,IAAM,GAAN,MACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,GAAP,OATUA,OAAA,IAgBAC,OACVA,IAAA,OAAS,GAAT,SACAA,IAAA,cAAgB,GAAhB,gBACAA,IAAA,SAAW,GAAX,WAHUA,OAAA,IAUAC,OACVA,IAAA,sBAAwB,GAAxB,wBACAA,IAAA,oBAAsB,GAAtB,sBAFUA,OAAA,IASAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,aAAe,GAAf,eACAA,IAAA,WAAa,GAAb,aACAA,IAAA,SAAW,GAAX,WACAA,IAAA,aAAe,GAAf,eALUA,OAAA,IAYAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,aAAe,GAAf,eACAA,IAAA,UAAY,GAAZ,YACAA,IAAA,SAAW,GAAX,WAJUA,OAAA,IAOAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,UAAY,GAAZ,YAFUA,OAAA,IAKAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,UAAY,GAAZ,YAFUA,OAAA,IAkKAC,OACVA,EAAA,QAAU,sBACVA,EAAA,KAAO,mBACPA,EAAA,QAAU,sBACVA,EAAA,cAAgB,6BAChBA,EAAA,gBAAkB,+BALRA,OAAA,IAqeAC,OACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,OAAS,SAHCA,OAAA,IASAC,OACVA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,KAAO,OAJGA,OAAA,IA6FAC,OACVA,EAAA,UAAY,YACZA,EAAA,UAAY,YAFFA,OAAA,IAsFAC,OAIVA,IAAA,QAAU,GAAV,UAIAA,IAAA,aAAe,GAAf,eAIAA,IAAA,UAAY,GAAZ,YAEAA,IAAA,SAAW,GAAX,WAdUA,OAAA,IAiBAC,OAIVA,IAAA,QAAU,GAAV,UAIAA,IAAA,eAAiB,GAAjB,iBARUA,OAAA,IAcAC,OAIVA,IAAA,WAAa,KAAb,aAIAA,IAAA,8BAAgC,KAAhC,gCAIAA,IAAA,4BAA8B,KAA9B,8BAIAA,IAAA,4BAA8B,KAA9B,8BAIAA,IAAA,6BAA+B,KAA/B,+BApBUA,OAAA","names":["MimeType","TypeTagVariants","ScriptTransactionArgumentVariants","TransactionPayloadVariants","TransactionVariants","TransactionAuthenticatorVariant","AccountAuthenticatorVariant","AnyPublicKeyVariant","AnySignatureVariant","TransactionResponseType","MoveFunctionVisibility","MoveAbility","RoleType","SigningScheme","SigningSchemeInput","DeriveScheme"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as t}from"./chunk-62SCW5NH.mjs";import{a as r}from"./chunk-RYETO74W.mjs";import{a as s}from"./chunk-EFIYW4WK.mjs";var o=class n extends s{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:i,signature:l}=e;return this.publicKey.verifySignature({message:i,signature:l})}serialize(e){if(this.publicKey instanceof r)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof t)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let i=e.deserializeUleb128AsU32();switch(i){case 0:return new n(r.load(e));case 1:return new n(t.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${i}`)}}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-YYRDFZE6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/anyPublicKey.ts"],"sourcesContent":["import { Serializer, Deserializer } from \"../../bcs\";\nimport { AnyPublicKeyVariant, HexInput } from \"../../types\";\nimport { AnySignature } from \"./anySignature\";\nimport { PublicKey } from \"./asymmetricCrypto\";\nimport { Ed25519PublicKey } from \"./ed25519\";\nimport { Secp256k1PublicKey } from \"./secp256k1\";\n\n/**\n * Represents any public key supported by Aptos.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Any unified authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class AnyPublicKey extends PublicKey {\n /**\n * Reference to the inner public key\n */\n public readonly publicKey: PublicKey;\n\n constructor(publicKey: PublicKey) {\n super();\n this.publicKey = publicKey;\n }\n\n /**\n * Get the public key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the public key\n */\n toUint8Array(): Uint8Array {\n return this.publicKey.toUint8Array();\n }\n\n /**\n * Get the public key as a hex string with the 0x prefix.\n *\n * @returns string representation of the public key\n */\n toString(): string {\n return this.publicKey.toString();\n }\n\n /**\n * Verifies a signed data with a public key\n *\n * @param args.message message\n * @param args.signature The signature\n * @returns true if the signature is valid\n */\n verifySignature(args: { message: HexInput; signature: AnySignature }): boolean {\n const { message, signature } = args;\n return this.publicKey.verifySignature({ message, signature });\n }\n\n serialize(serializer: Serializer): void {\n if (this.publicKey instanceof Ed25519PublicKey) {\n serializer.serializeU32AsUleb128(AnyPublicKeyVariant.Ed25519);\n this.publicKey.serialize(serializer);\n } else if (this.publicKey instanceof Secp256k1PublicKey) {\n serializer.serializeU32AsUleb128(AnyPublicKeyVariant.Secp256k1);\n this.publicKey.serialize(serializer);\n } else {\n throw new Error(\"Unknown public key type\");\n }\n }\n\n static deserialize(deserializer: Deserializer): AnyPublicKey {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case AnyPublicKeyVariant.Ed25519:\n return new AnyPublicKey(Ed25519PublicKey.load(deserializer));\n case AnyPublicKeyVariant.Secp256k1:\n return new AnyPublicKey(Secp256k1PublicKey.load(deserializer));\n default:\n throw new Error(`Unknown variant index for AnyPublicKey: ${index}`);\n }\n }\n}\n"],"mappings":"2HAeO,IAAMA,EAAN,MAAMC,UAAqBC,CAAU,CAM1C,YAAYC,EAAsB,CAChC,MAAM,EACN,KAAK,UAAYA,CACnB,CAOA,cAA2B,CACzB,OAAO,KAAK,UAAU,aAAa,CACrC,CAOA,UAAmB,CACjB,OAAO,KAAK,UAAU,SAAS,CACjC,CASA,gBAAgBC,EAA+D,CAC7E,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EAC/B,OAAO,KAAK,UAAU,gBAAgB,CAAE,QAAAC,EAAS,UAAAC,CAAU,CAAC,CAC9D,CAEA,UAAUC,EAA8B,CACtC,GAAI,KAAK,qBAAqBC,EAC5BD,EAAW,uBAAiD,EAC5D,KAAK,UAAU,UAAUA,CAAU,UAC1B,KAAK,qBAAqBE,EACnCF,EAAW,uBAAmD,EAC9D,KAAK,UAAU,UAAUA,CAAU,MAEnC,OAAM,IAAI,MAAM,yBAAyB,CAE7C,CAEA,OAAO,YAAYG,EAA0C,CAC3D,IAAMC,EAAQD,EAAa,wBAAwB,EACnD,OAAQC,EAAO,CACb,OACE,OAAO,IAAIV,EAAaO,EAAiB,KAAKE,CAAY,CAAC,EAC7D,OACE,OAAO,IAAIT,EAAaQ,EAAmB,KAAKC,CAAY,CAAC,EAC/D,QACE,MAAM,IAAI,MAAM,2CAA2CC,CAAK,EAAE,CACtE,CACF,CACF","names":["AnyPublicKey","_AnyPublicKey","PublicKey","publicKey","args","message","signature","serializer","Ed25519PublicKey","Secp256k1PublicKey","deserializer","index"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as l}from"./chunk-QWVR4RCV.mjs";import{a as p,b as g}from"./chunk-U25N2VWA.mjs";import{a as h}from"./chunk-44MGBJ73.mjs";import{a as z}from"./chunk-YYRDFZE6.mjs";import{a as d,c as b}from"./chunk-RYETO74W.mjs";import{a as y}from"./chunk-HA6JD5R6.mjs";var a=class extends y{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return u.load(t);case 1:return n.load(t);case 2:return c.load(t);case 3:return o.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}},u=class s extends a{constructor(e,i){super();this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=d.deserialize(e),r=b.deserialize(e);return new s(i,r)}},n=class s extends a{constructor(e,i){super();this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=p.deserialize(e),r=g.deserialize(e);return new s(i,r)}},c=class s extends a{constructor(e,i){super();this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=z.deserialize(e),r=l.deserialize(e);return new s(i,r)}},o=class s extends a{constructor(e,i,r){super();this.public_keys=e,this.signatures=i,this.signatures_bitmap=r}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),e.serializeVector(this.signatures),e.serializeBytes(this.signatures_bitmap)}static load(e){let i=h.deserialize(e),r=e.deserializeVector(l),A=e.deserializeBytes();return new s(i,r,A)}};export{a,u as b,n as c,c as d,o as e};
|
|
2
|
+
//# sourceMappingURL=chunk-Z2UDRTHA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/authenticator/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\nimport { Serializer, Deserializer, Serializable } from \"../../bcs\";\nimport { AnyPublicKey } from \"../../core/crypto/anyPublicKey\";\nimport { AnySignature } from \"../../core/crypto/anySignature\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"../../core/crypto/ed25519\";\nimport { MultiEd25519PublicKey, MultiEd25519Signature } from \"../../core/crypto/multiEd25519\";\nimport { MultiKey } from \"../../core/crypto/multiKey\";\nimport { AccountAuthenticatorVariant } from \"../../types\";\n\nexport abstract class AccountAuthenticator extends Serializable {\n abstract serialize(serializer: Serializer): void;\n\n static deserialize(deserializer: Deserializer): AccountAuthenticator {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case AccountAuthenticatorVariant.Ed25519:\n return AccountAuthenticatorEd25519.load(deserializer);\n case AccountAuthenticatorVariant.MultiEd25519:\n return AccountAuthenticatorMultiEd25519.load(deserializer);\n case AccountAuthenticatorVariant.SingleKey:\n return AccountAuthenticatorSingleKey.load(deserializer);\n case AccountAuthenticatorVariant.MultiKey:\n return AccountAuthenticatorMultiKey.load(deserializer);\n default:\n throw new Error(`Unknown variant index for AccountAuthenticator: ${index}`);\n }\n }\n}\n\n/**\n * Transaction authenticator Ed25519 for a multi signer transaction\n *\n * @param public_key Account's Ed25519 public key.\n * @param signature Account's Ed25519 signature\n *\n */\nexport class AccountAuthenticatorEd25519 extends AccountAuthenticator {\n public readonly public_key: Ed25519PublicKey;\n\n public readonly signature: Ed25519Signature;\n\n constructor(public_key: Ed25519PublicKey, signature: Ed25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.Ed25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorEd25519 {\n const public_key = Ed25519PublicKey.deserialize(deserializer);\n const signature = Ed25519Signature.deserialize(deserializer);\n return new AccountAuthenticatorEd25519(public_key, signature);\n }\n}\n\n/**\n * Transaction authenticator Multi Ed25519 for a multi signers transaction\n *\n * @param public_key Account's MultiEd25519 public key.\n * @param signature Account's MultiEd25519 signature\n *\n */\nexport class AccountAuthenticatorMultiEd25519 extends AccountAuthenticator {\n public readonly public_key: MultiEd25519PublicKey;\n\n public readonly signature: MultiEd25519Signature;\n\n constructor(public_key: MultiEd25519PublicKey, signature: MultiEd25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiEd25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorMultiEd25519 {\n const public_key = MultiEd25519PublicKey.deserialize(deserializer);\n const signature = MultiEd25519Signature.deserialize(deserializer);\n return new AccountAuthenticatorMultiEd25519(public_key, signature);\n }\n}\n\n/**\n * AccountAuthenticatorSingleKey for a single signer\n *\n * @param public_key AnyPublicKey\n * @param signature AnySignature\n *\n */\nexport class AccountAuthenticatorSingleKey extends AccountAuthenticator {\n public readonly public_key: AnyPublicKey;\n\n public readonly signature: AnySignature;\n\n constructor(public_key: AnyPublicKey, signature: AnySignature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.SingleKey);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorSingleKey {\n const public_key = AnyPublicKey.deserialize(deserializer);\n const signature = AnySignature.deserialize(deserializer);\n return new AccountAuthenticatorSingleKey(public_key, signature);\n }\n}\n\n/**\n * AccountAuthenticatorMultiKey for a multi signer\n *\n * @param public_keys MultiKey\n * @param signatures Signature\n *\n */\nexport class AccountAuthenticatorMultiKey extends AccountAuthenticator {\n public readonly public_keys: MultiKey;\n\n public readonly signatures: Array<AnySignature>;\n\n public readonly signatures_bitmap: Uint8Array;\n\n constructor(public_keys: MultiKey, signatures: Array<AnySignature>, signatures_bitmap: Uint8Array) {\n super();\n this.public_keys = public_keys;\n this.signatures = signatures;\n this.signatures_bitmap = signatures_bitmap;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiKey);\n this.public_keys.serialize(serializer);\n serializer.serializeVector<AnySignature>(this.signatures);\n serializer.serializeBytes(this.signatures_bitmap);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorMultiKey {\n const public_keys = MultiKey.deserialize(deserializer);\n const signatures = deserializer.deserializeVector(AnySignature);\n const signatures_bitmap = deserializer.deserializeBytes();\n return new AccountAuthenticatorMultiKey(public_keys, signatures, signatures_bitmap);\n }\n}\n"],"mappings":"oQAaO,IAAeA,EAAf,cAA4CC,CAAa,CAG9D,OAAO,YAAYC,EAAkD,CACnE,IAAMC,EAAQD,EAAa,wBAAwB,EACnD,OAAQC,EAAO,CACb,OACE,OAAOC,EAA4B,KAAKF,CAAY,EACtD,OACE,OAAOG,EAAiC,KAAKH,CAAY,EAC3D,OACE,OAAOI,EAA8B,KAAKJ,CAAY,EACxD,OACE,OAAOK,EAA6B,KAAKL,CAAY,EACvD,QACE,MAAM,IAAI,MAAM,mDAAmDC,CAAK,EAAE,CAC9E,CACF,CACF,EASaC,EAAN,MAAMI,UAAoCR,CAAqB,CAKpE,YAAYS,EAA8BC,EAA6B,CACrE,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAEA,UAAUC,EAA8B,CACtCA,EAAW,uBAAyD,EACpE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,KAAKT,EAAyD,CACnE,IAAMO,EAAaG,EAAiB,YAAYV,CAAY,EACtDQ,EAAYG,EAAiB,YAAYX,CAAY,EAC3D,OAAO,IAAIM,EAA4BC,EAAYC,CAAS,CAC9D,CACF,EASaL,EAAN,MAAMS,UAAyCd,CAAqB,CAKzE,YAAYS,EAAmCC,EAAkC,CAC/E,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAEA,UAAUC,EAA8B,CACtCA,EAAW,uBAA8D,EACzE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,KAAKT,EAA8D,CACxE,IAAMO,EAAaM,EAAsB,YAAYb,CAAY,EAC3DQ,EAAYM,EAAsB,YAAYd,CAAY,EAChE,OAAO,IAAIY,EAAiCL,EAAYC,CAAS,CACnE,CACF,EASaJ,EAAN,MAAMW,UAAsCjB,CAAqB,CAKtE,YAAYS,EAA0BC,EAAyB,CAC7D,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAEA,UAAUC,EAA8B,CACtCA,EAAW,uBAA2D,EACtE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,KAAKT,EAA2D,CACrE,IAAMO,EAAaS,EAAa,YAAYhB,CAAY,EAClDQ,EAAYS,EAAa,YAAYjB,CAAY,EACvD,OAAO,IAAIe,EAA8BR,EAAYC,CAAS,CAChE,CACF,EASaH,EAAN,MAAMa,UAAqCpB,CAAqB,CAOrE,YAAYqB,EAAuBC,EAAiCC,EAA+B,CACjG,MAAM,EACN,KAAK,YAAcF,EACnB,KAAK,WAAaC,EAClB,KAAK,kBAAoBC,CAC3B,CAEA,UAAUZ,EAA8B,CACtCA,EAAW,uBAA0D,EACrE,KAAK,YAAY,UAAUA,CAAU,EACrCA,EAAW,gBAA8B,KAAK,UAAU,EACxDA,EAAW,eAAe,KAAK,iBAAiB,CAClD,CAEA,OAAO,KAAKT,EAA0D,CACpE,IAAMmB,EAAcG,EAAS,YAAYtB,CAAY,EAC/CoB,EAAapB,EAAa,kBAAkBiB,CAAY,EACxDI,EAAoBrB,EAAa,iBAAiB,EACxD,OAAO,IAAIkB,EAA6BC,EAAaC,EAAYC,CAAiB,CACpF,CACF","names":["AccountAuthenticator","Serializable","deserializer","index","AccountAuthenticatorEd25519","AccountAuthenticatorMultiEd25519","AccountAuthenticatorSingleKey","AccountAuthenticatorMultiKey","_AccountAuthenticatorEd25519","public_key","signature","serializer","Ed25519PublicKey","Ed25519Signature","_AccountAuthenticatorMultiEd25519","MultiEd25519PublicKey","MultiEd25519Signature","_AccountAuthenticatorSingleKey","AnyPublicKey","AnySignature","_AccountAuthenticatorMultiKey","public_keys","signatures","signatures_bitmap","MultiKey"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AptosConfig } from '../api/aptosConfig.mjs';
|
|
2
|
+
import { AptosResponse } from './types.mjs';
|
|
3
|
+
import { ClientRequest, Client, ClientResponse, AptosRequest } from '../types/index.mjs';
|
|
4
|
+
import '../utils/apiEndpoints.mjs';
|
|
5
|
+
import '../utils/const.mjs';
|
|
6
|
+
import '../types/indexer.mjs';
|
|
7
|
+
import '../types/generated/operations.mjs';
|
|
8
|
+
import '../types/generated/types.mjs';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Given a url and method, sends the request with axios and
|
|
12
|
+
* returns the response.
|
|
13
|
+
*/
|
|
14
|
+
declare function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>>;
|
|
15
|
+
/**
|
|
16
|
+
* The main function to use when doing an API request.
|
|
17
|
+
*
|
|
18
|
+
* @param options AptosRequest
|
|
19
|
+
* @param aptosConfig The config information for the SDK client instance
|
|
20
|
+
* @returns the response or AptosApiError
|
|
21
|
+
*/
|
|
22
|
+
declare function aptosRequest<Req extends {}, Res extends {}>(options: AptosRequest, aptosConfig: AptosConfig): Promise<AptosResponse<Req, Res>>;
|
|
23
|
+
|
|
24
|
+
export { aptosRequest, request };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AptosConfig } from '../api/aptosConfig.mjs';
|
|
2
|
+
import { AptosResponse } from './types.mjs';
|
|
3
|
+
import { MimeType, AnyNumber, ClientConfig } from '../types/index.mjs';
|
|
4
|
+
import { AptosApiType } from '../utils/const.mjs';
|
|
5
|
+
import '../utils/apiEndpoints.mjs';
|
|
6
|
+
import '../types/indexer.mjs';
|
|
7
|
+
import '../types/generated/operations.mjs';
|
|
8
|
+
import '../types/generated/types.mjs';
|
|
9
|
+
|
|
10
|
+
type GetRequestOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* The config for the API client
|
|
13
|
+
*/
|
|
14
|
+
aptosConfig: AptosConfig;
|
|
15
|
+
/**
|
|
16
|
+
* The type of API endpoint to call e.g. fullnode, indexer, etc
|
|
17
|
+
*/
|
|
18
|
+
type: AptosApiType;
|
|
19
|
+
/**
|
|
20
|
+
* The name of the API method
|
|
21
|
+
*/
|
|
22
|
+
originMethod: string;
|
|
23
|
+
/**
|
|
24
|
+
* The URL path to the API method
|
|
25
|
+
*/
|
|
26
|
+
path: string;
|
|
27
|
+
/**
|
|
28
|
+
* The content type of the request body
|
|
29
|
+
*/
|
|
30
|
+
contentType?: MimeType;
|
|
31
|
+
/**
|
|
32
|
+
* The accepted content type of the response of the API
|
|
33
|
+
*/
|
|
34
|
+
acceptType?: MimeType;
|
|
35
|
+
/**
|
|
36
|
+
* The query parameters for the request
|
|
37
|
+
*/
|
|
38
|
+
params?: Record<string, string | AnyNumber | boolean | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Specific client overrides for this request to override aptosConfig
|
|
41
|
+
*/
|
|
42
|
+
overrides?: ClientConfig;
|
|
43
|
+
};
|
|
44
|
+
type GetAptosRequestOptions = Omit<GetRequestOptions, "type">;
|
|
45
|
+
/**
|
|
46
|
+
* Main function to do a Get request
|
|
47
|
+
*
|
|
48
|
+
* @param options GetRequestOptions
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
declare function get<Req extends {}, Res extends {}>(options: GetRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
52
|
+
declare function getAptosFullNode<Req extends {}, Res extends {}>(options: GetAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
53
|
+
declare function paginateWithCursor<Req extends Record<string, any>, Res extends any[]>(options: GetAptosRequestOptions): Promise<Res>;
|
|
54
|
+
|
|
55
|
+
export { GetAptosRequestOptions, GetRequestOptions, get, getAptosFullNode, paginateWithCursor };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c}from"../chunk-3JVGSFHP.mjs";import"../chunk-KC64ESLO.mjs";import"../chunk-LV33NV4J.mjs";import"../chunk-EGOYLZBU.mjs";import"../chunk-FYIFBLHU.mjs";import"../chunk-6FBKUTGF.mjs";import"../chunk-Y7VR7X5W.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-ZWH2ESXT.mjs";export{a as get,b as getAptosFullNode,c as paginateWithCursor};
|
|
2
|
+
//# sourceMappingURL=get.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { aptosRequest, request } from './core.mjs';
|
|
2
|
+
export { GetAptosRequestOptions, GetRequestOptions, get, getAptosFullNode, paginateWithCursor } from './get.mjs';
|
|
3
|
+
export { PostAptosRequestOptions, PostRequestOptions, post, postAptosFaucet, postAptosFullNode, postAptosIndexer } from './post.mjs';
|
|
4
|
+
export { AptosApiError, AptosResponse } from './types.mjs';
|
|
5
|
+
import '../api/aptosConfig.mjs';
|
|
6
|
+
import '../types/index.mjs';
|
|
7
|
+
import '../utils/apiEndpoints.mjs';
|
|
8
|
+
import '../types/indexer.mjs';
|
|
9
|
+
import '../types/generated/operations.mjs';
|
|
10
|
+
import '../types/generated/types.mjs';
|
|
11
|
+
import '../utils/const.mjs';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../chunk-N2FKVZ4D.mjs";import{a as d,b as e,c as f}from"../chunk-3JVGSFHP.mjs";import{a as g,b as h,c as i,d as j}from"../chunk-GEFQFRL3.mjs";import"../chunk-KC64ESLO.mjs";import"../chunk-LV33NV4J.mjs";import{a as b,b as c}from"../chunk-EGOYLZBU.mjs";import"../chunk-FYIFBLHU.mjs";import{a}from"../chunk-6FBKUTGF.mjs";import"../chunk-Y7VR7X5W.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-ZWH2ESXT.mjs";export{a as AptosApiError,c as aptosRequest,d as get,e as getAptosFullNode,f as paginateWithCursor,g as post,j as postAptosFaucet,h as postAptosFullNode,i as postAptosIndexer,b as request};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AptosConfig } from '../api/aptosConfig.mjs';
|
|
2
|
+
import { AptosResponse } from './types.mjs';
|
|
3
|
+
import { MimeType, AnyNumber, ClientConfig } from '../types/index.mjs';
|
|
4
|
+
import { AptosApiType } from '../utils/const.mjs';
|
|
5
|
+
import '../utils/apiEndpoints.mjs';
|
|
6
|
+
import '../types/indexer.mjs';
|
|
7
|
+
import '../types/generated/operations.mjs';
|
|
8
|
+
import '../types/generated/types.mjs';
|
|
9
|
+
|
|
10
|
+
type PostRequestOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* The config for the API client
|
|
13
|
+
*/
|
|
14
|
+
aptosConfig: AptosConfig;
|
|
15
|
+
/**
|
|
16
|
+
* The type of API endpoint to call e.g. fullnode, indexer, etc
|
|
17
|
+
*/
|
|
18
|
+
type: AptosApiType;
|
|
19
|
+
/**
|
|
20
|
+
* The name of the API method
|
|
21
|
+
*/
|
|
22
|
+
originMethod: string;
|
|
23
|
+
/**
|
|
24
|
+
* The URL path to the API method
|
|
25
|
+
*/
|
|
26
|
+
path: string;
|
|
27
|
+
/**
|
|
28
|
+
* The content type of the request body
|
|
29
|
+
*/
|
|
30
|
+
contentType?: MimeType;
|
|
31
|
+
/**
|
|
32
|
+
* The accepted content type of the response of the API
|
|
33
|
+
*/
|
|
34
|
+
acceptType?: MimeType;
|
|
35
|
+
/**
|
|
36
|
+
* The query parameters for the request
|
|
37
|
+
*/
|
|
38
|
+
params?: Record<string, string | AnyNumber | boolean | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* The body of the request, should match the content type of the request
|
|
41
|
+
*/
|
|
42
|
+
body?: any;
|
|
43
|
+
/**
|
|
44
|
+
* Specific client overrides for this request to override aptosConfig
|
|
45
|
+
*/
|
|
46
|
+
overrides?: ClientConfig;
|
|
47
|
+
};
|
|
48
|
+
type PostAptosRequestOptions = Omit<PostRequestOptions, "type">;
|
|
49
|
+
/**
|
|
50
|
+
* Main function to do a Post request
|
|
51
|
+
*
|
|
52
|
+
* @param options PostRequestOptions
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
declare function post<Req extends {}, Res extends {}>(options: PostRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
56
|
+
declare function postAptosFullNode<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
57
|
+
declare function postAptosIndexer<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
58
|
+
declare function postAptosFaucet<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
59
|
+
|
|
60
|
+
export { PostAptosRequestOptions, PostRequestOptions, post, postAptosFaucet, postAptosFullNode, postAptosIndexer };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d}from"../chunk-GEFQFRL3.mjs";import"../chunk-KC64ESLO.mjs";import"../chunk-LV33NV4J.mjs";import"../chunk-EGOYLZBU.mjs";import"../chunk-FYIFBLHU.mjs";import"../chunk-6FBKUTGF.mjs";import"../chunk-Y7VR7X5W.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-ZWH2ESXT.mjs";export{a as post,d as postAptosFaucet,b as postAptosFullNode,c as postAptosIndexer};
|
|
2
|
+
//# sourceMappingURL=post.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AptosRequest } from '../types/index.mjs';
|
|
2
|
+
import '../utils/apiEndpoints.mjs';
|
|
3
|
+
import '../types/indexer.mjs';
|
|
4
|
+
import '../types/generated/operations.mjs';
|
|
5
|
+
import '../types/generated/types.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The API response type
|
|
9
|
+
*
|
|
10
|
+
* @param status - the response status. i.e. 200
|
|
11
|
+
* @param statusText - the response message
|
|
12
|
+
* @param data the response data
|
|
13
|
+
* @param url the url the request was made to
|
|
14
|
+
* @param headers the response headers
|
|
15
|
+
* @param config (optional) - the request object
|
|
16
|
+
* @param request (optional) - the request object
|
|
17
|
+
*/
|
|
18
|
+
interface AptosResponse<Req, Res> {
|
|
19
|
+
status: number;
|
|
20
|
+
statusText: string;
|
|
21
|
+
data: Res;
|
|
22
|
+
url: string;
|
|
23
|
+
headers: any;
|
|
24
|
+
config?: any;
|
|
25
|
+
request?: Req;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The type returned from an API error
|
|
29
|
+
*
|
|
30
|
+
* @param name - the error name "AptosApiError"
|
|
31
|
+
* @param url the url the request was made to
|
|
32
|
+
* @param status - the response status. i.e. 400
|
|
33
|
+
* @param statusText - the response message
|
|
34
|
+
* @param data the response data
|
|
35
|
+
* @param request - the AptosRequest
|
|
36
|
+
*/
|
|
37
|
+
declare class AptosApiError extends Error {
|
|
38
|
+
readonly url: string;
|
|
39
|
+
readonly status: number;
|
|
40
|
+
readonly statusText: string;
|
|
41
|
+
readonly data: any;
|
|
42
|
+
readonly request: AptosRequest;
|
|
43
|
+
constructor(request: AptosRequest, response: AptosResponse<any, any>, message: string);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { AptosApiError, AptosResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { AccountAddress } from './accountAddress.mjs';
|
|
2
|
+
import { AuthenticationKey } from './authenticationKey.mjs';
|
|
3
|
+
import { PublicKey, PrivateKey, Signature } from './crypto/asymmetricCrypto.mjs';
|
|
4
|
+
import { SigningScheme, GenerateAccount, SigningSchemeInput, HexInput } from '../types/index.mjs';
|
|
5
|
+
import '../bcs/serializer.mjs';
|
|
6
|
+
import './hex.mjs';
|
|
7
|
+
import './common.mjs';
|
|
8
|
+
import '../utils/apiEndpoints.mjs';
|
|
9
|
+
import '../types/indexer.mjs';
|
|
10
|
+
import '../types/generated/operations.mjs';
|
|
11
|
+
import '../types/generated/types.mjs';
|
|
12
|
+
import '../bcs/deserializer.mjs';
|
|
13
|
+
import '../transactions/instances/transactionArgument.mjs';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Class for creating and managing account on Aptos network
|
|
17
|
+
*
|
|
18
|
+
* Use this class to create accounts, sign transactions, and more.
|
|
19
|
+
* Note: Creating an account instance does not create the account on-chain.
|
|
20
|
+
*
|
|
21
|
+
* Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports
|
|
22
|
+
* `Legacy` and `Unified` authentications.
|
|
23
|
+
*
|
|
24
|
+
* @Legacy includes `ED25519` and `MultiED25519`
|
|
25
|
+
* @Unified includes `SingleSender` and `MultiSender`, where currently
|
|
26
|
+
* `SingleSender` supports `ED25519` and `Secp256k1`, and `MultiSender` supports
|
|
27
|
+
* `MultiED25519`.
|
|
28
|
+
*
|
|
29
|
+
* In TypeScript SDK, we support all of these options:
|
|
30
|
+
*
|
|
31
|
+
* @generate default to generate Legacy Ed25519 keys, with an optional `legacy` boolean argument
|
|
32
|
+
* that lets you generate new keys conforming to the Unified authentication.
|
|
33
|
+
*
|
|
34
|
+
* @fromPrivateKey derives an account by a provided private key and address, with an optional
|
|
35
|
+
* `legacy` boolean argument that lets you generate new keys conforming to the Unified authentication.
|
|
36
|
+
*
|
|
37
|
+
* @fromDerivationPath derives an account with bip44 path and mnemonics,
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
declare class Account {
|
|
41
|
+
/**
|
|
42
|
+
* Public key associated with the account
|
|
43
|
+
*/
|
|
44
|
+
readonly publicKey: PublicKey;
|
|
45
|
+
/**
|
|
46
|
+
* Private key associated with the account
|
|
47
|
+
*/
|
|
48
|
+
readonly privateKey: PrivateKey;
|
|
49
|
+
/**
|
|
50
|
+
* Account address associated with the account
|
|
51
|
+
*/
|
|
52
|
+
readonly accountAddress: AccountAddress;
|
|
53
|
+
/**
|
|
54
|
+
* Signing scheme used to sign transactions
|
|
55
|
+
*/
|
|
56
|
+
readonly signingScheme: SigningScheme;
|
|
57
|
+
/**
|
|
58
|
+
* constructor for Account
|
|
59
|
+
*
|
|
60
|
+
* Need to update this to use the new crypto library if new schemes are added.
|
|
61
|
+
*
|
|
62
|
+
* @param args.privateKey PrivateKey - private key of the account
|
|
63
|
+
* @param args.address AccountAddress - address of the account
|
|
64
|
+
* @param args.legacy optional. If set to true, the keypair authentication keys will be derived with a Legacy scheme.
|
|
65
|
+
* Defaults to deriving an authentication key with a Unified scheme
|
|
66
|
+
*
|
|
67
|
+
* This method is private because it should only be called by the factory static methods.
|
|
68
|
+
* @returns Account
|
|
69
|
+
*/
|
|
70
|
+
private constructor();
|
|
71
|
+
/**
|
|
72
|
+
* Derives an account with random private key and address.
|
|
73
|
+
*
|
|
74
|
+
* Default generation is using the Legacy ED25519 key
|
|
75
|
+
*
|
|
76
|
+
* @param args optional. Unify GenerateAccount type for Legacy and Unified keys
|
|
77
|
+
*
|
|
78
|
+
* Account input type to generate an account using Legacy
|
|
79
|
+
* Ed25519 or MultiEd25519 keys or without a specified `scheme`.
|
|
80
|
+
* ```
|
|
81
|
+
* GenerateAccountWithLegacyKey = {
|
|
82
|
+
* scheme?: SigningSchemeInput.Ed25519 | SigningSchemeInput.MultiEd25519;
|
|
83
|
+
* legacy: true;
|
|
84
|
+
* };
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* Account input type to generate an account using Unified
|
|
88
|
+
* Secp256k1Ecdsa key
|
|
89
|
+
* In this case `legacy` is always false
|
|
90
|
+
* ```
|
|
91
|
+
* GenerateAccountWithUnifiedKey = {
|
|
92
|
+
* scheme: SigningSchemeInput.Secp256k1Ecdsa;
|
|
93
|
+
* legacy?: false;
|
|
94
|
+
* };
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* @returns Account with the given signing scheme
|
|
98
|
+
*/
|
|
99
|
+
static generate(args?: GenerateAccount): Account;
|
|
100
|
+
/**
|
|
101
|
+
* Instantiates an account given a private key.
|
|
102
|
+
*
|
|
103
|
+
* This is used as a local calculation and therefore is used to instantiate an `Account`
|
|
104
|
+
* that has not had its authentication key rotated.
|
|
105
|
+
*
|
|
106
|
+
* @param privateKey PrivateKey - private key of the account
|
|
107
|
+
* @param args.legacy optional. If set to false, the keypair generated is a Unified keypair. Defaults
|
|
108
|
+
* to generating a Legacy Ed25519 keypair
|
|
109
|
+
*
|
|
110
|
+
* @returns Account
|
|
111
|
+
*/
|
|
112
|
+
static fromPrivateKey(args: {
|
|
113
|
+
privateKey: PrivateKey;
|
|
114
|
+
legacy?: boolean;
|
|
115
|
+
}): Account;
|
|
116
|
+
/**
|
|
117
|
+
* Instantiates an account given a private key and a specified account address.
|
|
118
|
+
* This is primarily used to instantiate an `Account` that has had its authentication key rotated.
|
|
119
|
+
*
|
|
120
|
+
* @param args.privateKey PrivateKey - the underlying private key for the account
|
|
121
|
+
* @param args.address AccountAddress - The account address the `Account` will sign for
|
|
122
|
+
* @param args.legacy optional. If set to false, the keypair generated is a Unified keypair. Defaults
|
|
123
|
+
* to generating a Legacy Ed25519 keypair
|
|
124
|
+
*
|
|
125
|
+
* @returns Account
|
|
126
|
+
*/
|
|
127
|
+
static fromPrivateKeyAndAddress(args: {
|
|
128
|
+
privateKey: PrivateKey;
|
|
129
|
+
address: AccountAddress;
|
|
130
|
+
legacy?: boolean;
|
|
131
|
+
}): Account;
|
|
132
|
+
/**
|
|
133
|
+
* Derives an account with bip44 path and mnemonics,
|
|
134
|
+
*
|
|
135
|
+
* @param args.scheme The signing scheme to derive with
|
|
136
|
+
* @param args.path the BIP44 derive hardened path (e.g. m/44'/637'/0'/0'/0') for Ed25519,
|
|
137
|
+
* or non-hardened path (e.g. m/44'/637'/0'/0/0) for secp256k1
|
|
138
|
+
* Detailed description: {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}
|
|
139
|
+
* @param args.mnemonic the mnemonic seed phrase of the account
|
|
140
|
+
* @param args.legacy optional. If set to false, the keypair generated is a Unified keypair. Defaults
|
|
141
|
+
* to generating a Legacy Ed25519 keypair
|
|
142
|
+
*
|
|
143
|
+
* @returns Account
|
|
144
|
+
*/
|
|
145
|
+
static fromDerivationPath(args: {
|
|
146
|
+
scheme: SigningSchemeInput;
|
|
147
|
+
path: string;
|
|
148
|
+
mnemonic: string;
|
|
149
|
+
legacy?: boolean;
|
|
150
|
+
}): Account;
|
|
151
|
+
/**
|
|
152
|
+
* This key enables account owners to rotate their private key(s)
|
|
153
|
+
* associated with the account without changing the address that hosts their account.
|
|
154
|
+
* See here for more info: {@link https://aptos.dev/concepts/accounts#single-signer-authentication}
|
|
155
|
+
*
|
|
156
|
+
* @param args.publicKey PublicKey - public key of the account
|
|
157
|
+
* @returns The authentication key for the associated account
|
|
158
|
+
*/
|
|
159
|
+
static authKey(args: {
|
|
160
|
+
publicKey: PublicKey;
|
|
161
|
+
}): AuthenticationKey;
|
|
162
|
+
/**
|
|
163
|
+
* Sign the given message with the private key.
|
|
164
|
+
*
|
|
165
|
+
* TODO: Add sign transaction or specific types
|
|
166
|
+
*
|
|
167
|
+
* @param data in HexInput format
|
|
168
|
+
* @returns Signature
|
|
169
|
+
*/
|
|
170
|
+
sign(data: HexInput): Signature;
|
|
171
|
+
/**
|
|
172
|
+
* Verify the given message and signature with the public key.
|
|
173
|
+
*
|
|
174
|
+
* @param args.message raw message data in HexInput format
|
|
175
|
+
* @param args.signature signed message Signature
|
|
176
|
+
* @returns
|
|
177
|
+
*/
|
|
178
|
+
verifySignature(args: {
|
|
179
|
+
message: HexInput;
|
|
180
|
+
signature: Signature;
|
|
181
|
+
}): boolean;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export { Account };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"../chunk-UPLWWSB4.mjs";import"../chunk-U3LO2FSJ.mjs";import"../chunk-U25N2VWA.mjs";import"../chunk-44MGBJ73.mjs";import"../chunk-YYRDFZE6.mjs";import"../chunk-62SCW5NH.mjs";import"../chunk-RYETO74W.mjs";import"../chunk-EFIYW4WK.mjs";import"../chunk-LR65XHSF.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-HVADSXTB.mjs";import"../chunk-BPYLPPEQ.mjs";import"../chunk-4ADA5BE7.mjs";import"../chunk-X32O46IB.mjs";import"../chunk-GTC7WHMV.mjs";import"../chunk-NZIJV4O2.mjs";import"../chunk-HA6JD5R6.mjs";import"../chunk-DNDWTM7A.mjs";import"../chunk-TIH6ARYP.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-Y7VR7X5W.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-ZWH2ESXT.mjs";export{a as Account};
|
|
2
|
+
//# sourceMappingURL=account.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|