@aptos-labs/ts-sdk 0.0.5 → 0.0.7
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 +12 -7
- package/dist/browser/index.d.ts +874 -596
- package/dist/browser/index.global.js +75 -30
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +874 -596
- package/dist/common/index.js +45 -24
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/{account.d.ts → account.d.mts} +17 -17
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +273 -0
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +80 -0
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/{aptosConfig.d.ts → aptosConfig.d.mts} +6 -6
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +59 -0
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/{digitalAsset.d.ts → digitalAsset.d.mts} +35 -35
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/{event.d.ts → event.d.mts} +14 -14
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/{faucet.d.ts → faucet.d.mts} +13 -13
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/{fungibleAsset.d.ts → fungibleAsset.d.mts} +7 -7
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/{general.d.ts → general.d.mts} +11 -11
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +50 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/{staking.d.ts → staking.d.mts} +13 -13
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/{transaction.d.ts → transaction.d.mts} +7 -7
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +53 -0
- package/dist/esm/api/transactionSubmission/build.mjs +2 -0
- package/dist/esm/api/transactionSubmission/sign.d.mts +50 -0
- package/dist/esm/api/transactionSubmission/sign.mjs +2 -0
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/simulate.d.mts +53 -0
- package/dist/esm/api/transactionSubmission/simulate.mjs +2 -0
- package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/submit.d.mts +51 -0
- package/dist/esm/api/transactionSubmission/submit.mjs +2 -0
- package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission.d.mts +91 -0
- package/dist/esm/api/transactionSubmission.mjs +1 -1
- package/dist/esm/bcs/{consts.d.ts → consts.d.mts} +5 -5
- package/dist/esm/bcs/consts.mjs +1 -1
- package/dist/esm/bcs/{deserializer.d.ts → deserializer.d.mts} +5 -5
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.d.mts +14 -0
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/{entryFunctionBytes.d.ts → entryFunctionBytes.d.mts} +11 -11
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/{fixedBytes.d.ts → fixedBytes.d.mts} +10 -10
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/{movePrimitives.d.ts → movePrimitives.d.mts} +10 -10
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/{moveStructs.d.ts → moveStructs.d.mts} +11 -11
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/{serializer.d.ts → serializer.d.mts} +7 -7
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-2B5QXKPU.mjs → chunk-2OZRBXLM.mjs} +2 -2
- package/dist/esm/chunk-2OZRBXLM.mjs.map +1 -0
- package/dist/esm/{chunk-O243HOP3.mjs → chunk-33T7WTB6.mjs} +2 -2
- package/dist/esm/chunk-33T7WTB6.mjs.map +1 -0
- package/dist/esm/chunk-3732I6BR.mjs +2 -0
- package/dist/esm/chunk-3732I6BR.mjs.map +1 -0
- package/dist/esm/chunk-3VZ3OZKC.mjs +2 -0
- package/dist/esm/chunk-3VZ3OZKC.mjs.map +1 -0
- package/dist/esm/chunk-44MGBJ73.mjs +2 -0
- package/dist/esm/{chunk-CZZJAR3B.mjs.map → chunk-44MGBJ73.mjs.map} +1 -1
- package/dist/esm/chunk-4ADA5BE7.mjs +2 -0
- package/dist/esm/{chunk-7AQXAH6Q.mjs.map → chunk-4ADA5BE7.mjs.map} +1 -1
- package/dist/esm/chunk-4KTQIWUP.mjs +2 -0
- package/dist/esm/chunk-4KTQIWUP.mjs.map +1 -0
- package/dist/esm/chunk-5LO7FR2P.mjs +2 -0
- package/dist/esm/chunk-5LO7FR2P.mjs.map +1 -0
- package/dist/esm/chunk-62SCW5NH.mjs +2 -0
- package/dist/esm/{chunk-YS2OX7AB.mjs.map → chunk-62SCW5NH.mjs.map} +1 -1
- package/dist/esm/{chunk-DNYVUM3K.mjs → chunk-67OGU66P.mjs} +2 -2
- package/dist/esm/{chunk-DNYVUM3K.mjs.map → chunk-67OGU66P.mjs.map} +1 -1
- package/dist/esm/{chunk-XFSL7O6Q.mjs → chunk-72F5YXGC.mjs} +2 -2
- package/dist/esm/chunk-72F5YXGC.mjs.map +1 -0
- package/dist/esm/{chunk-N6XWY4UT.mjs → chunk-ARVSIDVB.mjs} +1 -1
- package/dist/esm/{chunk-N6XWY4UT.mjs.map → chunk-ARVSIDVB.mjs.map} +1 -1
- package/dist/esm/{chunk-WVMDCC4V.mjs → chunk-BFQRMCY2.mjs} +2 -2
- package/dist/esm/{chunk-WVMDCC4V.mjs.map → chunk-BFQRMCY2.mjs.map} +1 -1
- package/dist/esm/{chunk-XFS5O5GJ.mjs → chunk-BM4HBROC.mjs} +2 -2
- package/dist/esm/{chunk-XFS5O5GJ.mjs.map → chunk-BM4HBROC.mjs.map} +1 -1
- package/dist/esm/chunk-BPYLPPEQ.mjs +2 -0
- package/dist/esm/{chunk-V6AAQLLJ.mjs.map → chunk-BPYLPPEQ.mjs.map} +1 -1
- package/dist/esm/{chunk-3OJN4I42.mjs → chunk-BV4OOU5Y.mjs} +2 -2
- package/dist/esm/{chunk-3OJN4I42.mjs.map → chunk-BV4OOU5Y.mjs.map} +1 -1
- package/dist/esm/chunk-CYDWEPFL.mjs +1 -0
- package/dist/esm/chunk-CYDWEPFL.mjs.map +1 -0
- package/dist/esm/chunk-DRPMIJH7.mjs +2 -0
- package/dist/esm/chunk-DRPMIJH7.mjs.map +1 -0
- package/dist/esm/chunk-EFIYW4WK.mjs +2 -0
- package/dist/esm/chunk-EWTHPMEE.mjs +2 -0
- package/dist/esm/{chunk-LAXIJRYU.mjs.map → chunk-EWTHPMEE.mjs.map} +1 -1
- package/dist/esm/chunk-GAI75GOG.mjs +2 -0
- package/dist/esm/{chunk-J3QOSJFP.mjs.map → chunk-GAI75GOG.mjs.map} +1 -1
- package/dist/esm/{chunk-BC2NOUYT.mjs → chunk-GTC7WHMV.mjs} +2 -2
- package/dist/esm/{chunk-BC2NOUYT.mjs.map → chunk-GTC7WHMV.mjs.map} +1 -1
- package/dist/esm/{chunk-MIBLZSNS.mjs → chunk-GU4OUKAF.mjs} +2 -2
- package/dist/esm/chunk-GU4OUKAF.mjs.map +1 -0
- package/dist/esm/{chunk-27P7PELS.mjs → chunk-HA6JD5R6.mjs} +2 -2
- package/dist/esm/{chunk-27P7PELS.mjs.map → chunk-HA6JD5R6.mjs.map} +1 -1
- package/dist/esm/chunk-HO7K2UAK.mjs +2 -0
- package/dist/esm/{chunk-ADR4XQPR.mjs.map → chunk-HO7K2UAK.mjs.map} +1 -1
- package/dist/esm/chunk-HVADSXTB.mjs +2 -0
- package/dist/esm/{chunk-LU6VS7PJ.mjs.map → chunk-HVADSXTB.mjs.map} +1 -1
- package/dist/esm/chunk-IBH7IOIM.mjs +2 -0
- package/dist/esm/{chunk-ZXJ5ZBTL.mjs.map → chunk-IBH7IOIM.mjs.map} +1 -1
- package/dist/esm/chunk-J5BH7V37.mjs +2 -0
- package/dist/esm/chunk-J5BH7V37.mjs.map +1 -0
- package/dist/esm/chunk-JZNLZMUC.mjs +2 -0
- package/dist/esm/{chunk-WGXAIQ7K.mjs.map → chunk-JZNLZMUC.mjs.map} +1 -1
- package/dist/esm/chunk-KQXRH5FK.mjs +2 -0
- package/dist/esm/{chunk-UQIOMAXE.mjs.map → chunk-KQXRH5FK.mjs.map} +1 -1
- package/dist/esm/chunk-L7AA75WZ.mjs +2 -0
- package/dist/esm/chunk-L7AA75WZ.mjs.map +1 -0
- package/dist/esm/chunk-LACQ537H.mjs +2 -0
- package/dist/esm/{chunk-KFP7MDSD.mjs.map → chunk-LACQ537H.mjs.map} +1 -1
- package/dist/esm/{chunk-2MQZUGO6.mjs → chunk-LDAD54H5.mjs} +1 -1
- package/dist/esm/chunk-LDAD54H5.mjs.map +1 -0
- package/dist/esm/chunk-LXW3A3MJ.mjs +2 -0
- package/dist/esm/chunk-LXW3A3MJ.mjs.map +1 -0
- package/dist/esm/{chunk-KYWYIK5P.mjs → chunk-M2V2POWK.mjs} +2 -2
- package/dist/esm/chunk-M2V2POWK.mjs.map +1 -0
- package/dist/esm/chunk-ND3ZQKTT.mjs +2 -0
- package/dist/esm/chunk-ND3ZQKTT.mjs.map +1 -0
- package/dist/esm/chunk-NZIJV4O2.mjs +2 -0
- package/dist/esm/{chunk-HH5RSP2H.mjs.map → chunk-NZIJV4O2.mjs.map} +1 -1
- package/dist/esm/chunk-O2B54NZT.mjs +2 -0
- package/dist/esm/chunk-O2B54NZT.mjs.map +1 -0
- package/dist/esm/chunk-OCW2L33Q.mjs +2 -0
- package/dist/esm/chunk-OCW2L33Q.mjs.map +1 -0
- package/dist/esm/{chunk-PJDVHU7X.mjs → chunk-OCYS4V2V.mjs} +2 -2
- package/dist/esm/{chunk-PJDVHU7X.mjs.map → chunk-OCYS4V2V.mjs.map} +1 -1
- package/dist/esm/{chunk-VAGYTPSI.mjs → chunk-OSTH5JRX.mjs} +2 -2
- package/dist/esm/chunk-OSTH5JRX.mjs.map +1 -0
- package/dist/esm/chunk-OVHY6ZUJ.mjs +2 -0
- package/dist/esm/{chunk-JTGGMXB7.mjs.map → chunk-OVHY6ZUJ.mjs.map} +1 -1
- package/dist/esm/chunk-PZCMSHY6.mjs +2 -0
- package/dist/esm/chunk-QWVR4RCV.mjs +2 -0
- package/dist/esm/{chunk-IPJKGHQY.mjs.map → chunk-QWVR4RCV.mjs.map} +1 -1
- package/dist/esm/chunk-R3KWVOFG.mjs +2 -0
- package/dist/esm/{chunk-KWJ6XKNF.mjs.map → chunk-R3KWVOFG.mjs.map} +1 -1
- package/dist/esm/{chunk-TXUMB5ZO.mjs → chunk-RHS5ROLP.mjs} +2 -2
- package/dist/esm/chunk-RHS5ROLP.mjs.map +1 -0
- package/dist/esm/{chunk-IXMH6AXJ.mjs → chunk-RKKU2SY5.mjs} +2 -2
- package/dist/esm/chunk-RYETO74W.mjs +2 -0
- package/dist/esm/{chunk-BIUGRAMO.mjs.map → chunk-RYETO74W.mjs.map} +1 -1
- package/dist/esm/chunk-S36IYY6K.mjs +2 -0
- package/dist/esm/{chunk-DXUIJ6KA.mjs.map → chunk-S36IYY6K.mjs.map} +1 -1
- package/dist/esm/chunk-TGKB6ALT.mjs +2 -0
- package/dist/esm/chunk-TGKB6ALT.mjs.map +1 -0
- package/dist/esm/chunk-TIH6ARYP.mjs +2 -0
- package/dist/esm/{chunk-IZHPCZE3.mjs.map → chunk-TIH6ARYP.mjs.map} +1 -1
- package/dist/esm/chunk-TPWSHFFI.mjs +2 -0
- package/dist/esm/chunk-TPWSHFFI.mjs.map +1 -0
- package/dist/esm/chunk-U25N2VWA.mjs +2 -0
- package/dist/esm/{chunk-FNB6CFQR.mjs.map → chunk-U25N2VWA.mjs.map} +1 -1
- package/dist/esm/chunk-U6SZNNVL.mjs +2 -0
- package/dist/esm/chunk-U6SZNNVL.mjs.map +1 -0
- package/dist/esm/{chunk-EKAOAGNQ.mjs → chunk-UAAI3NCA.mjs} +2 -2
- package/dist/esm/{chunk-BTK34A5U.mjs → chunk-UDBH4CER.mjs} +42 -21
- package/dist/esm/chunk-UDBH4CER.mjs.map +1 -0
- package/dist/esm/chunk-VWVEDCBM.mjs +2 -0
- package/dist/esm/{chunk-BREUBEPM.mjs.map → chunk-VWVEDCBM.mjs.map} +1 -1
- package/dist/esm/{chunk-ZT2A5ABR.mjs → chunk-WEJAI26R.mjs} +2 -2
- package/dist/esm/{chunk-ZT2A5ABR.mjs.map → chunk-WEJAI26R.mjs.map} +1 -1
- package/dist/esm/chunk-WL4OXZLN.mjs +2 -0
- package/dist/esm/{chunk-KNLMUSIO.mjs.map → chunk-WL4OXZLN.mjs.map} +1 -1
- package/dist/esm/chunk-X32O46IB.mjs +2 -0
- package/dist/esm/{chunk-PDLUCVJB.mjs.map → chunk-X32O46IB.mjs.map} +1 -1
- package/dist/esm/{chunk-KPESAXVI.mjs → chunk-Y2HRRUZ6.mjs} +2 -2
- package/dist/esm/{chunk-GUT3G5CG.mjs → chunk-Y7VR7X5W.mjs} +2 -2
- package/dist/esm/chunk-Y7VR7X5W.mjs.map +1 -0
- package/dist/esm/chunk-YYRDFZE6.mjs +2 -0
- package/dist/esm/{chunk-UVGCVCNG.mjs.map → chunk-YYRDFZE6.mjs.map} +1 -1
- package/dist/esm/{chunk-TYHBYRUA.mjs → chunk-ZLW65YCO.mjs} +2 -2
- package/dist/esm/chunk-ZLW65YCO.mjs.map +1 -0
- package/dist/esm/chunk-ZUHN56GM.mjs +2 -0
- package/dist/esm/chunk-ZUHN56GM.mjs.map +1 -0
- package/dist/esm/{chunk-XNFEUXDS.mjs → chunk-ZWH2ESXT.mjs} +1 -1
- package/dist/esm/chunk-ZWH2ESXT.mjs.map +1 -0
- package/dist/esm/client/{core.d.ts → core.d.mts} +9 -9
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/{get.d.ts → get.d.mts} +12 -12
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +11 -0
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/{post.d.ts → post.d.mts} +14 -14
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/client/{types.d.ts → types.d.mts} +5 -5
- package/dist/esm/client/types.mjs +1 -1
- package/dist/esm/core/{account.d.ts → account.d.mts} +13 -13
- package/dist/esm/core/account.mjs +1 -1
- package/dist/esm/core/{accountAddress.d.ts → accountAddress.d.mts} +11 -11
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/{authenticationKey.d.ts → authenticationKey.d.mts} +12 -12
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/{common.d.ts → common.d.mts} +1 -1
- package/dist/esm/core/common.mjs +1 -1
- package/dist/esm/core/crypto/{anyPublicKey.d.ts → anyPublicKey.d.mts} +11 -11
- package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
- package/dist/esm/core/crypto/{anySignature.d.ts → anySignature.d.mts} +10 -10
- package/dist/esm/core/crypto/anySignature.mjs +1 -1
- package/dist/esm/core/crypto/{asymmetricCrypto.d.ts → asymmetricCrypto.d.mts} +8 -8
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
- package/dist/esm/core/crypto/{ed25519.d.ts → ed25519.d.mts} +10 -10
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/{hdKey.d.ts → hdKey.d.mts} +1 -1
- package/dist/esm/core/crypto/hdKey.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +17 -0
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/{multiEd25519.d.ts → multiEd25519.d.mts} +11 -11
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/{multiKey.d.ts → multiKey.d.mts} +12 -12
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/{secp256k1.d.ts → secp256k1.d.mts} +10 -10
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/{hex.d.ts → hex.d.mts} +6 -6
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +21 -0
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +64 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/{account.d.ts → account.d.mts} +17 -17
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +150 -0
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +43 -0
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/{digitalAsset.d.ts → digitalAsset.d.mts} +34 -34
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/{event.d.ts → event.d.mts} +14 -14
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +29 -0
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/{fungibleAsset.d.ts → fungibleAsset.d.mts} +7 -7
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/{general.d.ts → general.d.mts} +11 -11
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/{staking.d.ts → staking.d.mts} +13 -13
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/{transaction.d.ts → transaction.d.mts} +7 -7
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/{transactionSubmission.d.ts → transactionSubmission.d.mts} +41 -72
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/transactions/authenticator/{account.d.ts → account.d.mts} +15 -15
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +19 -0
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/{transaction.d.ts → transaction.d.mts} +18 -18
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +39 -0
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +21 -0
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/{identifier.d.ts → identifier.d.mts} +9 -9
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +29 -0
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/{moduleId.d.ts → moduleId.d.mts} +12 -12
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/{rawTransaction.d.ts → rawTransaction.d.mts} +16 -16
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/{rotationProofChallenge.d.ts → rotationProofChallenge.d.mts} +14 -14
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/{signedTransaction.d.ts → signedTransaction.d.mts} +25 -25
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/{transactionArgument.d.ts → transactionArgument.d.mts} +8 -8
- package/dist/esm/transactions/instances/{transactionPayload.d.ts → transactionPayload.d.mts} +14 -14
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/{helpers.d.ts → helpers.d.mts} +31 -31
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +35 -0
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +54 -0
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/{transactionBuilder.d.ts → transactionBuilder.d.mts} +35 -40
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/{index.d.ts → index.d.mts} +12 -12
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/{parser.d.ts → parser.d.mts} +14 -13
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/{types.d.ts → types.d.mts} +60 -97
- package/dist/esm/types/generated/{operations.d.ts → operations.d.mts} +105 -79
- package/dist/esm/types/generated/{queries.d.ts → queries.d.mts} +35 -32
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/{types.d.ts → types.d.mts} +3184 -3146
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/{index.d.ts → index.d.mts} +94 -92
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +63 -0
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- 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.mjs +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +30 -30
- package/src/api/account.ts +2 -2
- package/src/api/ans.ts +250 -11
- package/src/api/aptos.ts +20 -0
- package/src/api/coin.ts +4 -4
- package/src/api/digitalAsset.ts +3 -3
- package/src/api/event.ts +2 -2
- package/src/api/general.ts +4 -4
- package/src/api/transactionSubmission/build.ts +42 -0
- package/src/api/transactionSubmission/sign.ts +44 -0
- package/src/api/transactionSubmission/simulate.ts +56 -0
- package/src/api/transactionSubmission/submit.ts +53 -0
- package/src/api/transactionSubmission.ts +4 -138
- package/src/client/core.ts +1 -1
- package/src/client/get.ts +6 -2
- package/src/client/post.ts +12 -4
- package/src/index.ts +1 -1
- package/src/internal/account.ts +2 -2
- package/src/internal/ans.ts +408 -22
- package/src/internal/coin.ts +5 -5
- package/src/internal/digitalAsset.ts +5 -5
- package/src/internal/event.ts +2 -2
- package/src/internal/general.ts +7 -6
- package/src/internal/queries/ansTokenFragment.graphql +9 -0
- package/src/internal/queries/getNames.graphql +11 -0
- package/src/internal/transactionSubmission.ts +52 -12
- package/src/transactions/transactionBuilder/helpers.ts +2 -2
- package/src/transactions/transactionBuilder/transactionBuilder.ts +22 -46
- package/src/transactions/typeTag/parser.ts +10 -2
- package/src/transactions/types.ts +16 -56
- package/src/types/generated/operations.ts +62 -33
- package/src/types/generated/queries.ts +56 -22
- package/src/types/generated/types.ts +2253 -2251
- package/src/types/index.ts +16 -10
- package/src/types/indexer.ts +3 -0
- package/src/utils/index.ts +2 -0
- package/dist/esm/api/ans.d.ts +0 -79
- package/dist/esm/api/aptos.d.ts +0 -72
- package/dist/esm/api/coin.d.ts +0 -59
- package/dist/esm/api/index.d.ts +0 -46
- package/dist/esm/api/transactionSubmission.d.ts +0 -142
- package/dist/esm/bcs/index.d.ts +0 -14
- package/dist/esm/chunk-2444YR3Y.mjs +0 -2
- package/dist/esm/chunk-2444YR3Y.mjs.map +0 -1
- package/dist/esm/chunk-2B5QXKPU.mjs.map +0 -1
- package/dist/esm/chunk-2MQZUGO6.mjs.map +0 -1
- package/dist/esm/chunk-3YOV42H5.mjs +0 -2
- package/dist/esm/chunk-3YOV42H5.mjs.map +0 -1
- package/dist/esm/chunk-7AIV5FEN.mjs +0 -2
- package/dist/esm/chunk-7AIV5FEN.mjs.map +0 -1
- package/dist/esm/chunk-7AQXAH6Q.mjs +0 -2
- package/dist/esm/chunk-7TL2MY2B.mjs +0 -2
- package/dist/esm/chunk-7TL2MY2B.mjs.map +0 -1
- package/dist/esm/chunk-ADR4XQPR.mjs +0 -2
- package/dist/esm/chunk-AY2HWVDO.mjs +0 -2
- package/dist/esm/chunk-AY2HWVDO.mjs.map +0 -1
- package/dist/esm/chunk-BIUGRAMO.mjs +0 -2
- package/dist/esm/chunk-BREUBEPM.mjs +0 -2
- package/dist/esm/chunk-BTK34A5U.mjs.map +0 -1
- package/dist/esm/chunk-CZZJAR3B.mjs +0 -2
- package/dist/esm/chunk-DXUIJ6KA.mjs +0 -2
- package/dist/esm/chunk-E72CFUU4.mjs +0 -2
- package/dist/esm/chunk-FHJ7F7Z6.mjs +0 -2
- package/dist/esm/chunk-FHJ7F7Z6.mjs.map +0 -1
- package/dist/esm/chunk-FNB6CFQR.mjs +0 -2
- package/dist/esm/chunk-GUT3G5CG.mjs.map +0 -1
- package/dist/esm/chunk-HH5RSP2H.mjs +0 -2
- package/dist/esm/chunk-IPJKGHQY.mjs +0 -2
- package/dist/esm/chunk-IZHPCZE3.mjs +0 -2
- package/dist/esm/chunk-J3QOSJFP.mjs +0 -2
- package/dist/esm/chunk-J5OKXARS.mjs +0 -2
- package/dist/esm/chunk-J5OKXARS.mjs.map +0 -1
- package/dist/esm/chunk-JTGGMXB7.mjs +0 -2
- package/dist/esm/chunk-KFP7MDSD.mjs +0 -2
- package/dist/esm/chunk-KJDY66XF.mjs +0 -2
- package/dist/esm/chunk-KJDY66XF.mjs.map +0 -1
- package/dist/esm/chunk-KNLMUSIO.mjs +0 -2
- package/dist/esm/chunk-KWJ6XKNF.mjs +0 -2
- package/dist/esm/chunk-KYWYIK5P.mjs.map +0 -1
- package/dist/esm/chunk-LAXIJRYU.mjs +0 -2
- package/dist/esm/chunk-LU6VS7PJ.mjs +0 -2
- package/dist/esm/chunk-MIBLZSNS.mjs.map +0 -1
- package/dist/esm/chunk-NKTKHC3Z.mjs +0 -2
- package/dist/esm/chunk-NKTKHC3Z.mjs.map +0 -1
- package/dist/esm/chunk-O243HOP3.mjs.map +0 -1
- package/dist/esm/chunk-PDLUCVJB.mjs +0 -2
- package/dist/esm/chunk-SJLO3JIH.mjs +0 -2
- package/dist/esm/chunk-TXUMB5ZO.mjs.map +0 -1
- package/dist/esm/chunk-TYHBYRUA.mjs.map +0 -1
- package/dist/esm/chunk-UQIOMAXE.mjs +0 -2
- package/dist/esm/chunk-UVGCVCNG.mjs +0 -2
- package/dist/esm/chunk-V6AAQLLJ.mjs +0 -2
- package/dist/esm/chunk-VAGYTPSI.mjs.map +0 -1
- package/dist/esm/chunk-WGXAIQ7K.mjs +0 -2
- package/dist/esm/chunk-WNEZCERQ.mjs +0 -2
- package/dist/esm/chunk-WNEZCERQ.mjs.map +0 -1
- package/dist/esm/chunk-XFSL7O6Q.mjs.map +0 -1
- package/dist/esm/chunk-YS2OX7AB.mjs +0 -2
- package/dist/esm/chunk-Z56AKXJ7.mjs +0 -2
- package/dist/esm/chunk-Z56AKXJ7.mjs.map +0 -1
- package/dist/esm/chunk-ZXJ5ZBTL.mjs +0 -2
- package/dist/esm/client/index.d.ts +0 -11
- package/dist/esm/core/crypto/index.d.ts +0 -17
- package/dist/esm/core/index.d.ts +0 -21
- package/dist/esm/index.d.ts +0 -60
- package/dist/esm/internal/ans.d.ts +0 -83
- package/dist/esm/internal/coin.d.ts +0 -43
- package/dist/esm/internal/faucet.d.ts +0 -29
- package/dist/esm/transactions/authenticator/index.d.ts +0 -19
- package/dist/esm/transactions/index.d.ts +0 -39
- package/dist/esm/transactions/instances/chainId.d.ts +0 -21
- package/dist/esm/transactions/instances/index.d.ts +0 -29
- package/dist/esm/transactions/transactionBuilder/index.d.ts +0 -35
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.ts +0 -54
- package/dist/esm/types/indexer.d.ts +0 -62
- /package/dist/esm/{chunk-XNFEUXDS.mjs.map → api/transactionSubmission/build.mjs.map} +0 -0
- /package/dist/esm/{chunk-E72CFUU4.mjs.map → chunk-EFIYW4WK.mjs.map} +0 -0
- /package/dist/esm/{chunk-SJLO3JIH.mjs.map → chunk-PZCMSHY6.mjs.map} +0 -0
- /package/dist/esm/{chunk-IXMH6AXJ.mjs.map → chunk-RKKU2SY5.mjs.map} +0 -0
- /package/dist/esm/{chunk-EKAOAGNQ.mjs.map → chunk-UAAI3NCA.mjs.map} +0 -0
- /package/dist/esm/{chunk-KPESAXVI.mjs.map → chunk-Y2HRRUZ6.mjs.map} +0 -0
- /package/dist/esm/utils/{apiEndpoints.d.ts → apiEndpoints.d.mts} +0 -0
- /package/dist/esm/utils/{const.d.ts → const.d.mts} +0 -0
- /package/dist/esm/utils/{helpers.d.ts → helpers.d.mts} +0 -0
- /package/dist/esm/utils/{memoize.d.ts → memoize.d.mts} +0 -0
- /package/dist/esm/{version.d.ts → version.d.mts} +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { AptosConfig } from './aptosConfig.mjs';
|
|
2
|
+
import { Account } from '../core/account.mjs';
|
|
3
|
+
import { AccountAddressInput } from '../core/accountAddress.mjs';
|
|
4
|
+
import { PrivateKey } from '../core/crypto/asymmetricCrypto.mjs';
|
|
5
|
+
import { PendingTransactionResponse, HexInput, TransactionResponse } from '../types/index.mjs';
|
|
6
|
+
import { AnyRawTransaction, InputGenerateTransactionOptions, SingleSignerTransaction } from '../transactions/types.mjs';
|
|
7
|
+
import '../utils/apiEndpoints.mjs';
|
|
8
|
+
import '../utils/const.mjs';
|
|
9
|
+
import '../core/authenticationKey.mjs';
|
|
10
|
+
import '../core/hex.mjs';
|
|
11
|
+
import '../core/common.mjs';
|
|
12
|
+
import '../bcs/serializer.mjs';
|
|
13
|
+
import '../bcs/deserializer.mjs';
|
|
14
|
+
import '../transactions/instances/transactionArgument.mjs';
|
|
15
|
+
import '../types/indexer.mjs';
|
|
16
|
+
import '../types/generated/operations.mjs';
|
|
17
|
+
import '../types/generated/types.mjs';
|
|
18
|
+
import '../bcs/serializable/moveStructs.mjs';
|
|
19
|
+
import '../bcs/serializable/movePrimitives.mjs';
|
|
20
|
+
import '../bcs/serializable/fixedBytes.mjs';
|
|
21
|
+
import '../transactions/instances/rawTransaction.mjs';
|
|
22
|
+
import '../transactions/instances/chainId.mjs';
|
|
23
|
+
import '../transactions/instances/transactionPayload.mjs';
|
|
24
|
+
import '../transactions/instances/identifier.mjs';
|
|
25
|
+
import '../transactions/instances/moduleId.mjs';
|
|
26
|
+
import '../transactions/typeTag/index.mjs';
|
|
27
|
+
import '../transactions/authenticator/account.mjs';
|
|
28
|
+
import '../core/crypto/anyPublicKey.mjs';
|
|
29
|
+
import '../core/crypto/anySignature.mjs';
|
|
30
|
+
import '../core/crypto/ed25519.mjs';
|
|
31
|
+
import '../core/crypto/multiEd25519.mjs';
|
|
32
|
+
import '../core/crypto/multiKey.mjs';
|
|
33
|
+
|
|
34
|
+
declare class TransactionSubmission {
|
|
35
|
+
readonly config: AptosConfig;
|
|
36
|
+
constructor(config: AptosConfig);
|
|
37
|
+
/**
|
|
38
|
+
* Sign and submit a single signer transaction to chain
|
|
39
|
+
*
|
|
40
|
+
* @param args.signer The signer account to sign the transaction
|
|
41
|
+
* @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses
|
|
42
|
+
* ```
|
|
43
|
+
* {
|
|
44
|
+
* rawTransaction: RawTransaction,
|
|
45
|
+
* secondarySignerAddresses? : Array<AccountAddress>,
|
|
46
|
+
* feePayerAddress?: AccountAddress
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @return PendingTransactionResponse
|
|
51
|
+
*/
|
|
52
|
+
signAndSubmitTransaction(args: {
|
|
53
|
+
signer: Account;
|
|
54
|
+
transaction: AnyRawTransaction;
|
|
55
|
+
}): Promise<PendingTransactionResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Generates a transaction to publish a move package to chain.
|
|
58
|
+
*
|
|
59
|
+
* To get the `metadataBytes` and `byteCode`, can compile using Aptos CLI with command
|
|
60
|
+
* `aptos move compile --save-metadata ...`,
|
|
61
|
+
* For more info {@link https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}
|
|
62
|
+
*
|
|
63
|
+
* @param args.account The publisher account
|
|
64
|
+
* @param args.metadataBytes The package metadata bytes
|
|
65
|
+
* @param args.moduleBytecode An array of the bytecode of each module in the package in compiler output order
|
|
66
|
+
*
|
|
67
|
+
* @returns A SingleSignerTransaction that can be simulated or submitted to chain
|
|
68
|
+
*/
|
|
69
|
+
publishPackageTransaction(args: {
|
|
70
|
+
account: AccountAddressInput;
|
|
71
|
+
metadataBytes: HexInput;
|
|
72
|
+
moduleBytecode: Array<HexInput>;
|
|
73
|
+
options?: InputGenerateTransactionOptions;
|
|
74
|
+
}): Promise<SingleSignerTransaction>;
|
|
75
|
+
/**
|
|
76
|
+
* Rotate an account's auth key. After rotation, only the new private key can be used to sign txns for
|
|
77
|
+
* the account.
|
|
78
|
+
* Note: Only legacy Ed25519 scheme is supported for now.
|
|
79
|
+
* More info: {@link https://aptos.dev/guides/account-management/key-rotation/}
|
|
80
|
+
* @param args.fromAccount The account to rotate the auth key for
|
|
81
|
+
* @param args.toNewPrivateKey The new private key to rotate to
|
|
82
|
+
*
|
|
83
|
+
* @returns PendingTransactionResponse
|
|
84
|
+
*/
|
|
85
|
+
rotateAuthKey(args: {
|
|
86
|
+
fromAccount: Account;
|
|
87
|
+
toNewPrivateKey: PrivateKey;
|
|
88
|
+
}): Promise<TransactionResponse>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { TransactionSubmission };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-OCW2L33Q.mjs";import"../chunk-O2B54NZT.mjs";import"../chunk-LXW3A3MJ.mjs";import"../chunk-BFQRMCY2.mjs";import"../chunk-U6SZNNVL.mjs";import"../chunk-BV4OOU5Y.mjs";import"../chunk-HTZTTZQJ.mjs";import"../chunk-WL4OXZLN.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-HO7K2UAK.mjs";import"../chunk-JZNLZMUC.mjs";import"../chunk-S36IYY6K.mjs";import"../chunk-VWVEDCBM.mjs";import"../chunk-KQXRH5FK.mjs";import"../chunk-R3KWVOFG.mjs";import"../chunk-EWTHPMEE.mjs";import"../chunk-UAAI3NCA.mjs";import"../chunk-OVHY6ZUJ.mjs";import"../chunk-QWVR4RCV.mjs";import"../chunk-WEJAI26R.mjs";import"../chunk-3JPVQHOR.mjs";import"../chunk-33T7WTB6.mjs";import"../chunk-E7FWVXGX.mjs";import"../chunk-TCTZCPQ6.mjs";import"../chunk-GAI75GOG.mjs";import"../chunk-IBH7IOIM.mjs";import"../chunk-44MGBJ73.mjs";import"../chunk-YYRDFZE6.mjs";import"../chunk-62SCW5NH.mjs";import"../chunk-U25N2VWA.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-AH44UPM4.mjs";import"../chunk-GU4OUKAF.mjs";import"../chunk-UDBH4CER.mjs";import"../chunk-N2FKVZ4D.mjs";import"../chunk-ND3ZQKTT.mjs";import"../chunk-TPWSHFFI.mjs";import"../chunk-LDAD54H5.mjs";import"../chunk-Y7VR7X5W.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-6FBKUTGF.mjs";import"../chunk-FYIFBLHU.mjs";import"../chunk-KC64ESLO.mjs";import"../chunk-LV33NV4J.mjs";import"../chunk-ZWH2ESXT.mjs";export{a as TransactionSubmission};
|
|
2
2
|
//# sourceMappingURL=transactionSubmission.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256 } from '../types/index.
|
|
2
|
-
import '../utils/apiEndpoints.
|
|
3
|
-
import '../types/indexer.
|
|
4
|
-
import '../types/generated/operations.
|
|
5
|
-
import '../types/generated/types.
|
|
1
|
+
import { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256 } 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
6
|
|
|
7
7
|
declare const MAX_U8_NUMBER: Uint8;
|
|
8
8
|
declare const MAX_U16_NUMBER: Uint16;
|
package/dist/esm/bcs/consts.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../chunk-DNDWTM7A.mjs";import"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"../chunk-DNDWTM7A.mjs";import"../chunk-ZWH2ESXT.mjs";export{e as MAX_U128_BIG_INT,b as MAX_U16_NUMBER,f as MAX_U256_BIG_INT,c as MAX_U32_NUMBER,d as MAX_U64_BIG_INT,a as MAX_U8_NUMBER};
|
|
2
2
|
//# sourceMappingURL=consts.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256 } from '../types/index.
|
|
2
|
-
import '../utils/apiEndpoints.
|
|
3
|
-
import '../types/indexer.
|
|
4
|
-
import '../types/generated/operations.
|
|
5
|
-
import '../types/generated/types.
|
|
1
|
+
import { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256 } 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
6
|
|
|
7
7
|
/**
|
|
8
8
|
* This interface exists to define Deserializable<T> inputs for functions that
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-GTC7WHMV.mjs";import"../chunk-DNDWTM7A.mjs";import"../chunk-ZWH2ESXT.mjs";export{a as Deserializer};
|
|
2
2
|
//# sourceMappingURL=deserializer.mjs.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { Deserializable, Deserializer } from './deserializer.mjs';
|
|
2
|
+
export { Serializable, Serializer, ensureBoolean, outOfRangeErrorMessage, validateNumberInRange } from './serializer.mjs';
|
|
3
|
+
export { EntryFunctionBytes } from './serializable/entryFunctionBytes.mjs';
|
|
4
|
+
export { FixedBytes } from './serializable/fixedBytes.mjs';
|
|
5
|
+
export { Bool, U128, U16, U256, U32, U64, U8 } from './serializable/movePrimitives.mjs';
|
|
6
|
+
export { MoveOption, MoveString, MoveVector } from './serializable/moveStructs.mjs';
|
|
7
|
+
import '../types/index.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 '../core/hex.mjs';
|
|
13
|
+
import '../core/common.mjs';
|
|
14
|
+
import '../transactions/instances/transactionArgument.mjs';
|
package/dist/esm/bcs/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-FZY4PMEE.mjs";import{a as h}from"../chunk-
|
|
1
|
+
import"../chunk-FZY4PMEE.mjs";import{a as h}from"../chunk-HVADSXTB.mjs";import{a as g}from"../chunk-BPYLPPEQ.mjs";import{a as p,b as q,c as r}from"../chunk-4ADA5BE7.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o}from"../chunk-X32O46IB.mjs";import{a as f}from"../chunk-GTC7WHMV.mjs";import{a,b,c,d,e}from"../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{i as Bool,f as Deserializer,h as EntryFunctionBytes,g as FixedBytes,r as MoveOption,q as MoveString,p as MoveVector,a as Serializable,b as Serializer,n as U128,k as U16,o as U256,l as U32,m as U64,j as U8,c as ensureBoolean,d as outOfRangeErrorMessage,e as validateNumberInRange};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Serializable, Serializer } from '../serializer.
|
|
2
|
-
import { Deserializer } from '../deserializer.
|
|
3
|
-
import { FixedBytes } from './fixedBytes.
|
|
4
|
-
import { EntryFunctionArgument } from '../../transactions/instances/transactionArgument.
|
|
5
|
-
import '../../core/hex.
|
|
6
|
-
import '../../core/common.
|
|
7
|
-
import '../../types/index.
|
|
8
|
-
import '../../utils/apiEndpoints.
|
|
9
|
-
import '../../types/indexer.
|
|
10
|
-
import '../../types/generated/operations.
|
|
11
|
-
import '../../types/generated/types.
|
|
1
|
+
import { Serializable, Serializer } from '../serializer.mjs';
|
|
2
|
+
import { Deserializer } from '../deserializer.mjs';
|
|
3
|
+
import { FixedBytes } from './fixedBytes.mjs';
|
|
4
|
+
import { EntryFunctionArgument } from '../../transactions/instances/transactionArgument.mjs';
|
|
5
|
+
import '../../core/hex.mjs';
|
|
6
|
+
import '../../core/common.mjs';
|
|
7
|
+
import '../../types/index.mjs';
|
|
8
|
+
import '../../utils/apiEndpoints.mjs';
|
|
9
|
+
import '../../types/indexer.mjs';
|
|
10
|
+
import '../../types/generated/operations.mjs';
|
|
11
|
+
import '../../types/generated/types.mjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* This class exists solely to represent a sequence of fixed bytes as a serialized entry function, because
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-HVADSXTB.mjs";import"../../chunk-BPYLPPEQ.mjs";import"../../chunk-HA6JD5R6.mjs";import"../../chunk-DNDWTM7A.mjs";import"../../chunk-TIH6ARYP.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-ZWH2ESXT.mjs";export{a as EntryFunctionBytes};
|
|
2
2
|
//# sourceMappingURL=entryFunctionBytes.mjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Serializable, Serializer } from '../serializer.
|
|
2
|
-
import { Deserializer } from '../deserializer.
|
|
3
|
-
import { HexInput } from '../../types/index.
|
|
4
|
-
import { TransactionArgument } from '../../transactions/instances/transactionArgument.
|
|
5
|
-
import '../../core/hex.
|
|
6
|
-
import '../../core/common.
|
|
7
|
-
import '../../utils/apiEndpoints.
|
|
8
|
-
import '../../types/indexer.
|
|
9
|
-
import '../../types/generated/operations.
|
|
10
|
-
import '../../types/generated/types.
|
|
1
|
+
import { Serializable, Serializer } from '../serializer.mjs';
|
|
2
|
+
import { Deserializer } from '../deserializer.mjs';
|
|
3
|
+
import { HexInput } from '../../types/index.mjs';
|
|
4
|
+
import { TransactionArgument } from '../../transactions/instances/transactionArgument.mjs';
|
|
5
|
+
import '../../core/hex.mjs';
|
|
6
|
+
import '../../core/common.mjs';
|
|
7
|
+
import '../../utils/apiEndpoints.mjs';
|
|
8
|
+
import '../../types/indexer.mjs';
|
|
9
|
+
import '../../types/generated/operations.mjs';
|
|
10
|
+
import '../../types/generated/types.mjs';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* This class exists to represent a contiguous sequence of already serialized BCS-bytes.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-BPYLPPEQ.mjs";import"../../chunk-HA6JD5R6.mjs";import"../../chunk-DNDWTM7A.mjs";import"../../chunk-TIH6ARYP.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-ZWH2ESXT.mjs";export{a as FixedBytes};
|
|
2
2
|
//# sourceMappingURL=fixedBytes.mjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Deserializer } from '../deserializer.
|
|
2
|
-
import { Serializable, Serializer } from '../serializer.
|
|
3
|
-
import { TransactionArgument } from '../../transactions/instances/transactionArgument.
|
|
4
|
-
import { Uint8, Uint16, Uint32, AnyNumber } from '../../types/index.
|
|
5
|
-
import '../../utils/apiEndpoints.
|
|
6
|
-
import '../../types/indexer.
|
|
7
|
-
import '../../types/generated/operations.
|
|
8
|
-
import '../../types/generated/types.
|
|
9
|
-
import '../../core/hex.
|
|
10
|
-
import '../../core/common.
|
|
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
11
|
|
|
12
12
|
declare class Bool extends Serializable implements TransactionArgument {
|
|
13
13
|
readonly value: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"../../chunk-
|
|
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
2
|
//# sourceMappingURL=movePrimitives.mjs.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { U8, U16, U32, U64, U128, U256, Bool } from './movePrimitives.
|
|
2
|
-
import { Serializable, Serializer } from '../serializer.
|
|
3
|
-
import { Deserializer, Deserializable } from '../deserializer.
|
|
4
|
-
import { HexInput, AnyNumber } from '../../types/index.
|
|
5
|
-
import { EntryFunctionArgument, TransactionArgument } from '../../transactions/instances/transactionArgument.
|
|
6
|
-
import '../../utils/apiEndpoints.
|
|
7
|
-
import '../../types/indexer.
|
|
8
|
-
import '../../types/generated/operations.
|
|
9
|
-
import '../../types/generated/types.
|
|
10
|
-
import '../../core/hex.
|
|
11
|
-
import '../../core/common.
|
|
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
12
|
|
|
13
13
|
/**
|
|
14
14
|
* This class is the Aptos Typescript SDK representation of a Move `vector<T>`,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c}from"../../chunk-
|
|
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
2
|
//# sourceMappingURL=moveStructs.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Hex } from '../core/hex.
|
|
2
|
-
import { Uint8, Uint16, Uint32, AnyNumber } from '../types/index.
|
|
3
|
-
import '../core/common.
|
|
4
|
-
import '../utils/apiEndpoints.
|
|
5
|
-
import '../types/indexer.
|
|
6
|
-
import '../types/generated/operations.
|
|
7
|
-
import '../types/generated/types.
|
|
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
8
|
|
|
9
9
|
declare abstract class Serializable {
|
|
10
10
|
abstract serialize(serializer: Serializer): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../chunk-
|
|
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
2
|
//# sourceMappingURL=serializer.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as r}from"./chunk-NZIJV4O2.mjs";import{g as p}from"./chunk-GU4OUKAF.mjs";import{q as a}from"./chunk-UDBH4CER.mjs";async function v(o){let{accountAddress:t,aptosConfig:e,creationNumber:n}=o,i={account_address:{_eq:r.from(t).toStringLong()},creation_number:{_eq:n}};return d({aptosConfig:e,options:{where:i}})}async function A(o){let{accountAddress:t,aptosConfig:e,eventType:n,options:s}=o,c={where:{account_address:{_eq:r.fromRelaxed(t).toStringLong()},indexed_type:{_eq:n}},pagination:s?.pagination,orderBy:s?.orderBy};return d({aptosConfig:e,options:c})}async function d(o){let{aptosConfig:t,options:e}=o,n={query:a,variables:{where_condition:e?.where,offset:e?.pagination?.offset,limit:e?.pagination?.limit,order_by:e?.orderBy}};return(await p({aptosConfig:t,query:n,originMethod:"getEvents"})).events}export{v as a,A as b,d as c};
|
|
2
|
+
//# sourceMappingURL=chunk-2OZRBXLM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/internal/event.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/event}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * event namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { AnyNumber, GetEventsResponse, PaginationArgs, MoveStructId, OrderBy } from \"../types\";\nimport { GetEventsQuery } from \"../types/generated/operations\";\nimport { GetEvents } from \"../types/generated/queries\";\nimport { EventsBoolExp } from \"../types/generated/types\";\nimport { queryIndexer } from \"./general\";\n\nexport async function getAccountEventsByCreationNumber(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n creationNumber: AnyNumber;\n}): Promise<GetEventsResponse> {\n const { accountAddress, aptosConfig, creationNumber } = args;\n const address = AccountAddress.from(accountAddress);\n\n const whereCondition: EventsBoolExp = {\n account_address: { _eq: address.toStringLong() },\n creation_number: { _eq: creationNumber },\n };\n\n return getEvents({ aptosConfig, options: { where: whereCondition } });\n}\n\nexport async function getAccountEventsByEventType(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n eventType: MoveStructId;\n options?: {\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetEventsResponse[0]>;\n };\n}): Promise<GetEventsResponse> {\n const { accountAddress, aptosConfig, eventType, options } = args;\n const address = AccountAddress.fromRelaxed(accountAddress).toStringLong();\n\n const whereCondition: EventsBoolExp = {\n account_address: { _eq: address },\n indexed_type: { _eq: eventType },\n };\n\n const customOptions = {\n where: whereCondition,\n pagination: options?.pagination,\n orderBy: options?.orderBy,\n };\n\n return getEvents({ aptosConfig, options: customOptions });\n}\n\nexport async function getEvents(args: {\n aptosConfig: AptosConfig;\n options?: {\n where?: EventsBoolExp;\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetEventsResponse[0]>;\n };\n}): Promise<GetEventsResponse> {\n const { aptosConfig, options } = args;\n\n const graphqlQuery = {\n query: GetEvents,\n variables: {\n where_condition: options?.where,\n offset: options?.pagination?.offset,\n limit: options?.pagination?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetEventsQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getEvents\",\n });\n\n return data.events;\n}\n"],"mappings":"2HAkBA,eAAsBA,EAAiCC,EAIxB,CAC7B,GAAM,CAAE,eAAAC,EAAgB,YAAAC,EAAa,eAAAC,CAAe,EAAIH,EAGlDI,EAAgC,CACpC,gBAAiB,CAAE,IAHLC,EAAe,KAAKJ,CAAc,EAGhB,aAAa,CAAE,EAC/C,gBAAiB,CAAE,IAAKE,CAAe,CACzC,EAEA,OAAOG,EAAU,CAAE,YAAAJ,EAAa,QAAS,CAAE,MAAOE,CAAe,CAAE,CAAC,CACtE,CAEA,eAAsBG,EAA4BP,EAQnB,CAC7B,GAAM,CAAE,eAAAC,EAAgB,YAAAC,EAAa,UAAAM,EAAW,QAAAC,CAAQ,EAAIT,EAQtDU,EAAgB,CACpB,MANoC,CACpC,gBAAiB,CAAE,IAHLL,EAAe,YAAYJ,CAAc,EAAE,aAAa,CAGtC,EAChC,aAAc,CAAE,IAAKO,CAAU,CACjC,EAIE,WAAYC,GAAS,WACrB,QAASA,GAAS,OACpB,EAEA,OAAOH,EAAU,CAAE,YAAAJ,EAAa,QAASQ,CAAc,CAAC,CAC1D,CAEA,eAAsBJ,EAAUN,EAOD,CAC7B,GAAM,CAAE,YAAAE,EAAa,QAAAO,CAAQ,EAAIT,EAE3BW,EAAe,CACnB,MAAOC,EACP,UAAW,CACT,gBAAiBH,GAAS,MAC1B,OAAQA,GAAS,YAAY,OAC7B,MAAOA,GAAS,YAAY,MAC5B,SAAUA,GAAS,OACrB,CACF,EAQA,OANa,MAAMI,EAA6B,CAC9C,YAAAX,EACA,MAAOS,EACP,aAAc,WAChB,CAAC,GAEW,MACd","names":["getAccountEventsByCreationNumber","args","accountAddress","aptosConfig","creationNumber","whereCondition","AccountAddress","getEvents","getAccountEventsByEventType","eventType","options","customOptions","graphqlQuery","GetEvents","queryIndexer"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as f}from"./chunk-GAI75GOG.mjs";import{a as A}from"./chunk-IBH7IOIM.mjs";import{a as _}from"./chunk-YYRDFZE6.mjs";import{b as m}from"./chunk-62SCW5NH.mjs";import{b as y}from"./chunk-RYETO74W.mjs";import{b as a}from"./chunk-NZIJV4O2.mjs";import{a as b}from"./chunk-AH44UPM4.mjs";import{d as S,g as d}from"./chunk-GU4OUKAF.mjs";import{d as C,e as h,f as w,g as k,h as T,j as O,k as q,l as v}from"./chunk-UDBH4CER.mjs";import{b as g,c as p}from"./chunk-ND3ZQKTT.mjs";import{a as l}from"./chunk-6FBKUTGF.mjs";async function M(t){let{aptosConfig:n,accountAddress:e}=t,{data:o}=await g({aptosConfig:n,originMethod:"getInfo",path:`accounts/${a.from(e).toString()}`});return o}async function co(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return p({aptosConfig:n,originMethod:"getModules",path:`accounts/${a.from(e).toString()}/modules`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??1e3}})}async function ao(t){return t.options?.ledgerVersion!==void 0?G(t):b(async()=>G(t),`module-${t.accountAddress}-${t.moduleName}`,1e3*60*5)()}async function G(t){let{aptosConfig:n,accountAddress:e,moduleName:o,options:s}=t,{data:r}=await g({aptosConfig:n,originMethod:"getModule",path:`accounts/${a.from(e).toString()}/module/${o}`,params:{ledger_version:s?.ledgerVersion}});return r}async function io(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return p({aptosConfig:n,originMethod:"getTransactions",path:`accounts/${a.from(e).toString()}/transactions`,params:{start:o?.offset,limit:o?.limit}})}async function uo(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return p({aptosConfig:n,originMethod:"getResources",path:`accounts/${a.from(e).toString()}/resources`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??999}})}async function K(t){let{aptosConfig:n,accountAddress:e,resourceType:o,options:s}=t,{data:r}=await g({aptosConfig:n,originMethod:"getResource",path:`accounts/${a.from(e).toString()}/resource/${o}`,params:{ledger_version:s?.ledgerVersion}});return r.data}async function Q(t){let{aptosConfig:n,authenticationKey:e,options:o}=t,s=await K({aptosConfig:n,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:o}),{address_map:{handle:r}}=s,c=a.from(e);try{let i=await S({aptosConfig:n,handle:r,data:{key:c.toString(),key_type:"address",value_type:"address"},options:o});return a.from(i)}catch(i){if(i instanceof l&&i.data.error_code==="table_item_not_found")return c;throw i}}async function go(t){let{aptosConfig:n,accountAddress:e}=t,s={owner_address:{_eq:a.from(e).toStringLong()},amount:{_gt:0}},c=await d({aptosConfig:n,query:{query:q,variables:{where_condition:s}},originMethod:"getAccountTokensCount"});if(!c.current_token_ownerships_v2_aggregate.aggregate)throw Error("Failed to get the count of account tokens");return c.current_token_ownerships_v2_aggregate.aggregate.count}async function po(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:a.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.token_standard={_eq:o?.tokenStandard});let c={query:T,variables:{where_condition:r,offset:o?.pagination?.offset,limit:o?.pagination?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:c,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function Ao(t){let{aptosConfig:n,accountAddress:e,collectionAddress:o,options:s}=t,r=a.from(e).toStringLong(),c=a.from(o).toStringLong(),i={owner_address:{_eq:r},current_token_data:{collection_id:{_eq:c}},amount:{_gt:0}};s?.tokenStandard&&(i.token_standard={_eq:s?.tokenStandard});let u={query:O,variables:{where_condition:i,offset:s?.pagination?.offset,limit:s?.pagination?.limit,order_by:s?.orderBy}};return(await d({aptosConfig:n,query:u,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function fo(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:a.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.current_collection={token_standard:{_eq:o?.tokenStandard}});let c={query:w,variables:{where_condition:r,offset:o?.pagination?.offset,limit:o?.pagination?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:c,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function lo(t){let{aptosConfig:n,accountAddress:e}=t,o=a.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:v,variables:{address:o}},originMethod:"getAccountTransactionsCount"});if(!r.account_transactions_aggregate.aggregate)throw Error("Failed to get the count of account transactions");return r.account_transactions_aggregate.aggregate.count}async function yo(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:a.from(e).toStringLong()}},c={query:h,variables:{where_condition:r,offset:o?.pagination?.offset,limit:o?.pagination?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:c,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function mo(t){let{aptosConfig:n,accountAddress:e}=t,o=a.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:C,variables:{address:o}},originMethod:"getAccountCoinsCount"});if(!r.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return r.current_fungible_asset_balances_aggregate.aggregate.count}async function _o(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:a.from(e).toStringLong()}},c={query:k,variables:{where_condition:r,offset:o?.pagination?.offset,limit:o?.pagination?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:c,originMethod:"getAccountOwnedObjects"})).current_objects}async function Co(t){let{aptosConfig:n,privateKey:e}=t,o=new _(e.publicKey());if(e instanceof m){let r=A.fromPublicKeyAndScheme({publicKey:o,scheme:2}).derivedAddress();return f.fromPrivateKeyAndAddress({privateKey:e,address:r})}if(e instanceof y){let s=A.fromPublicKeyAndScheme({publicKey:o,scheme:2});if(await P({authKey:s,aptosConfig:n})){let u=s.derivedAddress();return f.fromPrivateKeyAndAddress({privateKey:e,address:u,legacy:!1})}let c=A.fromPublicKeyAndScheme({publicKey:o,scheme:0});if(await P({authKey:c,aptosConfig:n})){let u=c.derivedAddress();return f.fromPrivateKeyAndAddress({privateKey:e,address:u,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function P(t){let{aptosConfig:n,authKey:e}=t,o=await Q({aptosConfig:n,authenticationKey:e.derivedAddress()});try{return await M({aptosConfig:n,accountAddress:o}),!0}catch(s){if(s.status===404)return!1;throw new Error(`Error while looking for an account info ${o.toString()}`)}}export{M as a,co as b,ao as c,io as d,uo as e,K as f,Q as g,go as h,po as i,Ao as j,fo as k,lo as l,yo as m,mo as n,_o as o,Co as p,P as q};
|
|
2
|
+
//# sourceMappingURL=chunk-33T7WTB6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/internal/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/account}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * account namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AptosApiError, getAptosFullNode, paginateWithCursor } from \"../client\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { Account } from \"../core/account\";\nimport { PrivateKey } from \"../core/crypto/asymmetricCrypto\";\nimport { getTableItem, queryIndexer } from \"./general\";\nimport {\n AccountData,\n GetAccountCoinsDataResponse,\n GetAccountCollectionsWithOwnedTokenResponse,\n GetAccountOwnedObjectsResponse,\n GetAccountOwnedTokensFromCollectionResponse,\n GetAccountOwnedTokensQueryResponse,\n LedgerVersion,\n MoveModuleBytecode,\n MoveResource,\n MoveStructId,\n OrderBy,\n PaginationArgs,\n SigningScheme,\n TokenStandard,\n TransactionResponse,\n} from \"../types\";\nimport {\n GetAccountCoinsCountQuery,\n GetAccountCoinsDataQuery,\n GetAccountCollectionsWithOwnedTokensQuery,\n GetAccountOwnedObjectsQuery,\n GetAccountOwnedTokensFromCollectionQuery,\n GetAccountOwnedTokensQuery,\n GetAccountTokensCountQuery,\n GetAccountTransactionsCountQuery,\n} from \"../types/generated/operations\";\nimport {\n GetAccountCoinsCount,\n GetAccountCoinsData,\n GetAccountCollectionsWithOwnedTokens,\n GetAccountOwnedObjects,\n GetAccountOwnedTokens,\n GetAccountOwnedTokensFromCollection,\n GetAccountTokensCount,\n GetAccountTransactionsCount,\n} from \"../types/generated/queries\";\nimport { memoizeAsync } from \"../utils/memoize\";\nimport { Secp256k1PrivateKey, AuthenticationKey, Ed25519PrivateKey } from \"../core\";\nimport { AnyPublicKey } from \"../core/crypto/anyPublicKey\";\n\nexport async function getInfo(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<AccountData> {\n const { aptosConfig, accountAddress } = args;\n const { data } = await getAptosFullNode<{}, AccountData>({\n aptosConfig,\n originMethod: \"getInfo\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}`,\n });\n return data;\n}\n\nexport async function getModules(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersion;\n}): Promise<MoveModuleBytecode[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithCursor<{}, MoveModuleBytecode[]>({\n aptosConfig,\n originMethod: \"getModules\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/modules`,\n params: {\n ledger_version: options?.ledgerVersion,\n start: options?.offset,\n limit: options?.limit ?? 1000,\n },\n });\n}\n\n/**\n * Queries for a move module given account address and module name\n *\n * @param args.accountAddress Hex-encoded 32 byte Aptos account address\n * @param args.moduleName The name of the module\n * @param args.query.ledgerVersion Specifies ledger version of transactions. By default, latest version will be used\n * @returns The move module.\n */\nexport async function getModule(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersion;\n}): Promise<MoveModuleBytecode> {\n // We don't memoize the account module by ledger version, as it's not a common use case, this would be handled\n // by the developer directly\n if (args.options?.ledgerVersion !== undefined) {\n return getModuleInner(args);\n }\n\n return memoizeAsync(\n async () => getModuleInner(args),\n `module-${args.accountAddress}-${args.moduleName}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n\nasync function getModuleInner(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersion;\n}): Promise<MoveModuleBytecode> {\n const { aptosConfig, accountAddress, moduleName, options } = args;\n\n const { data } = await getAptosFullNode<{}, MoveModuleBytecode>({\n aptosConfig,\n originMethod: \"getModule\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/module/${moduleName}`,\n params: { ledger_version: options?.ledgerVersion },\n });\n return data;\n}\n\nexport async function getTransactions(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs;\n}): Promise<TransactionResponse[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithCursor<{}, TransactionResponse[]>({\n aptosConfig,\n originMethod: \"getTransactions\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/transactions`,\n params: { start: options?.offset, limit: options?.limit },\n });\n}\n\nexport async function getResources(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersion;\n}): Promise<MoveResource[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithCursor<{}, MoveResource[]>({\n aptosConfig,\n originMethod: \"getResources\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/resources`,\n params: {\n ledger_version: options?.ledgerVersion,\n start: options?.offset,\n limit: options?.limit ?? 999,\n },\n });\n}\n\nexport async function getResource<T extends {}>(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n resourceType: MoveStructId;\n options?: LedgerVersion;\n}): Promise<T> {\n const { aptosConfig, accountAddress, resourceType, options } = args;\n const { data } = await getAptosFullNode<{}, MoveResource>({\n aptosConfig,\n originMethod: \"getResource\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/resource/${resourceType}`,\n params: { ledger_version: options?.ledgerVersion },\n });\n return data.data as T;\n}\n\nexport async function lookupOriginalAccountAddress(args: {\n aptosConfig: AptosConfig;\n authenticationKey: AccountAddressInput;\n options?: LedgerVersion;\n}): Promise<AccountAddress> {\n const { aptosConfig, authenticationKey, options } = args;\n type OriginatingAddress = {\n address_map: { handle: string };\n };\n const resource = await getResource<OriginatingAddress>({\n aptosConfig,\n accountAddress: \"0x1\",\n resourceType: \"0x1::account::OriginatingAddress\",\n options,\n });\n\n const {\n address_map: { handle },\n } = resource;\n\n const authKeyAddress = AccountAddress.from(authenticationKey);\n\n // If the address is not found in the address map, which means its not rotated\n // then return the address as is\n try {\n const originalAddress = await getTableItem<string>({\n aptosConfig,\n handle,\n data: {\n key: authKeyAddress.toString(),\n key_type: \"address\",\n value_type: \"address\",\n },\n options,\n });\n\n return AccountAddress.from(originalAddress);\n } catch (err) {\n if (err instanceof AptosApiError && err.data.error_code === \"table_item_not_found\") {\n return authKeyAddress;\n }\n\n throw err;\n }\n}\n\nexport async function getAccountTokensCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string }; amount: { _gt: number } } = {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n const graphqlQuery = {\n query: GetAccountTokensCount,\n variables: { where_condition: whereCondition },\n };\n\n const data = await queryIndexer<GetAccountTokensCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountTokensCount\",\n });\n if (!data.current_token_ownerships_v2_aggregate.aggregate) {\n throw Error(\"Failed to get the count of account tokens\");\n }\n return data.current_token_ownerships_v2_aggregate.aggregate.count;\n}\n\nexport async function getAccountOwnedTokens(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: {\n tokenStandard?: TokenStandard;\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetAccountOwnedTokensQueryResponse[0]>;\n };\n}): Promise<GetAccountOwnedTokensQueryResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string }; amount: { _gt: number }; token_standard?: { _eq: string } } =\n {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.token_standard = { _eq: options?.tokenStandard };\n }\n\n const graphqlQuery = {\n query: GetAccountOwnedTokens,\n variables: {\n where_condition: whereCondition,\n offset: options?.pagination?.offset,\n limit: options?.pagination?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountOwnedTokensQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedTokens\",\n });\n\n return data.current_token_ownerships_v2;\n}\n\nexport async function getAccountOwnedTokensFromCollectionAddress(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n collectionAddress: AccountAddressInput;\n options?: {\n tokenStandard?: TokenStandard;\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetAccountOwnedTokensFromCollectionResponse[0]>;\n };\n}): Promise<GetAccountOwnedTokensFromCollectionResponse> {\n const { aptosConfig, accountAddress, collectionAddress, options } = args;\n const ownerAddress = AccountAddress.from(accountAddress).toStringLong();\n const collAddress = AccountAddress.from(collectionAddress).toStringLong();\n\n const whereCondition: {\n owner_address: { _eq: string };\n current_token_data: { collection_id: { _eq: string } };\n amount: { _gt: number };\n token_standard?: { _eq: string };\n } = {\n owner_address: { _eq: ownerAddress },\n current_token_data: { collection_id: { _eq: collAddress } },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.token_standard = { _eq: options?.tokenStandard };\n }\n\n const graphqlQuery = {\n query: GetAccountOwnedTokensFromCollection,\n variables: {\n where_condition: whereCondition,\n offset: options?.pagination?.offset,\n limit: options?.pagination?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountOwnedTokensFromCollectionQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedTokensFromCollectionAddress\",\n });\n\n return data.current_token_ownerships_v2;\n}\n\nexport async function getAccountCollectionsWithOwnedTokens(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: {\n tokenStandard?: TokenStandard;\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetAccountCollectionsWithOwnedTokenResponse[0]>;\n };\n}): Promise<GetAccountCollectionsWithOwnedTokenResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: {\n owner_address: { _eq: string };\n amount: { _gt: number };\n current_collection?: { token_standard: { _eq: string } };\n } = {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.current_collection = {\n token_standard: { _eq: options?.tokenStandard },\n };\n }\n\n const graphqlQuery = {\n query: GetAccountCollectionsWithOwnedTokens,\n variables: {\n where_condition: whereCondition,\n offset: options?.pagination?.offset,\n limit: options?.pagination?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountCollectionsWithOwnedTokensQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCollectionsWithOwnedTokens\",\n });\n\n return data.current_collection_ownership_v2_view;\n}\n\nexport async function getAccountTransactionsCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const graphqlQuery = {\n query: GetAccountTransactionsCount,\n variables: { address },\n };\n\n const data = await queryIndexer<GetAccountTransactionsCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountTransactionsCount\",\n });\n\n if (!data.account_transactions_aggregate.aggregate) {\n throw Error(\"Failed to get the count of account transactions\");\n }\n\n return data.account_transactions_aggregate.aggregate.count;\n}\n\nexport async function getAccountCoinsData(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: {\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetAccountCoinsDataResponse[0]>;\n };\n}): Promise<GetAccountCoinsDataResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string } } = {\n owner_address: { _eq: address },\n };\n\n const graphqlQuery = {\n query: GetAccountCoinsData,\n variables: {\n where_condition: whereCondition,\n offset: options?.pagination?.offset,\n limit: options?.pagination?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountCoinsDataQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCoinsData\",\n });\n\n return data.current_fungible_asset_balances;\n}\n\nexport async function getAccountCoinsCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const graphqlQuery = {\n query: GetAccountCoinsCount,\n variables: { address },\n };\n\n const data = await queryIndexer<GetAccountCoinsCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCoinsCount\",\n });\n\n if (!data.current_fungible_asset_balances_aggregate.aggregate) {\n throw Error(\"Failed to get the count of account coins\");\n }\n\n return data.current_fungible_asset_balances_aggregate.aggregate.count;\n}\n\nexport async function getAccountOwnedObjects(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: {\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetAccountOwnedObjectsResponse[0]>;\n };\n}): Promise<GetAccountOwnedObjectsResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string } } = {\n owner_address: { _eq: address },\n };\n const graphqlQuery = {\n query: GetAccountOwnedObjects,\n variables: {\n where_condition: whereCondition,\n offset: options?.pagination?.offset,\n limit: options?.pagination?.limit,\n order_by: options?.orderBy,\n },\n };\n const data = await queryIndexer<GetAccountOwnedObjectsQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedObjects\",\n });\n\n return data.current_objects;\n}\n\n/**\n * NOTE: There is a potential issue once unified single signer scheme will be adopted\n * by the community.\n *\n * Becuase on could create 2 accounts with the same private key with this new authenticator type,\n * we’ll need to determine the order in which we lookup the accounts. First unified\n * scheme and then legacy scheme vs first legacy scheme and then unified scheme.\n *\n */\nexport async function deriveAccountFromPrivateKey(args: {\n aptosConfig: AptosConfig;\n privateKey: PrivateKey;\n}): Promise<Account> {\n const { aptosConfig, privateKey } = args;\n const publicKey = new AnyPublicKey(privateKey.publicKey());\n\n if (privateKey instanceof Secp256k1PrivateKey) {\n // private key is secp256k1, therefore we know it for sure uses a single signer key\n const authKey = AuthenticationKey.fromPublicKeyAndScheme({ publicKey, scheme: SigningScheme.SingleKey });\n const address = authKey.derivedAddress();\n return Account.fromPrivateKeyAndAddress({ privateKey, address });\n }\n\n if (privateKey instanceof Ed25519PrivateKey) {\n // lookup single sender ed25519\n const singleSenderTransactionAuthenticatorAuthKey = AuthenticationKey.fromPublicKeyAndScheme({\n publicKey,\n scheme: SigningScheme.SingleKey,\n });\n const isSingleSenderTransactionAuthenticator = await isAccountExist({\n authKey: singleSenderTransactionAuthenticatorAuthKey,\n aptosConfig,\n });\n if (isSingleSenderTransactionAuthenticator) {\n const address = singleSenderTransactionAuthenticatorAuthKey.derivedAddress();\n return Account.fromPrivateKeyAndAddress({ privateKey, address, legacy: false });\n }\n // lookup legacy ed25519\n const legacyAuthKey = AuthenticationKey.fromPublicKeyAndScheme({ publicKey, scheme: SigningScheme.Ed25519 });\n const isLegacyEd25519 = await isAccountExist({ authKey: legacyAuthKey, aptosConfig });\n if (isLegacyEd25519) {\n const address = legacyAuthKey.derivedAddress();\n return Account.fromPrivateKeyAndAddress({ privateKey, address, legacy: true });\n }\n }\n // if we are here, it means we couldn't find an address with an\n // auth key that matches the provided private key\n throw new Error(`Can't derive account from private key ${privateKey}`);\n}\n\nexport async function isAccountExist(args: { aptosConfig: AptosConfig; authKey: AuthenticationKey }): Promise<boolean> {\n const { aptosConfig, authKey } = args;\n const accountAddress = await lookupOriginalAccountAddress({\n aptosConfig,\n authenticationKey: authKey.derivedAddress(),\n });\n\n try {\n await getInfo({\n aptosConfig,\n accountAddress,\n });\n return true;\n } catch (error: any) {\n // account not found\n if (error.status === 404) {\n return false;\n }\n throw new Error(`Error while looking for an account info ${accountAddress.toString()}`);\n }\n}\n"],"mappings":"kgBAyDA,eAAsBA,EAAQC,EAGL,CACvB,GAAM,CAAE,YAAAC,EAAa,eAAAC,CAAe,EAAIF,EAClC,CAAE,KAAAG,CAAK,EAAI,MAAMC,EAAkC,CACvD,YAAAH,EACA,aAAc,UACd,KAAM,YAAYI,EAAe,KAAKH,CAAc,EAAE,SAAS,CAAC,EAClE,CAAC,EACD,OAAOC,CACT,CAEA,eAAsBG,GAAWN,EAIC,CAChC,GAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,QAAAK,CAAQ,EAAIP,EACjD,OAAOQ,EAA6C,CAClD,YAAAP,EACA,aAAc,aACd,KAAM,YAAYI,EAAe,KAAKH,CAAc,EAAE,SAAS,CAAC,WAChE,O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EAAkB,uBAAuB,CAC3F,UAAAH,EACA,QACF,CAAC,EAKD,GAJ+C,MAAMO,EAAe,CAClE,QAASD,EACT,YAAAxD,CACF,CAAC,EAC2C,CAC1C,IAAMwC,EAAUgB,EAA4C,eAAe,EAC3E,OAAOF,EAAQ,yBAAyB,CAAE,WAAAL,EAAY,QAAAT,EAAS,OAAQ,EAAM,CAAC,CAChF,CAEA,IAAMkB,EAAgBL,EAAkB,uBAAuB,CAAE,UAAAH,EAAW,QAA8B,CAAC,EAE3G,GADwB,MAAMO,EAAe,CAAE,QAASC,EAAe,YAAA1D,CAAY,CAAC,EAC/D,CACnB,IAAMwC,EAAUkB,EAAc,eAAe,EAC7C,OAAOJ,EAAQ,yBAAyB,CAAE,WAAAL,EAAY,QAAAT,EAAS,OAAQ,EAAK,CAAC,CAC/E,CACF,CAGA,MAAM,IAAI,MAAM,yCAAyCS,CAAU,EAAE,CACvE,CAEA,eAAsBQ,EAAe1D,EAAkF,CACrH,GAAM,CAAE,YAAAC,EAAa,QAAA2D,CAAQ,EAAI5D,EAC3BE,EAAiB,MAAMe,EAA6B,CACxD,YAAAhB,EACA,kBAAmB2D,EAAQ,eAAe,CAC5C,CAAC,EAED,GAAI,CACF,aAAM7D,EAAQ,CACZ,YAAAE,EACA,eAAAC,CACF,CAAC,EACM,EACT,OAAS2D,EAAY,CAEnB,GAAIA,EAAM,SAAW,IACnB,MAAO,GAET,MAAM,IAAI,MAAM,2CAA2C3D,EAAe,SAAS,CAAC,EAAE,CACxF,CACF","names":["getInfo","args","aptosConfig","accountAddress","data","getAptosFullNode","AccountAddress","getModules","options","paginateWithCursor","getModule","getModuleInner","memoizeAsync","moduleName","getTransactions","getResources","getResource","resourceType","lookupOriginalAccountAddress","authenticationKey","resource","handle","authKeyAddress","originalAddress","getTableItem","err","AptosApiError","getAccountTokensCount","whereCondition","queryIndexer","GetAccountTokensCount","getAccountOwnedTokens","graphqlQuery","GetAccountOwnedTokens","getAccountOwnedTokensFromCollectionAddress","collectionAddress","ownerAddress","collAddress","GetAccountOwnedTokensFromCollection","getAccountCollectionsWithOwnedTokens","GetAccountCollectionsWithOwnedTokens","getAccountTransactionsCount","address","GetAccountTransactionsCount","getAccountCoinsData","GetAccountCoinsData","getAccountCoinsCount","GetAccountCoinsCount","getAccountOwnedObjects","GetAccountOwnedObjects","deriveAccountFromPrivateKey","privateKey","publicKey","AnyPublicKey","Secp256k1PrivateKey","AuthenticationKey","Account","Ed25519PrivateKey","singleSenderTransactionAuthenticatorAuthKey","isAccountExist","legacyAuthKey","authKey","error"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as d}from"./chunk-5LO7FR2P.mjs";import{a as y}from"./chunk-3VZ3OZKC.mjs";import{a as b}from"./chunk-DRPMIJH7.mjs";import{a as A}from"./chunk-4KTQIWUP.mjs";import{a as c}from"./chunk-J5BH7V37.mjs";import{a as g}from"./chunk-PZCMSHY6.mjs";import{a as f}from"./chunk-67OGU66P.mjs";import{a as m}from"./chunk-M2V2POWK.mjs";import{a as u}from"./chunk-RKKU2SY5.mjs";import{a as h}from"./chunk-Y2HRRUZ6.mjs";import{a as p}from"./chunk-OCW2L33Q.mjs";import{a as e}from"./chunk-ZLW65YCO.mjs";import{a as l}from"./chunk-ZUHN56GM.mjs";import{a as S}from"./chunk-ARVSIDVB.mjs";import{a as r}from"./chunk-72F5YXGC.mjs";import{a}from"./chunk-OSTH5JRX.mjs";var i=class{constructor(n){this.config=new S(n),this.account=new e(this.config),this.ans=new l(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new g(this.config),this.fungibleAsset=new f(this.config),this.general=new m(this.config),this.staking=new u(this.config),this.transaction=new h(this.config),this.transactionSubmission=new p(this.config),this.build=new d(this.config),this.sign=new y(this.config),this.simulate=new b(this.config),this.submit=new A(this.config)}};function t(w,n,v){Object.getOwnPropertyNames(n.prototype).forEach(o=>{let s=Object.getOwnPropertyDescriptor(n.prototype,o);s&&(s.value=function(...k){return this[v][o](...k)},Object.defineProperty(w.prototype,o,s))})}t(i,e,"account");t(i,l,"ans");t(i,r,"coin");t(i,a,"digitalAsset");t(i,c,"event");t(i,g,"faucet");t(i,f,"fungibleAsset");t(i,m,"general");t(i,u,"staking");t(i,h,"transaction");t(i,p,"transactionSubmission");t(i,d,"build");t(i,y,"sign");t(i,b,"simulate");t(i,A,"submit");export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3732I6BR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { TransactionSubmission } from \"./transactionSubmission\";\nimport { Build } from \"./transactionSubmission/build\";\nimport { Sign } from \"./transactionSubmission/sign\";\nimport { Simulate } from \"./transactionSubmission/simulate\";\nimport { Submit } from \"./transactionSubmission/submit\";\n\n/**\n * This class is the main entry point into Aptos's\n * APIs and separates functionality into different namespaces.\n *\n * To use the SDK, create a new Aptos instance to get access\n * to all the sdk functionality.\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n readonly transactionSubmission: TransactionSubmission;\n\n readonly build: Build;\n\n readonly sign: Sign;\n\n readonly simulate: Simulate;\n\n readonly submit: Submit;\n\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n this.transactionSubmission = new TransactionSubmission(this.config);\n this.build = new Build(this.config);\n this.sign = new Sign(this.config);\n this.simulate = new Simulate(this.config);\n this.submit = new Submit(this.config);\n }\n}\n\nexport interface Aptos\n extends Account,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Staking,\n Transaction,\n ANS,\n TransactionSubmission {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\napplyMixin(Aptos, TransactionSubmission, \"transactionSubmission\");\napplyMixin(Aptos, Build, \"build\");\napplyMixin(Aptos, Sign, \"sign\");\napplyMixin(Aptos, Simulate, \"simulate\");\napplyMixin(Aptos, Submit, \"submit\");\n"],"mappings":"2oBA2BO,IAAMA,EAAN,KAAY,CAiCjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,EAC9C,KAAK,sBAAwB,IAAIC,EAAsB,KAAK,MAAM,EAClE,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,SAAW,IAAIC,EAAS,KAAK,MAAM,EACxC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,CACtC,CACF,EAuBA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWlB,EAAOG,EAAS,SAAS,EACpCe,EAAWlB,EAAOI,EAAK,KAAK,EAC5Bc,EAAWlB,EAAOK,EAAM,MAAM,EAC9Ba,EAAWlB,EAAOM,EAAc,cAAc,EAC9CY,EAAWlB,EAAOO,EAAO,OAAO,EAChCW,EAAWlB,EAAOQ,EAAQ,QAAQ,EAClCU,EAAWlB,EAAOS,EAAe,eAAe,EAChDS,EAAWlB,EAAOU,EAAS,SAAS,EACpCQ,EAAWlB,EAAOW,EAAS,SAAS,EACpCO,EAAWlB,EAAOY,EAAa,aAAa,EAC5CM,EAAWlB,EAAOa,EAAuB,uBAAuB,EAChEK,EAAWlB,EAAOc,EAAO,OAAO,EAChCI,EAAWlB,EAAOe,EAAM,MAAM,EAC9BG,EAAWlB,EAAOgB,EAAU,UAAU,EACtCE,EAAWlB,EAAOiB,EAAQ,QAAQ","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","TransactionSubmission","Build","Sign","Simulate","Submit","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as o}from"./chunk-O2B54NZT.mjs";var a=class{constructor(n){this.config=n}transaction(n){return o({...n})}transactionAsFeePayer(n){let{signer:r,transaction:t}=n;if(!t.feePayerAddress)throw new Error(`Transaction ${t} is not a Fee Payer transaction`);return t.feePayerAddress=r.accountAddress,o({signer:r,transaction:t})}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-3VZ3OZKC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/transactionSubmission/sign.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"../../core\";\nimport { signTransaction } from \"../../internal/transactionSubmission\";\nimport { AccountAuthenticator, AnyRawTransaction } from \"../../transactions\";\nimport { AptosConfig } from \"../aptosConfig\";\n\n/**\n * A class to handle all `Sign` transaction operations\n */\nexport class Sign {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n // eslint-disable-next-line class-methods-use-this\n transaction(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n return signTransaction({\n ...args,\n });\n }\n\n // eslint-disable-next-line class-methods-use-this\n transactionAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n const { signer, transaction } = args;\n\n // if transaction doesnt hold a \"feePayerAddress\" prop it means\n // this is not a fee payer transaction\n if (!transaction.feePayerAddress) {\n throw new Error(`Transaction ${transaction} is not a Fee Payer transaction`);\n }\n\n // Set the feePayerAddress to the signer account address\n transaction.feePayerAddress = signer.accountAddress;\n\n return signTransaction({\n signer,\n transaction,\n });\n }\n}\n"],"mappings":"yCAWO,IAAMA,EAAN,KAAW,CAGhB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAGA,YAAYC,EAAiF,CAC3F,OAAOC,EAAgB,CACrB,GAAGD,CACL,CAAC,CACH,CAGA,sBAAsBA,EAAiF,CACrG,GAAM,CAAE,OAAAE,EAAQ,YAAAC,CAAY,EAAIH,EAIhC,GAAI,CAACG,EAAY,gBACf,MAAM,IAAI,MAAM,eAAeA,CAAW,iCAAiC,EAI7E,OAAAA,EAAY,gBAAkBD,EAAO,eAE9BD,EAAgB,CACrB,OAAAC,EACA,YAAAC,CACF,CAAC,CACH,CACF","names":["Sign","config","args","signTransaction","signer","transaction"]}
|
|
@@ -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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/crypto/multiKey.ts"],"sourcesContent":["import { Hex } from \"../hex\";\nimport { HexInput } from \"../../types\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializer } from \"../../bcs/serializer\";\nimport { AnyPublicKey } from \"./anyPublicKey\";\nimport { AnySignature } from \"./anySignature\";\nimport { PublicKey } from \"./asymmetricCrypto\";\n\nexport class MultiKey extends PublicKey {\n /**\n * List of any public keys\n */\n public readonly publicKeys: AnyPublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n */\n public readonly signaturesRequired: number;\n\n constructor(args: { publicKeys: PublicKey[]; signaturesRequired: number }) {\n super();\n const { publicKeys, signaturesRequired } = args;\n\n // Validate number of public keys is greater than signature required\n if (signaturesRequired < 1) {\n throw new Error(\"The number of required signatures needs to be greater then 0\");\n }\n\n // Validate number of public keys is greater than signature required\n if (publicKeys.length < signaturesRequired) {\n throw new Error(\n `Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`,\n );\n }\n\n const keys: AnyPublicKey[] = [];\n publicKeys.forEach((publicKey) => {\n if (publicKey instanceof AnyPublicKey) {\n keys.push(publicKey);\n } else {\n // if public key is instance of a legacy authentication key, i.e\n // Legacy Ed25519, convert it into AnyPublicKey\n keys.push(new AnyPublicKey(publicKey));\n }\n });\n\n this.publicKeys = keys;\n this.signaturesRequired = signaturesRequired;\n }\n\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n /**\n * Create a bitmap that holds the mapping from the original public keys\n * to the signatures passed in\n *\n * @param args.bits array of the index mapping to the matching public keys\n * @returns Uint8array bit map\n */\n createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, idx: number) => {\n if (idx + 1 > this.publicKeys.length) {\n throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(`Duplicate bit ${bit} detected.`);\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n /**\n * Hex string representation the multi key bytes\n *\n * @returns string\n */\n toString(): string {\n return Hex.fromHexInput(this.toUint8Array()).toString();\n }\n\n // TODO\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: { message: HexInput; signature: AnySignature }): boolean {\n throw new Error(\"not implemented\");\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeVector(this.publicKeys);\n serializer.serializeU8(this.signaturesRequired);\n }\n\n static deserialize(deserializer: Deserializer): MultiKey {\n const keys = deserializer.deserializeVector(AnyPublicKey);\n const signaturesRequired = deserializer.deserializeU8();\n\n return new MultiKey({ publicKeys: keys, signaturesRequired });\n }\n}\n"],"mappings":"2HAQO,IAAMA,EAAN,
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/multiKey.ts"],"sourcesContent":["import { Hex } from \"../hex\";\nimport { HexInput } from \"../../types\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializer } from \"../../bcs/serializer\";\nimport { AnyPublicKey } from \"./anyPublicKey\";\nimport { AnySignature } from \"./anySignature\";\nimport { PublicKey } from \"./asymmetricCrypto\";\n\nexport class MultiKey extends PublicKey {\n /**\n * List of any public keys\n */\n public readonly publicKeys: AnyPublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n */\n public readonly signaturesRequired: number;\n\n constructor(args: { publicKeys: PublicKey[]; signaturesRequired: number }) {\n super();\n const { publicKeys, signaturesRequired } = args;\n\n // Validate number of public keys is greater than signature required\n if (signaturesRequired < 1) {\n throw new Error(\"The number of required signatures needs to be greater then 0\");\n }\n\n // Validate number of public keys is greater than signature required\n if (publicKeys.length < signaturesRequired) {\n throw new Error(\n `Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`,\n );\n }\n\n const keys: AnyPublicKey[] = [];\n publicKeys.forEach((publicKey) => {\n if (publicKey instanceof AnyPublicKey) {\n keys.push(publicKey);\n } else {\n // if public key is instance of a legacy authentication key, i.e\n // Legacy Ed25519, convert it into AnyPublicKey\n keys.push(new AnyPublicKey(publicKey));\n }\n });\n\n this.publicKeys = keys;\n this.signaturesRequired = signaturesRequired;\n }\n\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n /**\n * Create a bitmap that holds the mapping from the original public keys\n * to the signatures passed in\n *\n * @param args.bits array of the index mapping to the matching public keys\n * @returns Uint8array bit map\n */\n createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, idx: number) => {\n if (idx + 1 > this.publicKeys.length) {\n throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(`Duplicate bit ${bit} detected.`);\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n /**\n * Hex string representation the multi key bytes\n *\n * @returns string\n */\n toString(): string {\n return Hex.fromHexInput(this.toUint8Array()).toString();\n }\n\n // TODO\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: { message: HexInput; signature: AnySignature }): boolean {\n throw new Error(\"not implemented\");\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeVector(this.publicKeys);\n serializer.serializeU8(this.signaturesRequired);\n }\n\n static deserialize(deserializer: Deserializer): MultiKey {\n const keys = deserializer.deserializeVector(AnyPublicKey);\n const signaturesRequired = deserializer.deserializeU8();\n\n return new MultiKey({ publicKeys: keys, signaturesRequired });\n }\n}\n"],"mappings":"2HAQO,IAAMA,EAAN,MAAMC,UAAiBC,CAAU,CAWtC,YAAYC,EAA+D,CACzE,MAAM,EACN,GAAM,CAAE,WAAAC,EAAY,mBAAAC,CAAmB,EAAIF,EAG3C,GAAIE,EAAqB,EACvB,MAAM,IAAI,MAAM,8DAA8D,EAIhF,GAAID,EAAW,OAASC,EACtB,MAAM,IAAI,MACR,YAAYD,EAAW,MAAM,oCAAoCC,CAAkB,sBACrF,EAGF,IAAMC,EAAuB,CAAC,EAC9BF,EAAW,QAASG,GAAc,CAC5BA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yPublicKey","bits","firstBitInByte","bitmap","dupCheckSet","bit","idx","byteOffset","byte","Hex","serializer","deserializer"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-X32O46IB.mjs";import{a as o}from"./chunk-HA6JD5R6.mjs";import{b as z}from"./chunk-TIH6ARYP.mjs";var t=class n extends o{constructor(e){super();this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(!(this.values[0]instanceof s)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let i=z.fromHexInput(e);r=Array.from(i.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type");return new n(r.map(i=>new s(i)))}static U16(e){return new n(e.map(r=>new u(r)))}static U32(e){return new n(e.map(r=>new c(r)))}static U64(e){return new n(e.map(r=>new d(r)))}static U128(e){return new n(e.map(r=>new m(r)))}static U256(e){return new n(e.map(r=>new U(r)))}static Bool(e){return new n(e.map(r=>new l(r)))}static MoveString(e){return new n(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let i=e.deserializeUleb128AsU32(),y=new Array;for(let w=0;w<i;w+=1)y.push(r.deserialize(e));return new n(y)}},a=class n extends o{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let r=this.bcsToBytes().slice(1);t.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new n(e.deserializeStr())}},f=class n extends o{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new n(e!=null?new s(e):void 0)}static U16(e){return new n(e!=null?new u(e):void 0)}static U32(e){return new n(e!=null?new c(e):void 0)}static U64(e){return new n(e!=null?new d(e):void 0)}static U128(e){return new n(e!=null?new m(e):void 0)}static U256(e){return new n(e!=null?new U(e):void 0)}static Bool(e){return new n(e!=null?new l(e):void 0)}static MoveString(e){return new n(e!=null?new a(e):void 0)}static deserialize(e,r){let i=t.deserialize(e,r);return new n(i.values[0])}};export{t as a,a as b,f as c};
|
|
2
|
+
//# sourceMappingURL=chunk-4ADA5BE7.mjs.map
|