@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,69 @@
|
|
|
1
|
+
import { Deserializer } from '../deserializer.mjs';
|
|
2
|
+
import { Serializable, Serializer } from '../serializer.mjs';
|
|
3
|
+
import { TransactionArgument } from '../../transactions/instances/transactionArgument.mjs';
|
|
4
|
+
import { Uint8, Uint16, Uint32, AnyNumber } from '../../types/index.mjs';
|
|
5
|
+
import '../../utils/apiEndpoints.mjs';
|
|
6
|
+
import '../../types/indexer.mjs';
|
|
7
|
+
import '../../types/generated/operations.mjs';
|
|
8
|
+
import '../../types/generated/types.mjs';
|
|
9
|
+
import '../../core/hex.mjs';
|
|
10
|
+
import '../../core/common.mjs';
|
|
11
|
+
|
|
12
|
+
declare class Bool extends Serializable implements TransactionArgument {
|
|
13
|
+
readonly value: boolean;
|
|
14
|
+
constructor(value: boolean);
|
|
15
|
+
serialize(serializer: Serializer): void;
|
|
16
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
17
|
+
serializeForScriptFunction(serializer: Serializer): void;
|
|
18
|
+
static deserialize(deserializer: Deserializer): Bool;
|
|
19
|
+
}
|
|
20
|
+
declare class U8 extends Serializable implements TransactionArgument {
|
|
21
|
+
readonly value: Uint8;
|
|
22
|
+
constructor(value: Uint8);
|
|
23
|
+
serialize(serializer: Serializer): void;
|
|
24
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
25
|
+
serializeForScriptFunction(serializer: Serializer): void;
|
|
26
|
+
static deserialize(deserializer: Deserializer): U8;
|
|
27
|
+
}
|
|
28
|
+
declare class U16 extends Serializable implements TransactionArgument {
|
|
29
|
+
readonly value: Uint16;
|
|
30
|
+
constructor(value: Uint16);
|
|
31
|
+
serialize(serializer: Serializer): void;
|
|
32
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
33
|
+
serializeForScriptFunction(serializer: Serializer): void;
|
|
34
|
+
static deserialize(deserializer: Deserializer): U16;
|
|
35
|
+
}
|
|
36
|
+
declare class U32 extends Serializable implements TransactionArgument {
|
|
37
|
+
readonly value: Uint32;
|
|
38
|
+
constructor(value: Uint32);
|
|
39
|
+
serialize(serializer: Serializer): void;
|
|
40
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
41
|
+
serializeForScriptFunction(serializer: Serializer): void;
|
|
42
|
+
static deserialize(deserializer: Deserializer): U32;
|
|
43
|
+
}
|
|
44
|
+
declare class U64 extends Serializable implements TransactionArgument {
|
|
45
|
+
readonly value: bigint;
|
|
46
|
+
constructor(value: AnyNumber);
|
|
47
|
+
serialize(serializer: Serializer): void;
|
|
48
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
49
|
+
serializeForScriptFunction(serializer: Serializer): void;
|
|
50
|
+
static deserialize(deserializer: Deserializer): U64;
|
|
51
|
+
}
|
|
52
|
+
declare class U128 extends Serializable implements TransactionArgument {
|
|
53
|
+
readonly value: bigint;
|
|
54
|
+
constructor(value: AnyNumber);
|
|
55
|
+
serialize(serializer: Serializer): void;
|
|
56
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
57
|
+
serializeForScriptFunction(serializer: Serializer): void;
|
|
58
|
+
static deserialize(deserializer: Deserializer): U128;
|
|
59
|
+
}
|
|
60
|
+
declare class U256 extends Serializable implements TransactionArgument {
|
|
61
|
+
readonly value: bigint;
|
|
62
|
+
constructor(value: AnyNumber);
|
|
63
|
+
serialize(serializer: Serializer): void;
|
|
64
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
65
|
+
serializeForScriptFunction(serializer: Serializer): void;
|
|
66
|
+
static deserialize(deserializer: Deserializer): U256;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { Bool, U128, U16, U256, U32, U64, U8 };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g}from"../../chunk-X32O46IB.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 Bool,f as U128,c as U16,g as U256,d as U32,e as U64,b as U8};
|
|
2
|
+
//# sourceMappingURL=movePrimitives.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { U8, U16, U32, U64, U128, U256, Bool } from './movePrimitives.mjs';
|
|
2
|
+
import { Serializable, Serializer } from '../serializer.mjs';
|
|
3
|
+
import { Deserializer, Deserializable } from '../deserializer.mjs';
|
|
4
|
+
import { HexInput, AnyNumber } from '../../types/index.mjs';
|
|
5
|
+
import { EntryFunctionArgument, TransactionArgument } from '../../transactions/instances/transactionArgument.mjs';
|
|
6
|
+
import '../../utils/apiEndpoints.mjs';
|
|
7
|
+
import '../../types/indexer.mjs';
|
|
8
|
+
import '../../types/generated/operations.mjs';
|
|
9
|
+
import '../../types/generated/types.mjs';
|
|
10
|
+
import '../../core/hex.mjs';
|
|
11
|
+
import '../../core/common.mjs';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* This class is the Aptos Typescript SDK representation of a Move `vector<T>`,
|
|
15
|
+
* where `T` represents either a primitive type (`bool`, `u8`, `u64`, ...)
|
|
16
|
+
* or a BCS-serializable struct itself.
|
|
17
|
+
*
|
|
18
|
+
* It is a BCS-serializable, array-like type that contains an array of values of type `T`,
|
|
19
|
+
* where `T` is a class that implements `Serializable`.
|
|
20
|
+
*
|
|
21
|
+
* The purpose of this class is to facilitate easy construction of BCS-serializable
|
|
22
|
+
* Move `vector<T>` types.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // in Move: `vector<u8> [1, 2, 3, 4];`
|
|
26
|
+
* const vecOfU8s = new MoveVector<U8>([new U8(1), new U8(2), new U8(3), new U8(4)]);
|
|
27
|
+
* // in Move: `std::bcs::to_bytes(vector<u8> [1, 2, 3, 4]);`
|
|
28
|
+
* const bcsBytes = vecOfU8s.toUint8Array();
|
|
29
|
+
*
|
|
30
|
+
* // vector<vector<u8>> [ vector<u8> [1], vector<u8> [1, 2, 3, 4], vector<u8> [5, 6, 7, 8] ];
|
|
31
|
+
* const vecOfVecs = new MoveVector<MoveVector<U8>>([
|
|
32
|
+
* new MoveVector<U8>([new U8(1)]),
|
|
33
|
+
* MoveVector.U8([1, 2, 3, 4]),
|
|
34
|
+
* MoveVector.U8([5, 6, 7, 8]),
|
|
35
|
+
* ]);
|
|
36
|
+
*
|
|
37
|
+
* // vector<Option<u8>> [ std::option::some<u8>(1), std::option::some<u8>(2) ];
|
|
38
|
+
* const vecOfOptionU8s = new MoveVector<MoveOption<U8>>([
|
|
39
|
+
* MoveOption.U8(1),
|
|
40
|
+
* MoveOption.U8(2),
|
|
41
|
+
* ]);
|
|
42
|
+
*
|
|
43
|
+
* // vector<MoveString> [ std::string::utf8(b"hello"), std::string::utf8(b"world") ];
|
|
44
|
+
* const vecOfStrings = new MoveVector([new MoveString("hello"), new MoveString("world")]);
|
|
45
|
+
* const vecOfStrings2 = MoveVector.MoveString(["hello", "world"]);
|
|
46
|
+
*
|
|
47
|
+
* @params
|
|
48
|
+
* values: an Array<T> of values where T is a class that implements Serializable
|
|
49
|
+
* @returns a `MoveVector<T>` with the values `values`
|
|
50
|
+
*/
|
|
51
|
+
declare class MoveVector<T extends Serializable & EntryFunctionArgument> extends Serializable implements TransactionArgument {
|
|
52
|
+
values: Array<T>;
|
|
53
|
+
constructor(values: Array<T>);
|
|
54
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
55
|
+
/**
|
|
56
|
+
* NOTE: This function will only work when the inner values in the `MoveVector` are `U8`s.
|
|
57
|
+
* @param serializer
|
|
58
|
+
*/
|
|
59
|
+
serializeForScriptFunction(serializer: Serializer): void;
|
|
60
|
+
/**
|
|
61
|
+
* Factory method to generate a MoveVector of U8s from an array of numbers.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* const v = MoveVector.U8([1, 2, 3, 4]);
|
|
65
|
+
* @params values: an array of `numbers` to convert to U8s
|
|
66
|
+
* @returns a `MoveVector<U8>`
|
|
67
|
+
*/
|
|
68
|
+
static U8(values: Array<number> | HexInput): MoveVector<U8>;
|
|
69
|
+
/**
|
|
70
|
+
* Factory method to generate a MoveVector of U16s from an array of numbers.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* const v = MoveVector.U16([1, 2, 3, 4]);
|
|
74
|
+
* @params values: an array of `numbers` to convert to U16s
|
|
75
|
+
* @returns a `MoveVector<U16>`
|
|
76
|
+
*/
|
|
77
|
+
static U16(values: Array<number>): MoveVector<U16>;
|
|
78
|
+
/**
|
|
79
|
+
* Factory method to generate a MoveVector of U32s from an array of numbers.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* const v = MoveVector.U32([1, 2, 3, 4]);
|
|
83
|
+
* @params values: an array of `numbers` to convert to U32s
|
|
84
|
+
* @returns a `MoveVector<U32>`
|
|
85
|
+
*/
|
|
86
|
+
static U32(values: Array<number>): MoveVector<U32>;
|
|
87
|
+
/**
|
|
88
|
+
* Factory method to generate a MoveVector of U64s from an array of numbers or bigints.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* const v = MoveVector.U64([1, 2, 3, 4]);
|
|
92
|
+
* @params values: an array of numbers of type `number | bigint` to convert to U64s
|
|
93
|
+
* @returns a `MoveVector<U64>`
|
|
94
|
+
*/
|
|
95
|
+
static U64(values: Array<AnyNumber>): MoveVector<U64>;
|
|
96
|
+
/**
|
|
97
|
+
* Factory method to generate a MoveVector of U128s from an array of numbers or bigints.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* const v = MoveVector.U128([1, 2, 3, 4]);
|
|
101
|
+
* @params values: an array of numbers of type `number | bigint` to convert to U128s
|
|
102
|
+
* @returns a `MoveVector<U128>`
|
|
103
|
+
*/
|
|
104
|
+
static U128(values: Array<AnyNumber>): MoveVector<U128>;
|
|
105
|
+
/**
|
|
106
|
+
* Factory method to generate a MoveVector of U256s from an array of numbers or bigints.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* const v = MoveVector.U256([1, 2, 3, 4]);
|
|
110
|
+
* @params values: an array of numbers of type `number | bigint` to convert to U256s
|
|
111
|
+
* @returns a `MoveVector<U256>`
|
|
112
|
+
*/
|
|
113
|
+
static U256(values: Array<AnyNumber>): MoveVector<U256>;
|
|
114
|
+
/**
|
|
115
|
+
* Factory method to generate a MoveVector of Bools from an array of booleans.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* const v = MoveVector.Bool([true, false, true, false]);
|
|
119
|
+
* @params values: an array of `bools` to convert to Bools
|
|
120
|
+
* @returns a `MoveVector<Bool>`
|
|
121
|
+
*/
|
|
122
|
+
static Bool(values: Array<boolean>): MoveVector<Bool>;
|
|
123
|
+
/**
|
|
124
|
+
* Factory method to generate a MoveVector of MoveStrings from an array of strings.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* const v = MoveVector.MoveString(["hello", "world"]);
|
|
128
|
+
* @params values: an array of `strings` to convert to MoveStrings
|
|
129
|
+
* @returns a `MoveVector<MoveString>`
|
|
130
|
+
*/
|
|
131
|
+
static MoveString(values: Array<string>): MoveVector<MoveString>;
|
|
132
|
+
serialize(serializer: Serializer): void;
|
|
133
|
+
/**
|
|
134
|
+
* Deserialize a MoveVector of type T, specifically where T is a Serializable and Deserializable type.
|
|
135
|
+
*
|
|
136
|
+
* NOTE: This only works with a depth of one. Generics will not work.
|
|
137
|
+
*
|
|
138
|
+
* NOTE: This will not work with types that aren't of the Serializable class.
|
|
139
|
+
*
|
|
140
|
+
* If you're looking for a more flexible deserialization function, you can use the deserializeVector function
|
|
141
|
+
* in the Deserializer class.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* const vec = MoveVector.deserialize(deserializer, U64);
|
|
145
|
+
* @params deserializer: the Deserializer instance to use, with bytes loaded into it already.
|
|
146
|
+
* cls: the class to typecast the input values to, must be a Serializable and Deserializable type.
|
|
147
|
+
* @returns a MoveVector of the corresponding class T
|
|
148
|
+
* *
|
|
149
|
+
*/
|
|
150
|
+
static deserialize<T extends Serializable & EntryFunctionArgument>(deserializer: Deserializer, cls: Deserializable<T>): MoveVector<T>;
|
|
151
|
+
}
|
|
152
|
+
declare class MoveString extends Serializable implements TransactionArgument {
|
|
153
|
+
value: string;
|
|
154
|
+
constructor(value: string);
|
|
155
|
+
serialize(serializer: Serializer): void;
|
|
156
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
157
|
+
serializeForScriptFunction(serializer: Serializer): void;
|
|
158
|
+
static deserialize(deserializer: Deserializer): MoveString;
|
|
159
|
+
}
|
|
160
|
+
declare class MoveOption<T extends Serializable & EntryFunctionArgument> extends Serializable implements EntryFunctionArgument {
|
|
161
|
+
private vec;
|
|
162
|
+
readonly value?: T;
|
|
163
|
+
constructor(value?: T | null);
|
|
164
|
+
serializeForEntryFunction(serializer: Serializer): void;
|
|
165
|
+
/**
|
|
166
|
+
* Retrieves the inner value of the MoveOption.
|
|
167
|
+
*
|
|
168
|
+
* This method is inspired by Rust's `Option<T>.unwrap()`.
|
|
169
|
+
* In Rust, attempting to unwrap a `None` value results in a panic.
|
|
170
|
+
*
|
|
171
|
+
* Similarly, this method will throw an error if the value is not present.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* const option = new MoveOption<Bool>(new Bool(true));
|
|
175
|
+
* const value = option.unwrap(); // Returns the Bool instance
|
|
176
|
+
*
|
|
177
|
+
* @throws {Error} Throws an error if the MoveOption does not contain a value.
|
|
178
|
+
*
|
|
179
|
+
* @returns {T} The contained value if present.
|
|
180
|
+
*/
|
|
181
|
+
unwrap(): T;
|
|
182
|
+
isSome(): boolean;
|
|
183
|
+
serialize(serializer: Serializer): void;
|
|
184
|
+
/**
|
|
185
|
+
* Factory method to generate a MoveOption<U8> from a `number` or `undefined`.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* MoveOption.U8(1).isSome() === true;
|
|
189
|
+
* MoveOption.U8().isSome() === false;
|
|
190
|
+
* MoveOption.U8(undefined).isSome() === false;
|
|
191
|
+
* @params value: the value used to fill the MoveOption. If `value` is undefined
|
|
192
|
+
* the resulting MoveOption's .isSome() method will return false.
|
|
193
|
+
* @returns a MoveOption<U8> with an inner value `value`
|
|
194
|
+
*/
|
|
195
|
+
static U8(value?: number | null): MoveOption<U8>;
|
|
196
|
+
/**
|
|
197
|
+
* Factory method to generate a MoveOption<U16> from a `number` or `undefined`.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* MoveOption.U16(1).isSome() === true;
|
|
201
|
+
* MoveOption.U16().isSome() === false;
|
|
202
|
+
* MoveOption.U16(undefined).isSome() === false;
|
|
203
|
+
* @params value: the value used to fill the MoveOption. If `value` is undefined
|
|
204
|
+
* the resulting MoveOption's .isSome() method will return false.
|
|
205
|
+
* @returns a MoveOption<U16> with an inner value `value`
|
|
206
|
+
*/
|
|
207
|
+
static U16(value?: number | null): MoveOption<U16>;
|
|
208
|
+
/**
|
|
209
|
+
* Factory method to generate a MoveOption<U32> from a `number` or `undefined`.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* MoveOption.U32(1).isSome() === true;
|
|
213
|
+
* MoveOption.U32().isSome() === false;
|
|
214
|
+
* MoveOption.U32(undefined).isSome() === false;
|
|
215
|
+
* @params value: the value used to fill the MoveOption. If `value` is undefined
|
|
216
|
+
* the resulting MoveOption's .isSome() method will return false.
|
|
217
|
+
* @returns a MoveOption<U32> with an inner value `value`
|
|
218
|
+
*/
|
|
219
|
+
static U32(value?: number | null): MoveOption<U32>;
|
|
220
|
+
/**
|
|
221
|
+
* Factory method to generate a MoveOption<U64> from a `number` or a `bigint` or `undefined`.
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* MoveOption.U64(1).isSome() === true;
|
|
225
|
+
* MoveOption.U64().isSome() === false;
|
|
226
|
+
* MoveOption.U64(undefined).isSome() === false;
|
|
227
|
+
* @params value: the value used to fill the MoveOption. If `value` is undefined
|
|
228
|
+
* the resulting MoveOption's .isSome() method will return false.
|
|
229
|
+
* @returns a MoveOption<U64> with an inner value `value`
|
|
230
|
+
*/
|
|
231
|
+
static U64(value?: AnyNumber | null): MoveOption<U64>;
|
|
232
|
+
/**
|
|
233
|
+
* Factory method to generate a MoveOption<U128> from a `number` or a `bigint` or `undefined`.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* MoveOption.U128(1).isSome() === true;
|
|
237
|
+
* MoveOption.U128().isSome() === false;
|
|
238
|
+
* MoveOption.U128(undefined).isSome() === false;
|
|
239
|
+
* @params value: the value used to fill the MoveOption. If `value` is undefined
|
|
240
|
+
* the resulting MoveOption's .isSome() method will return false.
|
|
241
|
+
* @returns a MoveOption<U128> with an inner value `value`
|
|
242
|
+
*/
|
|
243
|
+
static U128(value?: AnyNumber | null): MoveOption<U128>;
|
|
244
|
+
/**
|
|
245
|
+
* Factory method to generate a MoveOption<U256> from a `number` or a `bigint` or `undefined`.
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* MoveOption.U256(1).isSome() === true;
|
|
249
|
+
* MoveOption.U256().isSome() === false;
|
|
250
|
+
* MoveOption.U256(undefined).isSome() === false;
|
|
251
|
+
* @params value: the value used to fill the MoveOption. If `value` is undefined
|
|
252
|
+
* the resulting MoveOption's .isSome() method will return false.
|
|
253
|
+
* @returns a MoveOption<U256> with an inner value `value`
|
|
254
|
+
*/
|
|
255
|
+
static U256(value?: AnyNumber | null): MoveOption<U256>;
|
|
256
|
+
/**
|
|
257
|
+
* Factory method to generate a MoveOption<Bool> from a `boolean` or `undefined`.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* MoveOption.Bool(true).isSome() === true;
|
|
261
|
+
* MoveOption.Bool().isSome() === false;
|
|
262
|
+
* MoveOption.Bool(undefined).isSome() === false;
|
|
263
|
+
* @params value: the value used to fill the MoveOption. If `value` is undefined
|
|
264
|
+
* the resulting MoveOption's .isSome() method will return false.
|
|
265
|
+
* @returns a MoveOption<Bool> with an inner value `value`
|
|
266
|
+
*/
|
|
267
|
+
static Bool(value?: boolean | null): MoveOption<Bool>;
|
|
268
|
+
/**
|
|
269
|
+
* Factory method to generate a MoveOption<MoveString> from a `string` or `undefined`.
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* MoveOption.MoveString("hello").isSome() === true;
|
|
273
|
+
* MoveOption.MoveString("").isSome() === true;
|
|
274
|
+
* MoveOption.MoveString().isSome() === false;
|
|
275
|
+
* MoveOption.MoveString(undefined).isSome() === false;
|
|
276
|
+
* @params value: the value used to fill the MoveOption. If `value` is undefined
|
|
277
|
+
* the resulting MoveOption's .isSome() method will return false.
|
|
278
|
+
* @returns a MoveOption<MoveString> with an inner value `value`
|
|
279
|
+
*/
|
|
280
|
+
static MoveString(value?: string | null): MoveOption<MoveString>;
|
|
281
|
+
static deserialize<U extends Serializable & EntryFunctionArgument>(deserializer: Deserializer, cls: Deserializable<U>): MoveOption<U>;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export { MoveOption, MoveString, MoveVector };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c}from"../../chunk-4ADA5BE7.mjs";import"../../chunk-X32O46IB.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{c as MoveOption,b as MoveString,a as MoveVector};
|
|
2
|
+
//# sourceMappingURL=moveStructs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { Hex } from '../core/hex.mjs';
|
|
2
|
+
import { Uint8, Uint16, Uint32, AnyNumber } from '../types/index.mjs';
|
|
3
|
+
import '../core/common.mjs';
|
|
4
|
+
import '../utils/apiEndpoints.mjs';
|
|
5
|
+
import '../types/indexer.mjs';
|
|
6
|
+
import '../types/generated/operations.mjs';
|
|
7
|
+
import '../types/generated/types.mjs';
|
|
8
|
+
|
|
9
|
+
declare abstract class Serializable {
|
|
10
|
+
abstract serialize(serializer: Serializer): void;
|
|
11
|
+
/**
|
|
12
|
+
* Serializes a `Serializable` value to its BCS representation.
|
|
13
|
+
* This function is the Typescript SDK equivalent of `bcs::to_bytes` in Move.
|
|
14
|
+
* @returns the BCS representation of the Serializable instance as a byte buffer
|
|
15
|
+
*/
|
|
16
|
+
bcsToBytes(): Uint8Array;
|
|
17
|
+
/**
|
|
18
|
+
* Helper function to get a value's BCS-serialized bytes as a Hex instance.
|
|
19
|
+
* @returns a Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array
|
|
20
|
+
*/
|
|
21
|
+
bcsToHex(): Hex;
|
|
22
|
+
}
|
|
23
|
+
declare class Serializer {
|
|
24
|
+
private buffer;
|
|
25
|
+
private offset;
|
|
26
|
+
constructor(length?: number);
|
|
27
|
+
private ensureBufferWillHandleSize;
|
|
28
|
+
protected appendToBuffer(values: Uint8Array): void;
|
|
29
|
+
private serializeWithFunction;
|
|
30
|
+
/**
|
|
31
|
+
* Serializes a string. UTF8 string is supported.
|
|
32
|
+
*
|
|
33
|
+
* The number of bytes in the string content is serialized first, as a uleb128-encoded u32 integer.
|
|
34
|
+
* Then the string content is serialized as UTF8 encoded bytes.
|
|
35
|
+
*
|
|
36
|
+
* BCS layout for "string": string_length | string_content
|
|
37
|
+
* where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const serializer = new Serializer();
|
|
42
|
+
* serializer.serializeStr("1234abcd");
|
|
43
|
+
* assert(serializer.toUint8Array() === new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
serializeStr(value: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Serializes an array of bytes.
|
|
49
|
+
*
|
|
50
|
+
* BCS layout for "bytes": bytes_length | bytes
|
|
51
|
+
* where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.
|
|
52
|
+
*/
|
|
53
|
+
serializeBytes(value: Uint8Array): void;
|
|
54
|
+
/**
|
|
55
|
+
* Serializes an array of bytes with known length. Therefore, length doesn't need to be
|
|
56
|
+
* serialized to help deserialization.
|
|
57
|
+
*
|
|
58
|
+
* When deserializing, the number of bytes to deserialize needs to be passed in.
|
|
59
|
+
*/
|
|
60
|
+
serializeFixedBytes(value: Uint8Array): void;
|
|
61
|
+
/**
|
|
62
|
+
* Serializes a boolean value.
|
|
63
|
+
*
|
|
64
|
+
* BCS layout for "boolean": One byte. "0x01" for true and "0x00" for false.
|
|
65
|
+
*/
|
|
66
|
+
serializeBool(value: boolean): void;
|
|
67
|
+
/**
|
|
68
|
+
* Serializes a uint8 number.
|
|
69
|
+
*
|
|
70
|
+
* BCS layout for "uint8": One byte. Binary format in little-endian representation.
|
|
71
|
+
*/
|
|
72
|
+
serializeU8(value: Uint8): void;
|
|
73
|
+
/**
|
|
74
|
+
* Serializes a uint16 number.
|
|
75
|
+
*
|
|
76
|
+
* BCS layout for "uint16": Two bytes. Binary format in little-endian representation.
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const serializer = new Serializer();
|
|
80
|
+
* serializer.serializeU16(4660);
|
|
81
|
+
* assert(serializer.toUint8Array() === new Uint8Array([0x34, 0x12]));
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
serializeU16(value: Uint16): void;
|
|
85
|
+
/**
|
|
86
|
+
* Serializes a uint32 number.
|
|
87
|
+
*
|
|
88
|
+
* BCS layout for "uint32": Four bytes. Binary format in little-endian representation.
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const serializer = new Serializer();
|
|
92
|
+
* serializer.serializeU32(305419896);
|
|
93
|
+
* assert(serializer.toUint8Array() === new Uint8Array([0x78, 0x56, 0x34, 0x12]));
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
serializeU32(value: Uint32): void;
|
|
97
|
+
/**
|
|
98
|
+
* Serializes a uint64 number.
|
|
99
|
+
*
|
|
100
|
+
* BCS layout for "uint64": Eight bytes. Binary format in little-endian representation.
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* const serializer = new Serializer();
|
|
104
|
+
* serializer.serializeU64(1311768467750121216);
|
|
105
|
+
* assert(serializer.toUint8Array() === new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
serializeU64(value: AnyNumber): void;
|
|
109
|
+
/**
|
|
110
|
+
* Serializes a uint128 number.
|
|
111
|
+
*
|
|
112
|
+
* BCS layout for "uint128": Sixteen bytes. Binary format in little-endian representation.
|
|
113
|
+
*/
|
|
114
|
+
serializeU128(value: AnyNumber): void;
|
|
115
|
+
/**
|
|
116
|
+
* Serializes a uint256 number.
|
|
117
|
+
*
|
|
118
|
+
* BCS layout for "uint256": Sixteen bytes. Binary format in little-endian representation.
|
|
119
|
+
*/
|
|
120
|
+
serializeU256(value: AnyNumber): void;
|
|
121
|
+
/**
|
|
122
|
+
* Serializes a uint32 number with uleb128.
|
|
123
|
+
*
|
|
124
|
+
* BCS uses uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values
|
|
125
|
+
*/
|
|
126
|
+
serializeU32AsUleb128(val: Uint32): void;
|
|
127
|
+
/**
|
|
128
|
+
* Returns the buffered bytes
|
|
129
|
+
*/
|
|
130
|
+
toUint8Array(): Uint8Array;
|
|
131
|
+
/**
|
|
132
|
+
* Serializes a `Serializable` value, facilitating composable serialization.
|
|
133
|
+
*
|
|
134
|
+
* @param value The Serializable value to serialize
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* // Define the MoveStruct class that implements the Serializable interface
|
|
138
|
+
* class MoveStruct extends Serializable {
|
|
139
|
+
* constructor(
|
|
140
|
+
* public creatorAddress: AccountAddress, // where AccountAddress extends Serializable
|
|
141
|
+
* public collectionName: string,
|
|
142
|
+
* public tokenName: string
|
|
143
|
+
* ) {}
|
|
144
|
+
*
|
|
145
|
+
* serialize(serializer: Serializer): void {
|
|
146
|
+
* serializer.serialize(this.creatorAddress); // Composable serialization of another Serializable object
|
|
147
|
+
* serializer.serializeStr(this.collectionName);
|
|
148
|
+
* serializer.serializeStr(this.tokenName);
|
|
149
|
+
* }
|
|
150
|
+
* }
|
|
151
|
+
*
|
|
152
|
+
* // Construct a MoveStruct
|
|
153
|
+
* const moveStruct = new MoveStruct(new AccountAddress(...), "MyCollection", "TokenA");
|
|
154
|
+
*
|
|
155
|
+
* // Serialize a string, a u64 number, and a MoveStruct instance.
|
|
156
|
+
* const serializer = new Serializer();
|
|
157
|
+
* serializer.serializeStr("ExampleString");
|
|
158
|
+
* serializer.serializeU64(12345678);
|
|
159
|
+
* serializer.serialize(moveStruct);
|
|
160
|
+
*
|
|
161
|
+
* // Get the bytes from the Serializer instance
|
|
162
|
+
* const serializedBytes = serializer.toUint8Array();
|
|
163
|
+
*
|
|
164
|
+
* @returns the serializer instance
|
|
165
|
+
*/
|
|
166
|
+
serialize<T extends Serializable>(value: T): void;
|
|
167
|
+
/**
|
|
168
|
+
* Serializes an array of BCS Serializable values to a serializer instance.
|
|
169
|
+
* Note that this does not return anything. The bytes are added to the serializer instance's byte buffer.
|
|
170
|
+
*
|
|
171
|
+
* @param values The array of BCS Serializable values
|
|
172
|
+
* @example
|
|
173
|
+
* const addresses = new Array<AccountAddress>(
|
|
174
|
+
* AccountAddress.fromRelaxed("0x1"),
|
|
175
|
+
* AccountAddress.fromRelaxed("0x2"),
|
|
176
|
+
* AccountAddress.fromRelaxed("0xa"),
|
|
177
|
+
* AccountAddress.fromRelaxed("0xb"),
|
|
178
|
+
* );
|
|
179
|
+
* const serializer = new Serializer();
|
|
180
|
+
* serializer.serializeVector(addresses);
|
|
181
|
+
* const serializedBytes = serializer.toUint8Array();
|
|
182
|
+
* // serializedBytes is now the BCS-serialized bytes
|
|
183
|
+
* // The equivalent value in Move would be:
|
|
184
|
+
* // `bcs::to_bytes(&vector<address> [@0x1, @0x2, @0xa, @0xb])`;
|
|
185
|
+
*/
|
|
186
|
+
serializeVector<T extends Serializable>(values: Array<T>): void;
|
|
187
|
+
}
|
|
188
|
+
declare function ensureBoolean(value: unknown): asserts value is boolean;
|
|
189
|
+
declare const outOfRangeErrorMessage: (value: AnyNumber, min: AnyNumber, max: AnyNumber) => string;
|
|
190
|
+
declare function validateNumberInRange<T extends AnyNumber>(value: T, minValue: T, maxValue: T): void;
|
|
191
|
+
|
|
192
|
+
export { Serializable, Serializer, ensureBoolean, outOfRangeErrorMessage, validateNumberInRange };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"../chunk-HA6JD5R6.mjs";import"../chunk-DNDWTM7A.mjs";import"../chunk-TIH6ARYP.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-ZWH2ESXT.mjs";export{a as Serializable,b as Serializer,c as ensureBoolean,d as outOfRangeErrorMessage,e as validateNumberInRange};
|
|
2
|
+
//# sourceMappingURL=serializer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as l}from"./chunk-U6SZNNVL.mjs";import{n as j}from"./chunk-VWVEDCBM.mjs";import{a as H,b as u,c as m,d as U,e as R,f as B,g as T,h as d,i as k,j as h,k as E,l as S,m as $,n as b,o as g,q as i,r as z}from"./chunk-BV4OOU5Y.mjs";import{c as G}from"./chunk-TQD4IGUM.mjs";import{a as o,b as C,c as y}from"./chunk-4ADA5BE7.mjs";import{a as v,b as x,c as I,d as M,e as O,f as V,g as _}from"./chunk-X32O46IB.mjs";import{b as A}from"./chunk-NZIJV4O2.mjs";import{b as F}from"./chunk-TIH6ARYP.mjs";function Y(r){return r?.map(n=>u(n)?l(n):n)??[]}async function Z(r,n,e,t){let s=(await G({aptosConfig:t,accountAddress:r,moduleName:n})).abi?.exposed_functions.find(c=>c.name===e);if(!s)throw new Error(`Could not find entry function ABI for '${r}::${n}::${e}'`);if(!s.is_entry)throw new Error(`'${r}::${n}::${e}' is not an entry function`);let L=z(s),p=[];for(let c=L;c<s.params.length;c+=1)p.push(l(s.params[c],{allowGenerics:!0}));return{typeParameters:s.generic_type_params,parameters:p}}function P(r,n,e,t,f){if(t>=n.parameters.length)throw new Error(`Too many arguments for '${r}', expected ${n.parameters.length}`);return B(e)||h(e)||E(e)||S(e)||$(e)||b(e)||g(e)||T(e)||d(e)||k(e)||e instanceof o||e instanceof y?(q(n,e,t),e):w(e,n.parameters[t],t,f)}function w(r,n,e,t){if(n.isBool()){if(H(r))return new v(r);i("boolean",e)}if(n.isAddress()){if(u(r))return A.fromStringRelaxed(r);i("string",e)}if(n.isU8()){if(m(r))return new x(r);i("number",e)}if(n.isU16()){if(m(r))return new I(r);i("number",e)}if(n.isU32()){if(m(r))return new M(r);i("number",e)}if(n.isU64()){if(U(r))return new O(BigInt(r));i("bigint | number | string",e)}if(n.isU128()){if(U(r))return new V(BigInt(r));i("bigint | number | string",e)}if(n.isU256()){if(U(r))return new _(BigInt(r));i("bigint | number | string",e)}if(n.isGeneric()){let f=n.value;if(f<0||f>=t.length)throw new Error(`Generic argument ${n.toString()} is invalid for argument ${e}`);w(r,t[f],e,t)}if(n.isVector()){if(n.value.isU8()&&u(r))return o.U8(F.fromHexInput(r).toUint8Array());if(Array.isArray(r))return new o(r.map(f=>w(f,n.value,e,t)));throw new Error(`Type mismatch for argument ${e}, type '${n.toString()}'`)}if(n.isStruct()){if(n.isString()){if(u(r))return new C(r);i("string",e)}if(n.isObject()){if(u(r))return A.fromStringRelaxed(r);i("string",e)}if(n.isOption())return R(r)?new y(null):new y(w(r,n.value.typeArgs[0],e,t));throw new Error(`Unsupported struct input type for argument ${e}, type '${n.toString()}'`)}throw new Error(`Type mismatch for argument ${e}, type '${n.toString()}'`)}function q(r,n,e){let t=r.parameters[e];if(t.isBool()){if(B(n))return;i("Bool",e)}if(t.isAddress()){if(T(n))return;i("AccountAddress",e)}if(t.isU8()){if(h(n))return;i("U8",e)}if(t.isU16()){if(E(n))return;i("U16",e)}if(t.isU32()){if(S(n))return;i("U32",e)}if(t.isU64()){if($(n))return;i("U64",e)}if(t.isU128()){if(b(n))return;i("U128",e)}if(t.isU256()){if(g(n))return;i("U256",e)}if(t.isVector()){if(n instanceof o)return;i("MoveVector",e)}if(t instanceof j){if(t.isString()){if(d(n))return;i("MoveString",e)}if(t.isObject()){if(T(n))return;i("AccountAddress",e)}if(t.isOption()){if(n instanceof y)return;i("MoveOption",e)}}throw new Error(`Type mismatch for argument ${e}, expected '${t.toString()}'`)}export{Y as a,Z as b,P as c};
|
|
2
|
+
//# sourceMappingURL=chunk-2W744GUN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/transactionBuilder/remoteAbi.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { parseTypeTag } from \"../typeTag/parser\";\nimport { TypeTag, TypeTagStruct } from \"../typeTag\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { EntryFunctionArgumentTypes, SimpleEntryFunctionArgumentTypes, EntryFunctionABI } from \"../types\";\nimport { Bool, MoveOption, MoveString, MoveVector, U128, U16, U256, U32, U64, U8 } from \"../../bcs\";\nimport { AccountAddress, Hex } from \"../../core\";\nimport { getModule } from \"../../internal/account\";\nimport {\n findFirstNonSignerArg,\n isBcsAddress,\n isBcsBool,\n isBcsFixedBytes,\n isBcsString,\n isBcsU128,\n isBcsU16,\n isBcsU256,\n isBcsU32,\n isBcsU64,\n isBcsU8,\n isBool,\n isLargeNumber,\n isNull,\n isNumber,\n isString,\n throwTypeMismatch,\n} from \"./helpers\";\n\n/**\n * Convert type arguments to only type tags, allowing for string representations of type tags\n */\nexport function standardizeTypeTags(typeArguments?: Array<TypeTag | string>): Array<TypeTag> {\n return (\n typeArguments?.map((typeArg: string | TypeTag): TypeTag => {\n // Convert to TypeTag if it's a string representation\n if (isString(typeArg)) {\n return parseTypeTag(typeArg);\n }\n return typeArg;\n }) ?? []\n );\n}\n\n/**\n * Fetches the ABI for an entry function from the module\n *\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchEntryFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<EntryFunctionABI> {\n // This fetch from the API is currently cached\n const module = await getModule({ aptosConfig, accountAddress: moduleAddress, moduleName });\n\n const functionAbi = module.abi?.exposed_functions.find((func) => func.name === functionName);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find entry function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-entry functions also can't be used\n if (!functionAbi.is_entry) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an entry function`);\n }\n\n // Remove the signer arguments\n const first = findFirstNonSignerArg(functionAbi);\n const params: TypeTag[] = [];\n for (let i = first; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n };\n}\n\n/**\n * Converts a non-BCS encoded argument into BCS encoded, if necessary\n * @param functionName\n * @param functionAbi\n * @param arg\n * @param position\n */\nexport function convertArgument(\n functionName: string,\n functionAbi: EntryFunctionABI,\n arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // Ensure not too many arguments\n if (position >= functionAbi.parameters.length) {\n throw new Error(`Too many arguments for '${functionName}', expected ${functionAbi.parameters.length}`);\n }\n\n // If the argument is bcs encoded, we can just use it directly\n if (\n isBcsBool(arg) ||\n isBcsU8(arg) ||\n isBcsU16(arg) ||\n isBcsU32(arg) ||\n isBcsU64(arg) ||\n isBcsU128(arg) ||\n isBcsU256(arg) ||\n isBcsAddress(arg) ||\n isBcsString(arg) ||\n isBcsFixedBytes(arg) ||\n arg instanceof MoveVector ||\n arg instanceof MoveOption\n ) {\n // Ensure the type matches the ABI\n checkType(functionAbi, arg, position);\n return arg;\n }\n\n // If it is not BCS encoded, we will need to convert it with the ABI\n return parseArg(arg, functionAbi.parameters[position], position, genericTypeParams);\n}\n\n/**\n * Parses a non-BCS encoded argument into a BCS encoded argument recursively\n * @param arg\n * @param param\n * @param position\n * @param genericTypeParams\n */\nfunction parseArg(\n arg: SimpleEntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n): EntryFunctionArgumentTypes {\n if (param.isBool()) {\n if (isBool(arg)) {\n return new Bool(arg);\n }\n throwTypeMismatch(\"boolean\", position);\n }\n // TODO: support uint8array?\n if (param.isAddress()) {\n if (isString(arg)) {\n return AccountAddress.fromStringRelaxed(arg);\n }\n throwTypeMismatch(\"string\", position);\n }\n if (param.isU8()) {\n if (isNumber(arg)) {\n return new U8(arg);\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU16()) {\n if (isNumber(arg)) {\n return new U16(arg);\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU32()) {\n if (isNumber(arg)) {\n return new U32(arg);\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU64()) {\n if (isLargeNumber(arg)) {\n return new U64(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU128()) {\n if (isLargeNumber(arg)) {\n return new U128(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU256()) {\n if (isLargeNumber(arg)) {\n return new U256(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n\n // Generic needs to use the sub-type\n if (param.isGeneric()) {\n const genericIndex = param.value;\n if (genericIndex < 0 || genericIndex >= genericTypeParams.length) {\n throw new Error(`Generic argument ${param.toString()} is invalid for argument ${position}`);\n }\n\n parseArg(arg, genericTypeParams[genericIndex], position, genericTypeParams);\n }\n\n // We have to special case some vectors for Vector<u8>\n if (param.isVector()) {\n // Check special case for Vector<u8>\n if (param.value.isU8() && isString(arg)) {\n // TODO: Improve message when hex is invalid\n return MoveVector.U8(Hex.fromHexInput(arg).toUint8Array());\n }\n\n if (Array.isArray(arg)) {\n return new MoveVector(arg.map((item) => parseArg(item, param.value, position, genericTypeParams)));\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n }\n\n // Handle structs as they're more complex\n if (param.isStruct()) {\n if (param.isString()) {\n if (isString(arg)) {\n return new MoveString(arg);\n }\n throwTypeMismatch(\"string\", position);\n }\n if (param.isObject()) {\n // The inner type of Object doesn't matter, since it's just syntactic sugar\n if (isString(arg)) {\n return AccountAddress.fromStringRelaxed(arg);\n }\n throwTypeMismatch(\"string\", position);\n }\n\n if (param.isOption()) {\n // Empty option must be handled specially\n if (isNull(arg)) {\n // Note: This is a placeholder U8 type, and does not match the actual type, as that can't be dynamically grabbed\n return new MoveOption<U8>(null);\n }\n\n return new MoveOption(parseArg(arg, param.value.typeArgs[0], position, genericTypeParams));\n }\n\n throw new Error(`Unsupported struct input type for argument ${position}, type '${param.toString()}'`);\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n}\n\n/**\n * Checks that the type of an already BCS encoded argument matches the ABI\n * @param functionAbi\n * @param arg\n * @param position\n */\nfunction checkType(functionAbi: EntryFunctionABI, arg: EntryFunctionArgumentTypes, position: number) {\n const param = functionAbi.parameters[position];\n if (param.isBool()) {\n if (isBcsBool(arg)) {\n return;\n }\n throwTypeMismatch(\"Bool\", position);\n }\n if (param.isAddress()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isU8()) {\n if (isBcsU8(arg)) {\n return;\n }\n throwTypeMismatch(\"U8\", position);\n }\n if (param.isU16()) {\n if (isBcsU16(arg)) {\n return;\n }\n throwTypeMismatch(\"U16\", position);\n }\n if (param.isU32()) {\n if (isBcsU32(arg)) {\n return;\n }\n throwTypeMismatch(\"U32\", position);\n }\n if (param.isU64()) {\n if (isBcsU64(arg)) {\n return;\n }\n throwTypeMismatch(\"U64\", position);\n }\n if (param.isU128()) {\n if (isBcsU128(arg)) {\n return;\n }\n throwTypeMismatch(\"U128\", position);\n }\n if (param.isU256()) {\n if (isBcsU256(arg)) {\n return;\n }\n throwTypeMismatch(\"U256\", position);\n }\n if (param.isVector()) {\n if (arg instanceof MoveVector) {\n // TODO: More introspection to verify the type\n return;\n }\n throwTypeMismatch(\"MoveVector\", position);\n }\n\n // Handle structs as they're more complex\n if (param instanceof TypeTagStruct) {\n if (param.isString()) {\n if (isBcsString(arg)) {\n return;\n }\n throwTypeMismatch(\"MoveString\", position);\n }\n if (param.isObject()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isOption()) {\n if (arg instanceof MoveOption) {\n // TODO: more introspection for the type\n return;\n }\n throwTypeMismatch(\"MoveOption\", position);\n }\n }\n\n throw new Error(`Type mismatch for argument ${position}, expected '${param.toString()}'`);\n}\n"],"mappings":"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","names":["standardizeTypeTags","typeArguments","typeArg","isString","parseTypeTag","fetchEntryFunctionAbi","moduleAddress","moduleName","functionName","aptosConfig","functionAbi","getModule","func","first","findFirstNonSignerArg","params","i","convertArgument","arg","position","genericTypeParams","isBcsBool","isBcsU8","isBcsU16","isBcsU32","isBcsU64","isBcsU128","isBcsU256","isBcsAddress","isBcsString","isBcsFixedBytes","MoveVector","MoveOption","checkType","parseArg","param","isBool","Bool","throwTypeMismatch","AccountAddress","isNumber","U8","U16","U32","isLargeNumber","U64","U128","U256","genericIndex","Hex","item","MoveString","isNull","TypeTagStruct"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/helpers.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Sleep the current thread for the given amount of time\n * @param timeMs time in milliseconds to sleep\n */\nexport async function sleep(timeMs: number): Promise<null> {\n return new Promise((resolve) => {\n setTimeout(resolve, timeMs);\n });\n}\n"],"mappings":"AAOA,eAAsBA,EAAMC,EAA+B,CACzD,OAAO,IAAI,QAASC,GAAY,CAC9B,WAAWA,EAASD,CAAM,CAC5B,CAAC,CACH","names":["sleep","timeMs","resolve"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as r}from"./chunk-EGOYLZBU.mjs";async function d(e){let{aptosConfig:t,overrides:s,params:n,contentType:o,acceptType:p,path:i,originMethod:a,type:u}=e,R=t.getRequestUrl(u);return r({url:R,method:"GET",originMethod:a,path:i,contentType:o?.valueOf(),acceptType:p?.valueOf(),params:n,overrides:{...t.clientConfig,...s}},t)}async function m(e){return d({...e,type:0})}async function f(e){let t=[],s,n=e.params;for(;;){n.start=s;let o=await m({aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:n,overrides:e.overrides});if(s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),s==null)break}return t}export{d as a,m as b,f as c};
|
|
2
|
+
//# sourceMappingURL=chunk-3JVGSFHP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/client/get.ts"],"sourcesContent":["import { AptosConfig } from \"../api/aptosConfig\";\nimport { aptosRequest } from \"./core\";\nimport { AptosResponse } from \"./types\";\nimport { AnyNumber, ClientConfig, MimeType } from \"../types\";\nimport { AptosApiType } from \"../utils/const\";\n\nexport type GetRequestOptions = {\n /**\n * The config for the API client\n */\n aptosConfig: AptosConfig;\n /**\n * The type of API endpoint to call e.g. fullnode, indexer, etc\n */\n type: AptosApiType;\n /**\n * The name of the API method\n */\n originMethod: string;\n /**\n * The URL path to the API method\n */\n path: string;\n /**\n * The content type of the request body\n */\n contentType?: MimeType;\n /**\n * The accepted content type of the response of the API\n */\n acceptType?: MimeType;\n /**\n * The query parameters for the request\n */\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n /**\n * Specific client overrides for this request to override aptosConfig\n */\n overrides?: ClientConfig;\n};\n\nexport type GetAptosRequestOptions = Omit<GetRequestOptions, \"type\">;\n\n/**\n * Main function to do a Get request\n *\n * @param options GetRequestOptions\n * @returns\n */\nexport async function get<Req extends {}, Res extends {}>(\n options: GetRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n const { aptosConfig, overrides, params, contentType, acceptType, path, originMethod, type } = options;\n const url = aptosConfig.getRequestUrl(type);\n\n return aptosRequest<Req, Res>(\n {\n url,\n method: \"GET\",\n originMethod,\n path,\n contentType: contentType?.valueOf(),\n acceptType: acceptType?.valueOf(),\n params,\n overrides: {\n ...aptosConfig.clientConfig,\n ...overrides,\n },\n },\n aptosConfig,\n );\n}\n\nexport async function getAptosFullNode<Req extends {}, Res extends {}>(\n options: GetAptosRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n return get<Req, Res>({ ...options, type: AptosApiType.FULLNODE });\n}\n\n/// This function is a helper for paginating using a function wrapping an API\nexport async function paginateWithCursor<Req extends Record<string, any>, Res extends any[]>(\n options: GetAptosRequestOptions,\n): Promise<Res> {\n const out = [];\n let cursor: string | undefined;\n const requestParams = options.params as Req & { start?: string; limit?: number };\n // eslint-disable-next-line no-constant-condition\n while (true) {\n requestParams.start = cursor;\n // eslint-disable-next-line no-await-in-loop\n const response = await getAptosFullNode<Req, Res>({\n aptosConfig: options.aptosConfig,\n originMethod: options.originMethod,\n path: options.path,\n params: requestParams,\n overrides: options.overrides,\n });\n /**\n * the cursor is a \"state key\" from the API perspective. Client\n * should not need to \"care\" what it represents but just use it\n * to query the next chunk of data.\n */\n cursor = response.headers[\"x-aptos-cursor\"];\n // Now that we have the cursor (if any), we remove the headers before\n // adding these to the output of this function.\n delete (response as any).headers;\n out.push(...response.data);\n if (cursor === null || cursor === undefined) {\n break;\n }\n }\n return out as any;\n}\n"],"mappings":"yCAiDA,eAAsBA,EACpBC,EACkC,CAClC,GAAM,CAAE,YAAAC,EAAa,UAAAC,EAAW,OAAAC,EAAQ,YAAAC,EAAa,WAAAC,EAAY,KAAAC,EAAM,aAAAC,EAAc,KAAAC,CAAK,EAAIR,EACxFS,EAAMR,EAAY,cAAcO,CAAI,EAE1C,OAAOE,EACL,CACE,IAAAD,EACA,OAAQ,MACR,aAAAF,EACA,KAAAD,EACA,YAAaF,GAAa,QAAQ,EAClC,WAAYC,GAAY,QAAQ,EAChC,OAAAF,EACA,UAAW,CACT,GAAGF,EAAY,aACf,GAAGC,CACL,CACF,EACAD,CACF,CACF,CAEA,eAAsBU,EACpBX,EACkC,CAClC,OAAOD,EAAc,CAAE,GAAGC,EAAS,MAA4B,CAAC,CAClE,CAGA,eAAsBY,EACpBZ,EACc,CACd,IAAMa,EAAM,CAAC,EACTC,EACEC,EAAgBf,EAAQ,OAE9B,OAAa,CACXe,EAAc,MAAQD,EAEtB,IAAME,EAAW,MAAML,EAA2B,CAChD,YAAaX,EAAQ,YACrB,aAAcA,EAAQ,aACtB,KAAMA,EAAQ,KACd,OAAQe,EACR,UAAWf,EAAQ,SACrB,CAAC,EAWD,GALAc,EAASE,EAAS,QAAQ,gBAAgB,EAG1C,OAAQA,EAAiB,QACzBH,EAAI,KAAK,GAAGG,EAAS,IAAI,EACrBF,GAAW,KACb,KAEJ,CACA,OAAOD,CACT","names":["get","options","aptosConfig","overrides","params","contentType","acceptType","path","originMethod","type","url","aptosRequest","getAptosFullNode","paginateWithCursor","out","cursor","requestParams","response"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o}from"./chunk-YYRDFZE6.mjs";import{a as y}from"./chunk-EFIYW4WK.mjs";import{b as l}from"./chunk-TIH6ARYP.mjs";var p=class h extends y{constructor(e){super();let{publicKeys:t,signaturesRequired:r}=e;if(r<1)throw new Error("The number of required signatures needs to be greater then 0");if(t.length<r)throw new Error(`Provided ${t.length} public keys is smaller than the ${r} required signatures`);let i=[];t.forEach(s=>{s instanceof o?i.push(s):i.push(new o(s))}),this.publicKeys=i,this.signaturesRequired=r}toUint8Array(){return this.bcsToBytes()}createBitmap(e){let{bits:t}=e,r=128,i=new Uint8Array([0,0,0,0]),s=new Set;return t.forEach((n,u)=>{if(u+1>this.publicKeys.length)throw new Error(`Signature index ${u+1} is out of public keys range, ${this.publicKeys.length}.`);if(s.has(n))throw new Error(`Duplicate bit ${n} detected.`);s.add(n);let a=Math.floor(n/8),c=i[a];c|=r>>n%8,i[a]=c}),i}toString(){return l.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("not implemented")}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let t=e.deserializeVector(o),r=e.deserializeU8();return new h({publicKeys:t,signaturesRequired:r})}};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-44MGBJ73.mjs.map
|