@aptos-labs/ts-sdk 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/browser/index.d.ts +340 -288
- package/dist/browser/index.global.js +54 -30
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +340 -288
- package/dist/common/index.js +24 -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.ts → ans.d.mts} +33 -33
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +72 -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} +33 -33
- 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 +46 -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.d.ts → transactionSubmission.d.mts} +33 -33
- 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-WVMDCC4V.mjs → chunk-2W744GUN.mjs} +2 -2
- package/dist/esm/{chunk-WVMDCC4V.mjs.map → chunk-2W744GUN.mjs.map} +1 -1
- package/dist/esm/chunk-3JVGSFHP.mjs +2 -0
- package/dist/esm/chunk-3JVGSFHP.mjs.map +1 -0
- package/dist/esm/chunk-44MGBJ73.mjs +2 -0
- package/dist/esm/{chunk-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-KYWYIK5P.mjs → chunk-4RVIA63I.mjs} +2 -2
- package/dist/esm/chunk-4RVIA63I.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-MIBLZSNS.mjs → chunk-7MNEEVXY.mjs} +2 -2
- package/dist/esm/chunk-7MNEEVXY.mjs.map +1 -0
- package/dist/esm/{chunk-KPESAXVI.mjs → chunk-AAIBCWZY.mjs} +2 -2
- 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-IXMH6AXJ.mjs → chunk-BFSEVKNA.mjs} +2 -2
- package/dist/esm/chunk-BP5ZO7NK.mjs +2 -0
- package/dist/esm/{chunk-FHJ7F7Z6.mjs.map → chunk-BP5ZO7NK.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-VAGYTPSI.mjs → chunk-BWMNPUTK.mjs} +2 -2
- package/dist/esm/chunk-CYDWEPFL.mjs +1 -0
- package/dist/esm/chunk-EFIYW4WK.mjs +2 -0
- package/dist/esm/{chunk-2MQZUGO6.mjs → chunk-EGOYLZBU.mjs} +2 -2
- package/dist/esm/chunk-EGOYLZBU.mjs.map +1 -0
- package/dist/esm/chunk-EQ5BEDJ7.mjs +2 -0
- package/dist/esm/{chunk-ADR4XQPR.mjs.map → chunk-EQ5BEDJ7.mjs.map} +1 -1
- 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-EYXHVA6W.mjs +2 -0
- package/dist/esm/chunk-EYXHVA6W.mjs.map +1 -0
- package/dist/esm/chunk-GEFQFRL3.mjs +2 -0
- package/dist/esm/chunk-GEFQFRL3.mjs.map +1 -0
- package/dist/esm/{chunk-BC2NOUYT.mjs → chunk-GTC7WHMV.mjs} +2 -2
- package/dist/esm/{chunk-BC2NOUYT.mjs.map → chunk-GTC7WHMV.mjs.map} +1 -1
- 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-HVADSXTB.mjs +2 -0
- package/dist/esm/{chunk-LU6VS7PJ.mjs.map → chunk-HVADSXTB.mjs.map} +1 -1
- package/dist/esm/{chunk-Z56AKXJ7.mjs → chunk-IG5CHHSI.mjs} +2 -2
- package/dist/esm/chunk-IXMB2GOK.mjs +2 -0
- package/dist/esm/chunk-IXMB2GOK.mjs.map +1 -0
- package/dist/esm/{chunk-TYHBYRUA.mjs → chunk-J5ZFOJN2.mjs} +2 -2
- package/dist/esm/chunk-J5ZFOJN2.mjs.map +1 -0
- package/dist/esm/chunk-JDS7K2WI.mjs +2 -0
- package/dist/esm/{chunk-KNLMUSIO.mjs.map → chunk-JDS7K2WI.mjs.map} +1 -1
- 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-2B5QXKPU.mjs → chunk-NGCFPQ22.mjs} +2 -2
- package/dist/esm/chunk-NGCFPQ22.mjs.map +1 -0
- package/dist/esm/chunk-NTD3H2S4.mjs +2 -0
- package/dist/esm/chunk-NTD3H2S4.mjs.map +1 -0
- package/dist/esm/{chunk-KFP7MDSD.mjs → chunk-NYFVEKF6.mjs} +2 -2
- 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-TXUMB5ZO.mjs → chunk-P32MY5YF.mjs} +2 -2
- package/dist/esm/{chunk-TXUMB5ZO.mjs.map → chunk-P32MY5YF.mjs.map} +1 -1
- package/dist/esm/{chunk-DNYVUM3K.mjs → chunk-Q6N6QACD.mjs} +2 -2
- package/dist/esm/{chunk-DNYVUM3K.mjs.map → chunk-Q6N6QACD.mjs.map} +1 -1
- 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-R26XML3D.mjs +2 -0
- package/dist/esm/chunk-R26XML3D.mjs.map +1 -0
- package/dist/esm/chunk-R3KWVOFG.mjs +2 -0
- package/dist/esm/{chunk-KWJ6XKNF.mjs.map → chunk-R3KWVOFG.mjs.map} +1 -1
- 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-TIH6ARYP.mjs +2 -0
- package/dist/esm/{chunk-IZHPCZE3.mjs.map → chunk-TIH6ARYP.mjs.map} +1 -1
- package/dist/esm/{chunk-O243HOP3.mjs → chunk-TQD4IGUM.mjs} +2 -2
- package/dist/esm/chunk-TQD4IGUM.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-U3LO2FSJ.mjs +2 -0
- package/dist/esm/{chunk-ZXJ5ZBTL.mjs.map → chunk-U3LO2FSJ.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-UNQNACJT.mjs +2 -0
- package/dist/esm/chunk-UPLWWSB4.mjs +2 -0
- package/dist/esm/{chunk-J3QOSJFP.mjs.map → chunk-UPLWWSB4.mjs.map} +1 -1
- package/dist/esm/{chunk-XFSL7O6Q.mjs → chunk-V45RFKH7.mjs} +2 -2
- package/dist/esm/chunk-V45RFKH7.mjs.map +1 -0
- package/dist/esm/{chunk-PJDVHU7X.mjs → chunk-VMQWW5UT.mjs} +2 -2
- package/dist/esm/{chunk-PJDVHU7X.mjs.map → chunk-VMQWW5UT.mjs.map} +1 -1
- package/dist/esm/chunk-VOYW2TZW.mjs +2 -0
- package/dist/esm/{chunk-KJDY66XF.mjs.map → chunk-VOYW2TZW.mjs.map} +1 -1
- 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-VYAVLUPJ.mjs} +2 -2
- package/dist/esm/{chunk-ZT2A5ABR.mjs.map → chunk-VYAVLUPJ.mjs.map} +1 -1
- package/dist/esm/{chunk-XFS5O5GJ.mjs → chunk-WKY5ENCK.mjs} +2 -2
- package/dist/esm/{chunk-XFS5O5GJ.mjs.map → chunk-WKY5ENCK.mjs.map} +1 -1
- package/dist/esm/{chunk-BTK34A5U.mjs → chunk-WX43AJTD.mjs} +10 -10
- package/dist/esm/chunk-WX43AJTD.mjs.map +1 -0
- 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-Y5DJPHJT.mjs +2 -0
- package/dist/esm/chunk-Y5DJPHJT.mjs.map +1 -0
- 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-Z2UDRTHA.mjs +2 -0
- package/dist/esm/{chunk-JTGGMXB7.mjs.map → chunk-Z2UDRTHA.mjs.map} +1 -1
- 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.ts → index.d.mts} +60 -60
- 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.ts → ans.d.mts} +32 -32
- 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} +32 -32
- 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} +32 -32
- 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.ts → index.d.mts} +39 -39
- 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} +33 -35
- 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} +49 -60
- package/dist/esm/types/generated/{operations.d.ts → operations.d.mts} +78 -78
- package/dist/esm/types/generated/{queries.d.ts → queries.d.mts} +31 -31
- 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 +62 -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/coin.ts +2 -2
- package/src/api/event.ts +2 -2
- package/src/api/general.ts +4 -4
- package/src/api/transactionSubmission.ts +7 -2
- 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 +2 -2
- package/src/internal/coin.ts +2 -2
- package/src/internal/event.ts +2 -2
- package/src/internal/general.ts +7 -6
- package/src/internal/transactionSubmission.ts +41 -9
- package/src/transactions/transactionBuilder/helpers.ts +2 -2
- package/src/transactions/transactionBuilder/transactionBuilder.ts +15 -16
- package/src/transactions/typeTag/parser.ts +10 -2
- package/src/transactions/types.ts +3 -12
- package/src/types/generated/operations.ts +33 -33
- package/src/types/generated/queries.ts +22 -22
- package/src/types/generated/types.ts +2253 -2251
- package/src/types/index.ts +16 -10
- package/src/utils/index.ts +2 -0
- 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/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-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-KJDY66XF.mjs +0 -2
- 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-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-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-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/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/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-KPESAXVI.mjs.map → chunk-AAIBCWZY.mjs.map} +0 -0
- /package/dist/esm/{chunk-IXMH6AXJ.mjs.map → chunk-BFSEVKNA.mjs.map} +0 -0
- /package/dist/esm/{chunk-VAGYTPSI.mjs.map → chunk-BWMNPUTK.mjs.map} +0 -0
- /package/dist/esm/{chunk-XNFEUXDS.mjs.map → chunk-CYDWEPFL.mjs.map} +0 -0
- /package/dist/esm/{chunk-E72CFUU4.mjs.map → chunk-EFIYW4WK.mjs.map} +0 -0
- /package/dist/esm/{chunk-Z56AKXJ7.mjs.map → chunk-IG5CHHSI.mjs.map} +0 -0
- /package/dist/esm/{chunk-KFP7MDSD.mjs.map → chunk-NYFVEKF6.mjs.map} +0 -0
- /package/dist/esm/{chunk-EKAOAGNQ.mjs.map → chunk-UAAI3NCA.mjs.map} +0 -0
- /package/dist/esm/{chunk-SJLO3JIH.mjs.map → chunk-UNQNACJT.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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/generated/queries.ts"],"sourcesContent":["import * as Types from \"./operations\";\n\nimport { GraphQLClient } from \"graphql-request\";\nimport * as Dom from \"graphql-request/dist/types.dom\";\nexport const TokenActivitiesFieldsFragmentDoc = `\n fragment TokenActivitiesFields on token_activities_v2 {\n after_value\n before_value\n entry_function_id_str\n event_account_address\n event_index\n from_address\n is_fungible_v2\n property_version_v1\n to_address\n token_amount\n token_data_id\n token_standard\n transaction_timestamp\n transaction_version\n type\n}\n `;\nexport const CurrentTokenOwnershipFieldsFragmentDoc = `\n fragment CurrentTokenOwnershipFields on current_token_ownerships_v2 {\n token_standard\n token_properties_mutated_v1\n token_data_id\n table_type_v1\n storage_id\n property_version_v1\n owner_address\n last_transaction_version\n last_transaction_timestamp\n is_soulbound_v2\n is_fungible_v2\n amount\n current_token_data {\n collection_id\n description\n is_fungible_v2\n largest_property_version_v1\n last_transaction_timestamp\n last_transaction_version\n maximum\n supply\n token_data_id\n token_name\n token_properties\n token_standard\n token_uri\n current_collection {\n collection_id\n collection_name\n creator_address\n current_supply\n description\n last_transaction_timestamp\n last_transaction_version\n max_supply\n mutable_description\n mutable_uri\n table_handle_v1\n token_standard\n total_minted_v2\n uri\n }\n }\n}\n `;\nexport const GetAccountCoinsCount = `\n query getAccountCoinsCount($address: String) {\n current_fungible_asset_balances_aggregate(\n where: {owner_address: {_eq: $address}}\n ) {\n aggregate {\n count\n }\n }\n}\n `;\nexport const GetAccountCoinsData = `\n query getAccountCoinsData($where_condition: current_fungible_asset_balances_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_fungible_asset_balances_order_by!]) {\n current_fungible_asset_balances(\n where: $where_condition\n offset: $offset\n limit: $limit\n order_by: $order_by\n ) {\n amount\n asset_type\n is_frozen\n is_primary\n last_transaction_timestamp\n last_transaction_version\n owner_address\n storage_id\n token_standard\n metadata {\n token_standard\n symbol\n supply_aggregator_table_key_v1\n supply_aggregator_table_handle_v1\n project_uri\n name\n last_transaction_version\n last_transaction_timestamp\n icon_uri\n decimals\n creator_address\n asset_type\n }\n }\n}\n `;\nexport const GetAccountCollectionsWithOwnedTokens = `\n query getAccountCollectionsWithOwnedTokens($where_condition: current_collection_ownership_v2_view_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_collection_ownership_v2_view_order_by!]) {\n current_collection_ownership_v2_view(\n where: $where_condition\n offset: $offset\n limit: $limit\n order_by: $order_by\n ) {\n current_collection {\n collection_id\n collection_name\n creator_address\n current_supply\n description\n last_transaction_timestamp\n last_transaction_version\n mutable_description\n max_supply\n mutable_uri\n table_handle_v1\n token_standard\n total_minted_v2\n uri\n }\n collection_id\n collection_name\n collection_uri\n creator_address\n distinct_tokens\n last_transaction_version\n owner_address\n single_token_uri\n }\n}\n `;\nexport const GetAccountOwnedObjects = `\n query getAccountOwnedObjects($where_condition: current_objects_bool_exp, $offset: Int, $limit: Int, $order_by: [current_objects_order_by!]) {\n current_objects(\n where: $where_condition\n offset: $offset\n limit: $limit\n order_by: $order_by\n ) {\n allow_ungated_transfer\n state_key_hash\n owner_address\n object_address\n last_transaction_version\n last_guid_creation_num\n is_deleted\n }\n}\n `;\nexport const GetAccountOwnedTokens = `\n query getAccountOwnedTokens($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {\n current_token_ownerships_v2(\n where: $where_condition\n offset: $offset\n limit: $limit\n order_by: $order_by\n ) {\n ...CurrentTokenOwnershipFields\n }\n}\n ${CurrentTokenOwnershipFieldsFragmentDoc}`;\nexport const GetAccountOwnedTokensByTokenData = `\n query getAccountOwnedTokensByTokenData($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {\n current_token_ownerships_v2(\n where: $where_condition\n offset: $offset\n limit: $limit\n order_by: $order_by\n ) {\n ...CurrentTokenOwnershipFields\n }\n}\n ${CurrentTokenOwnershipFieldsFragmentDoc}`;\nexport const GetAccountOwnedTokensFromCollection = `\n query getAccountOwnedTokensFromCollection($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {\n current_token_ownerships_v2(\n where: $where_condition\n offset: $offset\n limit: $limit\n order_by: $order_by\n ) {\n ...CurrentTokenOwnershipFields\n }\n}\n ${CurrentTokenOwnershipFieldsFragmentDoc}`;\nexport const GetAccountTokensCount = `\n query getAccountTokensCount($where_condition: current_token_ownerships_v2_bool_exp, $offset: Int, $limit: Int) {\n current_token_ownerships_v2_aggregate(\n where: $where_condition\n offset: $offset\n limit: $limit\n ) {\n aggregate {\n count\n }\n }\n}\n `;\nexport const GetAccountTransactionsCount = `\n query getAccountTransactionsCount($address: String) {\n account_transactions_aggregate(where: {account_address: {_eq: $address}}) {\n aggregate {\n count\n }\n }\n}\n `;\nexport const GetChainTopUserTransactions = `\n query getChainTopUserTransactions($limit: Int) {\n user_transactions(limit: $limit, order_by: {version: desc}) {\n version\n }\n}\n `;\nexport const GetCollectionData = `\n query getCollectionData($where_condition: current_collections_v2_bool_exp!) {\n current_collections_v2(where: $where_condition) {\n collection_id\n collection_name\n creator_address\n current_supply\n description\n last_transaction_timestamp\n last_transaction_version\n max_supply\n mutable_description\n mutable_uri\n table_handle_v1\n token_standard\n total_minted_v2\n uri\n }\n}\n `;\nexport const GetCurrentFungibleAssetBalances = `\n query getCurrentFungibleAssetBalances($where_condition: current_fungible_asset_balances_bool_exp, $offset: Int, $limit: Int) {\n current_fungible_asset_balances(\n where: $where_condition\n offset: $offset\n limit: $limit\n ) {\n amount\n asset_type\n is_frozen\n is_primary\n last_transaction_timestamp\n last_transaction_version\n owner_address\n storage_id\n token_standard\n }\n}\n `;\nexport const GetDelegatedStakingActivities = `\n query getDelegatedStakingActivities($delegatorAddress: String, $poolAddress: String) {\n delegated_staking_activities(\n where: {delegator_address: {_eq: $delegatorAddress}, pool_address: {_eq: $poolAddress}}\n ) {\n amount\n delegator_address\n event_index\n event_type\n pool_address\n transaction_version\n }\n}\n `;\nexport const GetEvents = `\n query getEvents($where_condition: events_bool_exp, $offset: Int, $limit: Int, $order_by: [events_order_by!]) {\n events(\n where: $where_condition\n offset: $offset\n limit: $limit\n order_by: $order_by\n ) {\n account_address\n creation_number\n data\n event_index\n sequence_number\n transaction_block_height\n transaction_version\n type\n indexed_type\n }\n}\n `;\nexport const GetFungibleAssetActivities = `\n query getFungibleAssetActivities($where_condition: fungible_asset_activities_bool_exp, $offset: Int, $limit: Int) {\n fungible_asset_activities(\n where: $where_condition\n offset: $offset\n limit: $limit\n ) {\n amount\n asset_type\n block_height\n entry_function_id_str\n event_index\n gas_fee_payer_address\n is_frozen\n is_gas_fee\n is_transaction_success\n owner_address\n storage_id\n storage_refund_amount\n token_standard\n transaction_timestamp\n transaction_version\n type\n }\n}\n `;\nexport const GetFungibleAssetMetadata = `\n query getFungibleAssetMetadata($where_condition: fungible_asset_metadata_bool_exp, $offset: Int, $limit: Int) {\n fungible_asset_metadata(where: $where_condition, offset: $offset, limit: $limit) {\n icon_uri\n project_uri\n supply_aggregator_table_handle_v1\n supply_aggregator_table_key_v1\n creator_address\n asset_type\n decimals\n last_transaction_timestamp\n last_transaction_version\n name\n symbol\n token_standard\n }\n}\n `;\nexport const GetNumberOfDelegators = `\n query getNumberOfDelegators($where_condition: num_active_delegator_per_pool_bool_exp!, $order_by: [num_active_delegator_per_pool_order_by!]) {\n num_active_delegator_per_pool(where: $where_condition, order_by: $order_by) {\n num_active_delegator\n pool_address\n }\n}\n `;\nexport const GetProcessorStatus = `\n query getProcessorStatus {\n processor_status {\n last_success_version\n processor\n last_updated\n }\n}\n `;\nexport const GetTokenActivity = `\n query getTokenActivity($where_condition: token_activities_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [token_activities_v2_order_by!]) {\n token_activities_v2(\n where: $where_condition\n order_by: $order_by\n offset: $offset\n limit: $limit\n ) {\n ...TokenActivitiesFields\n }\n}\n ${TokenActivitiesFieldsFragmentDoc}`;\nexport const GetCurrentTokenOwnership = `\n query getCurrentTokenOwnership($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {\n current_token_ownerships_v2(\n where: $where_condition\n offset: $offset\n limit: $limit\n order_by: $order_by\n ) {\n ...CurrentTokenOwnershipFields\n }\n}\n ${CurrentTokenOwnershipFieldsFragmentDoc}`;\nexport const GetTokenData = `\n query getTokenData($where_condition: current_token_datas_v2_bool_exp, $offset: Int, $limit: Int, $order_by: [current_token_datas_v2_order_by!]) {\n current_token_datas_v2(\n where: $where_condition\n offset: $offset\n limit: $limit\n order_by: $order_by\n ) {\n collection_id\n description\n is_fungible_v2\n largest_property_version_v1\n last_transaction_timestamp\n last_transaction_version\n maximum\n supply\n token_data_id\n token_name\n token_properties\n token_standard\n token_uri\n current_collection {\n collection_id\n collection_name\n creator_address\n current_supply\n description\n last_transaction_timestamp\n last_transaction_version\n max_supply\n mutable_description\n mutable_uri\n table_handle_v1\n token_standard\n total_minted_v2\n uri\n }\n }\n}\n `;\n\nexport type SdkFunctionWrapper = <T>(\n action: (requestHeaders?: Record<string, string>) => Promise<T>,\n operationName: string,\n operationType?: string,\n) => Promise<T>;\n\nconst defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType) => action();\n\nexport function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) {\n return {\n getAccountCoinsCount(\n variables?: Types.GetAccountCoinsCountQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetAccountCoinsCountQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetAccountCoinsCountQuery>(GetAccountCoinsCount, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getAccountCoinsCount\",\n \"query\",\n );\n },\n getAccountCoinsData(\n variables: Types.GetAccountCoinsDataQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetAccountCoinsDataQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetAccountCoinsDataQuery>(GetAccountCoinsData, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getAccountCoinsData\",\n \"query\",\n );\n },\n getAccountCollectionsWithOwnedTokens(\n variables: Types.GetAccountCollectionsWithOwnedTokensQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetAccountCollectionsWithOwnedTokensQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetAccountCollectionsWithOwnedTokensQuery>(\n GetAccountCollectionsWithOwnedTokens,\n variables,\n { ...requestHeaders, ...wrappedRequestHeaders },\n ),\n \"getAccountCollectionsWithOwnedTokens\",\n \"query\",\n );\n },\n getAccountOwnedObjects(\n variables?: Types.GetAccountOwnedObjectsQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetAccountOwnedObjectsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetAccountOwnedObjectsQuery>(GetAccountOwnedObjects, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getAccountOwnedObjects\",\n \"query\",\n );\n },\n getAccountOwnedTokens(\n variables: Types.GetAccountOwnedTokensQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetAccountOwnedTokensQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetAccountOwnedTokensQuery>(GetAccountOwnedTokens, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getAccountOwnedTokens\",\n \"query\",\n );\n },\n getAccountOwnedTokensByTokenData(\n variables: Types.GetAccountOwnedTokensByTokenDataQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetAccountOwnedTokensByTokenDataQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetAccountOwnedTokensByTokenDataQuery>(GetAccountOwnedTokensByTokenData, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getAccountOwnedTokensByTokenData\",\n \"query\",\n );\n },\n getAccountOwnedTokensFromCollection(\n variables: Types.GetAccountOwnedTokensFromCollectionQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetAccountOwnedTokensFromCollectionQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetAccountOwnedTokensFromCollectionQuery>(\n GetAccountOwnedTokensFromCollection,\n variables,\n { ...requestHeaders, ...wrappedRequestHeaders },\n ),\n \"getAccountOwnedTokensFromCollection\",\n \"query\",\n );\n },\n getAccountTokensCount(\n variables?: Types.GetAccountTokensCountQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetAccountTokensCountQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetAccountTokensCountQuery>(GetAccountTokensCount, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getAccountTokensCount\",\n \"query\",\n );\n },\n getAccountTransactionsCount(\n variables?: Types.GetAccountTransactionsCountQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetAccountTransactionsCountQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetAccountTransactionsCountQuery>(GetAccountTransactionsCount, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getAccountTransactionsCount\",\n \"query\",\n );\n },\n getChainTopUserTransactions(\n variables?: Types.GetChainTopUserTransactionsQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetChainTopUserTransactionsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetChainTopUserTransactionsQuery>(GetChainTopUserTransactions, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getChainTopUserTransactions\",\n \"query\",\n );\n },\n getCollectionData(\n variables: Types.GetCollectionDataQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetCollectionDataQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetCollectionDataQuery>(GetCollectionData, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getCollectionData\",\n \"query\",\n );\n },\n getCurrentFungibleAssetBalances(\n variables?: Types.GetCurrentFungibleAssetBalancesQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetCurrentFungibleAssetBalancesQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetCurrentFungibleAssetBalancesQuery>(GetCurrentFungibleAssetBalances, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getCurrentFungibleAssetBalances\",\n \"query\",\n );\n },\n getDelegatedStakingActivities(\n variables?: Types.GetDelegatedStakingActivitiesQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetDelegatedStakingActivitiesQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetDelegatedStakingActivitiesQuery>(GetDelegatedStakingActivities, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getDelegatedStakingActivities\",\n \"query\",\n );\n },\n getEvents(\n variables?: Types.GetEventsQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetEventsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetEventsQuery>(GetEvents, variables, { ...requestHeaders, ...wrappedRequestHeaders }),\n \"getEvents\",\n \"query\",\n );\n },\n getFungibleAssetActivities(\n variables?: Types.GetFungibleAssetActivitiesQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetFungibleAssetActivitiesQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetFungibleAssetActivitiesQuery>(GetFungibleAssetActivities, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getFungibleAssetActivities\",\n \"query\",\n );\n },\n getFungibleAssetMetadata(\n variables?: Types.GetFungibleAssetMetadataQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetFungibleAssetMetadataQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetFungibleAssetMetadataQuery>(GetFungibleAssetMetadata, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getFungibleAssetMetadata\",\n \"query\",\n );\n },\n getNumberOfDelegators(\n variables: Types.GetNumberOfDelegatorsQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetNumberOfDelegatorsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetNumberOfDelegatorsQuery>(GetNumberOfDelegators, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getNumberOfDelegators\",\n \"query\",\n );\n },\n getProcessorStatus(\n variables?: Types.GetProcessorStatusQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetProcessorStatusQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetProcessorStatusQuery>(GetProcessorStatus, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getProcessorStatus\",\n \"query\",\n );\n },\n getTokenActivity(\n variables: Types.GetTokenActivityQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetTokenActivityQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetTokenActivityQuery>(GetTokenActivity, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getTokenActivity\",\n \"query\",\n );\n },\n getCurrentTokenOwnership(\n variables: Types.GetCurrentTokenOwnershipQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetCurrentTokenOwnershipQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetCurrentTokenOwnershipQuery>(GetCurrentTokenOwnership, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getCurrentTokenOwnership\",\n \"query\",\n );\n },\n getTokenData(\n variables?: Types.GetTokenDataQueryVariables,\n requestHeaders?: Dom.RequestInit[\"headers\"],\n ): Promise<Types.GetTokenDataQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<Types.GetTokenDataQuery>(GetTokenData, variables, {\n ...requestHeaders,\n ...wrappedRequestHeaders,\n }),\n \"getTokenData\",\n \"query\",\n );\n },\n };\n}\nexport type Sdk = ReturnType<typeof getSdk>;\n"],"mappings":"AAIO,IAAMA,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAmBnCC,EAAyC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MA+CzCC,EAAu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,EAAO,QAAuCT,EAAoBW,EAAW,CAC3E,GAAGC,EACH,GAAGC,CACL,CAAC,EACH,qBACA,OACF,CACF,EACA,iBACEF,EACAC,EACsC,CACtC,OAAOF,EACJG,GACCJ,EAAO,QAAqCR,EAAkBU,EAAW,CACvE,GAAGC,EACH,GAAGC,CACL,CAAC,EACH,mBACA,OACF,CACF,EACA,yBACEF,EACAC,EAC8C,CAC9C,OAAOF,EACJG,GACCJ,EAAO,QAA6CP,EAA0BS,EAAW,CACvF,GAAGC,EACH,GAAGC,CACL,CAAC,EACH,2BACA,OACF,CACF,EACA,aACEF,EACAC,EACkC,CAClC,OAAOF,EACJG,GACCJ,EAAO,QAAiCN,EAAcQ,EAAW,CAC/D,GAAGC,EACH,GAAGC,CACL,CAAC,EACH,eACA,OACF,CACF,CACF,CACF","names":["TokenActivitiesFieldsFragmentDoc","CurrentTokenOwnershipFieldsFragmentDoc","GetAccountCoinsCount","GetAccountCoinsData","GetAccountCollectionsWithOwnedTokens","GetAccountOwnedObjects","GetAccountOwnedTokens","GetAccountOwnedTokensByTokenData","GetAccountOwnedTokensFromCollection","GetAccountTokensCount","GetAccountTransactionsCount","GetChainTopUserTransactions","GetCollectionData","GetCurrentFungibleAssetBalances","GetDelegatedStakingActivities","GetEvents","GetFungibleAssetActivities","GetFungibleAssetMetadata","GetNumberOfDelegators","GetProcessorStatus","GetTokenActivity","GetCurrentTokenOwnership","GetTokenData","defaultWrapper","action","_operationName","_operationType","getSdk","client","withWrapper","variables","requestHeaders","wrappedRequestHeaders"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-UVGCVCNG.mjs";import{a as p}from"./chunk-E72CFUU4.mjs";import{b as y}from"./chunk-IZHPCZE3.mjs";var u=class extends p{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,a)=>{if(a+1>this.publicKeys.length)throw new Error(`Signature index ${a+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 c=Math.floor(n/8),l=i[c];l|=r>>n%8,i[c]=l}),i}toString(){return y.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 u({publicKeys:t,signaturesRequired:r})}};export{u as a};
|
|
2
|
-
//# sourceMappingURL=chunk-CZZJAR3B.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-BREUBEPM.mjs";import{a as U}from"./chunk-KWJ6XKNF.mjs";import{a as h}from"./chunk-LAXIJRYU.mjs";import{b as A}from"./chunk-HH5RSP2H.mjs";import{a as S}from"./chunk-LU6VS7PJ.mjs";import{a as v}from"./chunk-7AQXAH6Q.mjs";import{a as F,b as z,c as T,d as _,e as w,f as x,g as E}from"./chunk-PDLUCVJB.mjs";import{a as b}from"./chunk-27P7PELS.mjs";function D(i){let e=i.deserializeUleb128AsU32();switch(e){case 0:return z.deserialize(i);case 1:return w.deserialize(i);case 2:return x.deserialize(i);case 3:return A.deserialize(i);case 4:return v.deserialize(i,z);case 5:return F.deserialize(i);case 6:return T.deserialize(i);case 7:return _.deserialize(i);case 8:return E.deserialize(i);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var o=class extends b{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return c.load(e);case 2:return l.load(e);case 3:return u.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},c=class extends o{constructor(t){super();this.script=t}serialize(t){t.serializeU32AsUleb128(0),this.script.serialize(t)}static load(t){let r=d.deserialize(t);return new c(r)}},l=class extends o{constructor(t){super();this.entryFunction=t}serialize(t){t.serializeU32AsUleb128(2),this.entryFunction.serialize(t)}static load(t){let r=s.deserialize(t);return new l(r)}},u=class extends o{constructor(t){super();this.multiSig=t}serialize(t){t.serializeU32AsUleb128(3),this.multiSig.serialize(t)}static load(t){let r=y.deserialize(t);return new u(r)}},s=class{constructor(e,t,r,n){this.module_name=e,this.function_name=t,this.type_args=r,this.args=n}static build(e,t,r,n){return new s(U.fromStr(e),new h(t),r,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForEntryFunction(e)})}static deserialize(e){let t=U.deserialize(e),r=h.deserialize(e),n=e.deserializeVector(f),m=e.deserializeUleb128AsU32(),a=new Array;for(let g=0;g<m;g+=1){let B=e.deserializeUleb128AsU32(),M=S.deserialize(e,B);a.push(M)}return new s(t,r,n,a)}},d=class{constructor(e,t,r){this.bytecode=e,this.type_args=t,this.args=r}serialize(e){e.serializeBytes(this.bytecode),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForScriptFunction(e)})}static deserialize(e){let t=e.deserializeBytes(),r=e.deserializeVector(f),n=e.deserializeUleb128AsU32(),m=new Array;for(let a=0;a<n;a+=1){let g=D(e);m.push(g)}return new d(t,r,m)}},y=class{constructor(e,t){this.multisig_address=e,this.transaction_payload=t}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){let t=A.deserialize(e),r=e.deserializeBool(),n;return r&&(n=p.deserialize(e)),new y(t,n)}},p=class{constructor(e){this.transaction_payload=e}serialize(e){e.serializeU32AsUleb128(0),this.transaction_payload.serialize(e)}static deserialize(e){return e.deserializeUleb128AsU32(),new p(s.deserialize(e))}};export{D as a,o as b,c,l as d,u as e,s as f,d as g,y as h,p as i};
|
|
2
|
-
//# sourceMappingURL=chunk-DXUIJ6KA.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as A}from"./chunk-7TL2MY2B.mjs";import{e as l}from"./chunk-MIBLZSNS.mjs";import{b as s}from"./chunk-HH5RSP2H.mjs";import{b as p,c}from"./chunk-7AQXAH6Q.mjs";import{e as m}from"./chunk-PDLUCVJB.mjs";var g=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function w(e){return!(!e||e.length<3||e.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(e))}function y(e){let[o,n,...r]=e.replace(/\.apt$/,"").split(".");if(r.length>0)throw new Error(`${e} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!w(o))throw new Error(`${o} is not valid. ${g}`);if(n&&!w(n))throw new Error(`${n} is not valid. ${g}`);return{domainName:n||o,subdomainName:n?o:void 0}}var L="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",h="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",v={["testnet"]:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",["mainnet"]:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",["local"]:h,["custom"]:null,["devnet"]:null};function b(e){let o=v[e.network];if(!o)throw new Error(`The ANS contract is not deployed to ${e.network}`);return o}var C=e=>({vec:[e]}),E=()=>({vec:[]}),x=e=>e!=null?C(e):E(),_=e=>{if(!!e&&typeof e=="object"&&"vec"in e&&Array.isArray(e.vec))return e.vec[0]};async function U(e){let{aptosConfig:o,name:n}=e,r=b(o),{domainName:d,subdomainName:t}=y(n),a=await l({aptosConfig:o,payload:{function:`${r}::router::get_owner_addr`,functionArguments:[d,x(t)]}}),i=_(a[0]);return i?s.fromRelaxed(i).toString():void 0}async function k(e){let{aptosConfig:o,expiration:n,name:r,sender:d,targetAddress:t,toAddress:a,options:i}=e,N=b(o),{domainName:T,subdomainName:u}=y(r),f=n.policy==="subdomain:independent"||n.policy==="subdomain:follow-domain";if(u&&!f)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(f&&!u)throw new Error(`Policy is set to ${n.policy} but no subdomain was provided`);if(n.policy==="domain"){if(n.years!==1)throw new Error("For now, names can only be registered for 1 year at a time");let S=n.years*31536e3;return await A({aptosConfig:o,sender:d.accountAddress.toString(),data:{function:`${N}::router::register_domain`,functionArguments:[new p(T),new m(S),new c(t?s.from(t):null),new c(a?s.from(a):null)]},options:i})}throw new Error(`Policy ${n.policy} is not supported yet`)}export{g as a,w as b,y as c,L as d,h as e,U as f,k as g};
|
|
2
|
-
//# sourceMappingURL=chunk-FHJ7F7Z6.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l,c as h}from"./chunk-BIUGRAMO.mjs";import{a as g,c as p}from"./chunk-E72CFUU4.mjs";import{b as y}from"./chunk-IZHPCZE3.mjs";var o=class extends g{constructor(e){super();let{publicKeys:t,threshold:r}=e;if(t.length>o.MAX_KEYS||t.length<o.MIN_KEYS)throw new Error(`Must have between ${o.MIN_KEYS} and ${o.MAX_KEYS} public keys, inclusive`);if(r<o.MIN_THRESHOLD||r>t.length)throw new Error(`Threshold must be between ${o.MIN_THRESHOLD} and ${t.length}, inclusive`);this.publicKeys=t,this.threshold=r}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*l.LENGTH+1);return this.publicKeys.forEach((t,r)=>{e.set(t.toUint8Array(),r*l.LENGTH)}),e[this.publicKeys.length*l.LENGTH]=this.threshold,e}toString(){return y.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("TODO - Method not implemented.")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes(),r=t[t.length-1],a=[];for(let n=0;n<t.length-1;n+=l.LENGTH){let i=n;a.push(new l(t.subarray(i,i+l.LENGTH)))}return new o({publicKeys:a,threshold:r})}},u=o;u.MAX_KEYS=32,u.MIN_KEYS=2,u.MIN_THRESHOLD=1;var s=class extends p{constructor(e){super();let{signatures:t,bitmap:r}=e;if(r.length!==s.BITMAP_LEN)throw new Error(`"bitmap" length should be ${s.BITMAP_LEN}`);if(t.length>s.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${s.MAX_SIGNATURES_SUPPORTED}`);this.signatures=t,this.bitmap=r}toUint8Array(){let e=new Uint8Array(this.signatures.length*h.LENGTH+s.BITMAP_LEN);return this.signatures.forEach((t,r)=>{e.set(t.toUint8Array(),r*h.LENGTH)}),e.set(this.bitmap,this.signatures.length*h.LENGTH),e}toString(){return y.fromHexInput(this.toUint8Array()).toString()}static createBitmap(e){let{bits:t}=e,r=128,a=new Uint8Array([0,0,0,0]),n=new Set;return t.forEach(i=>{if(i>=s.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${s.MAX_SIGNATURES_SUPPORTED-1}.`);if(n.has(i))throw new Error("Duplicate bits detected.");n.add(i);let E=Math.floor(i/8),b=a[E];b|=r>>i%8,a[E]=b}),a}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes(),r=t.subarray(t.length-4),a=[];for(let n=0;n<t.length-r.length;n+=h.LENGTH){let i=n;a.push(new h(t.subarray(i,i+h.LENGTH)))}return new s({signatures:a,bitmap:r})}},c=s;c.MAX_SIGNATURES_SUPPORTED=32,c.BITMAP_LEN=4;export{u as a,c as b};
|
|
2
|
-
//# sourceMappingURL=chunk-FNB6CFQR.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Network } from \"../utils/apiEndpoints\";\n\nexport * from \"./indexer\";\n\nexport enum MimeType {\n /**\n * JSON representation, used for transaction submission and accept type JSON output\n */\n JSON = \"application/json\",\n /**\n * BCS representation, used for accept type BCS output\n */\n BCS = \"application/x-bcs\",\n /**\n * BCS representation, used for transaction submission in BCS input\n */\n BCS_SIGNED_TRANSACTION = \"application/x.aptos.signed_transaction+bcs\",\n}\n\n/**\n * Hex data as input to a function\n */\nexport type HexInput = string | Uint8Array;\n\n/**\n * TypeTag enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}\n */\nexport enum TypeTagVariants {\n Bool = 0,\n U8 = 1,\n U64 = 2,\n U128 = 3,\n Address = 4,\n Signer = 5,\n Vector = 6,\n Struct = 7,\n U16 = 8,\n U32 = 9,\n U256 = 10,\n Reference = 254, // This is specifically a placeholder and does not represent a real type\n Generic = 255, // This is specifically a placeholder and does not represent a real type\n}\n\n/**\n * Script transaction arguments enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}\n */\nexport enum ScriptTransactionArgumentVariants {\n U8 = 0,\n U64 = 1,\n U128 = 2,\n Address = 3,\n U8Vector = 4,\n Bool = 5,\n U16 = 6,\n U32 = 7,\n U256 = 8,\n}\n\n/**\n * Transaction payload enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}\n */\nexport enum TransactionPayloadVariants {\n Script = 0,\n EntryFunction = 2,\n Multisig = 3,\n}\n\n/**\n * Transaction variants enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}\n */\nexport enum TransactionVariants {\n MultiAgentTransaction = 0,\n FeePayerTransaction = 1,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}\n */\nexport enum TransactionAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n MultiAgent = 2,\n FeePayer = 3,\n SingleSender = 4,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}\n */\nexport enum AccountAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n SingleKey = 2,\n MultiKey = 3,\n}\n\nexport enum AnyPublicKeyVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n}\n\nexport enum AnySignatureVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n}\n\n/**\n * BCS types\n */\nexport type Uint8 = number;\nexport type Uint16 = number;\nexport type Uint32 = number;\nexport type Uint64 = bigint;\nexport type Uint128 = bigint;\nexport type Uint256 = bigint;\nexport type AnyNumber = number | bigint;\n\n/**\n * Set of configuration options that can be provided when initializing the SDK.\n * The purpose of these options is to configure various aspects of the SDK's\n * behavior and interaction with the Aptos network\n */\nexport type AptosSettings = {\n readonly network?: Network;\n\n readonly fullnode?: string;\n\n readonly faucet?: string;\n\n readonly indexer?: string;\n\n readonly clientConfig?: ClientConfig;\n\n readonly client?: Client;\n};\n\n/**\n *\n * Controls the number of results that are returned and the starting position of those results.\n * @param offset parameter specifies the starting position of the query result within the set of data. Default is 0.\n * @param limit specifies the maximum number of items or records to return in a query result. Default is 25.\n */\nexport interface PaginationArgs {\n offset?: AnyNumber;\n limit?: number;\n}\n\n/**\n * QUERY TYPES\n */\n\n/**\n * A configuration object we can pass with the request to the server.\n *\n * @param AUTH_TOKEN - an auth token to send with a faucet request\n * @param API_KEY - api key generated from developer portal {@link https://developers.aptoslabs.com/manage/api-keys}}\n * @param HEADERS - extra headers we want to send with the request\n * @param WITH_CREDENTIALS - whether to carry cookies. By default, it is set to true and cookies will be sent\n */\nexport type ClientConfig = {\n AUTH_TOKEN?: string;\n API_KEY?: string;\n HEADERS?: Record<string, string | number | boolean>;\n WITH_CREDENTIALS?: boolean;\n};\n\nexport interface ClientRequest<Req> {\n url: string;\n method: \"GET\" | \"POST\";\n body?: Req;\n contentType?: string;\n params?: any;\n overrides?: ClientConfig;\n headers?: Record<string, any>;\n}\n\nexport interface ClientResponse<Res> {\n status: number;\n statusText: string;\n data: Res;\n config?: any;\n request?: any;\n response?: any;\n headers?: any;\n}\n\nexport interface Client {\n provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;\n}\n\n/**\n * The API request type\n *\n * @param url - the url to make the request to, i.e https://fullnode.aptoslabs.devnet.com/v1\n * @param method - the request method \"GET\" | \"POST\"\n * @param endpoint (optional) - the endpoint to make the request to, i.e transactions\n * @param body (optional) - the body of the request\n * @param contentType (optional) - the content type to set the `content-type` header to,\n * by default is set to `application/json`\n * @param params (optional) - query params to add to the request\n * @param originMethod (optional) - the local method the request came from\n * @param overrides (optional) - a `ClientConfig` object type to override request data\n */\nexport type AptosRequest = {\n url: string;\n method: \"GET\" | \"POST\";\n path?: string;\n body?: any;\n contentType?: string;\n acceptType?: string;\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n originMethod?: string;\n overrides?: ClientConfig;\n};\n\n/**\n * Specifies ledger version of transactions. By default latest version will be used\n */\nexport type LedgerVersion = {\n ledgerVersion?: AnyNumber;\n};\n\n/**\n * RESPONSE TYPES\n */\n\n/**\n * Type holding the outputs of the estimate gas API\n */\nexport type GasEstimation = {\n /**\n * The deprioritized estimate for the gas unit price\n */\n deprioritized_gas_estimate?: number;\n /**\n * The current estimate for the gas unit price\n */\n gas_estimate: number;\n /**\n * The prioritized estimate for the gas unit price\n */\n prioritized_gas_estimate?: number;\n};\n\nexport type MoveResource = {\n type: MoveStructType;\n data: {};\n};\n\nexport type AccountData = {\n sequence_number: string;\n authentication_key: string;\n};\n\nexport type MoveModuleBytecode = {\n bytecode: string;\n abi?: MoveModule;\n};\n\n/**\n * TRANSACTION TYPES\n */\n\nexport enum TransactionResponseType {\n Pending = \"pending_transaction\",\n User = \"user_transaction\",\n Genesis = \"genesis_transaction\",\n BlockMetadata = \"block_metadata_transaction\",\n StateCheckpoint = \"state_checkpoint_transaction\",\n}\n\nexport type TransactionResponse =\n | PendingTransactionResponse\n | UserTransactionResponse\n | GenesisTransactionResponse\n | BlockMetadataTransactionResponse\n | StateCheckpointTransactionResponse;\n\nexport type PendingTransactionResponse = {\n type: TransactionResponseType.Pending;\n hash: string;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n};\n\nexport type UserTransactionResponse = {\n type: TransactionResponseType.User;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n /**\n * Events generated by the transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\nexport type GenesisTransactionResponse = {\n type: TransactionResponseType.Genesis;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n payload: GenesisPayload;\n /**\n * Events emitted during genesis\n */\n events: Array<Event>;\n};\n\nexport type BlockMetadataTransactionResponse = {\n type: TransactionResponseType.BlockMetadata;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n id: string;\n epoch: string;\n round: string;\n /**\n * The events emitted at the block creation\n */\n events: Array<Event>;\n /**\n * Previous block votes\n */\n previous_block_votes_bitvec: Array<number>;\n proposer: string;\n /**\n * The indices of the proposers who failed to propose\n */\n failed_proposer_indices: Array<number>;\n timestamp: string;\n};\n\nexport type StateCheckpointTransactionResponse = {\n type: TransactionResponseType.StateCheckpoint;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n};\n\n/**\n * WRITESET CHANGE TYPES\n */\n\nexport type WriteSetChange =\n | WriteSetChangeDeleteModule\n | WriteSetChangeDeleteResource\n | WriteSetChangeDeleteTableItem\n | WriteSetChangeWriteModule\n | WriteSetChangeWriteResource\n | WriteSetChangeWriteTableItem;\n\nexport type WriteSetChangeDeleteModule = {\n type: string;\n address: string;\n /**\n * State key hash\n */\n state_key_hash: string;\n module: MoveModuleId;\n};\n\nexport type WriteSetChangeDeleteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n resource: string;\n};\n\nexport type WriteSetChangeDeleteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n data?: DeletedTableData;\n};\n\nexport type WriteSetChangeWriteModule = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveModuleBytecode;\n};\n\nexport type WriteSetChangeWriteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveResource;\n};\n\nexport type WriteSetChangeWriteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n value: string;\n data?: DecodedTableData;\n};\n\nexport type DecodedTableData = {\n /**\n * Key of table in JSON\n */\n key: any;\n /**\n * Type of key\n */\n key_type: string;\n /**\n * Value of table in JSON\n */\n value: any;\n /**\n * Type of value\n */\n value_type: string;\n};\n\n/**\n * Deleted table data\n */\nexport type DeletedTableData = {\n /**\n * Deleted key\n */\n key: any;\n /**\n * Deleted key type\n */\n key_type: string;\n};\n\nexport type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;\n\nexport type EntryFunctionPayloadResponse = {\n type: string;\n function: MoveStructType;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type ScriptPayloadResponse = {\n type: string;\n code: MoveScriptBytecode;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type MultisigPayloadResponse = {\n type: string;\n multisig_address: string;\n transaction_payload?: EntryFunctionPayloadResponse;\n};\n\nexport type GenesisPayload = {\n type: string;\n write_set: WriteSet;\n};\n\n/**\n * Move script bytecode\n */\nexport type MoveScriptBytecode = {\n bytecode: string;\n abi?: MoveFunction;\n};\n\n/**\n * These are the JSON representations of transaction signatures returned from the node API.\n */\nexport type TransactionSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature\n | TransactionMultiAgentSignature\n | TransactionFeePayerSignature;\n\nexport type TransactionEd25519Signature = {\n type: string;\n public_key: string;\n signature: \"ed25519_signature\";\n};\n\nexport type TransactionSecp256k1Signature = {\n type: string;\n public_key: string;\n signature: \"secp256k1_ecdsa_signature\";\n};\n\nexport type TransactionMultiEd25519Signature = {\n type: \"multi_ed25519_signature\";\n /**\n * The public keys for the Ed25519 signature\n */\n public_keys: Array<string>;\n /**\n * Signature associated with the public keys in the same order\n */\n signatures: Array<string>;\n /**\n * The number of signatures required for a successful transaction\n */\n threshold: number;\n bitmap: string;\n};\n\nexport type TransactionMultiAgentSignature = {\n type: \"multi_agent_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n};\n\nexport type TransactionFeePayerSignature = {\n type: \"fee_payer_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n fee_payer_address: string;\n fee_payer_signer: AccountSignature;\n};\n\n/**\n * The union of all single account signatures.\n */\nexport type AccountSignature = AccountEd25519Signature | AccountSecp256k1Signature | AccountMultiEd25519Signature;\n\nexport type AccountEd25519Signature = TransactionEd25519Signature;\n\nexport type AccountSecp256k1Signature = TransactionSecp256k1Signature;\n\nexport type AccountMultiEd25519Signature = TransactionMultiEd25519Signature;\n\nexport type WriteSet = ScriptWriteSet | DirectWriteSet;\n\nexport type ScriptWriteSet = {\n type: string;\n execute_as: string;\n script: ScriptPayloadResponse;\n};\n\nexport type DirectWriteSet = {\n type: string;\n changes: Array<WriteSetChange>;\n events: Array<Event>;\n};\n\nexport type EventGuid = {\n creation_number: string;\n account_address: string;\n};\n\nexport type Event = {\n guid: EventGuid;\n sequence_number: string;\n type: string;\n /**\n * The JSON representation of the event\n */\n data: any;\n};\n\n/**\n * Map of Move types to local TypeScript types\n */\nexport type MoveUint8Type = number;\nexport type MoveUint16Type = number;\nexport type MoveUint32Type = number;\nexport type MoveUint64Type = string;\nexport type MoveUint128Type = string;\nexport type MoveUint256Type = string;\nexport type MoveAddressType = string;\nexport type MoveObjectType = string;\nexport type MoveOptionType = MoveType | null | undefined;\n/**\n * This is the format for a fully qualified struct, resource, or entry function in Move.\n */\nexport type MoveStructType = `${string}::${string}::${string}`;\n\nexport type MoveType =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | Array<MoveType>;\n\n/**\n * Possible Move values acceptable by move functions (entry, view)\n *\n * Map of a Move value to the corresponding TypeScript value\n *\n * `Bool -> boolean`\n *\n * `u8, u16, u32 -> number`\n *\n * `u64, u128, u256 -> string`\n *\n * `String -> string`\n *\n * `Address -> 0x${string}`\n *\n * `Struct - 0x${string}::${string}::${string}`\n *\n * `Object -> 0x${string}`\n *\n * `Vector -> Array<MoveValue>`\n *\n * `Option -> MoveValue | null | undefined`\n */\nexport type MoveValue =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | MoveOptionType\n | Array<MoveValue>;\n\n/**\n * Move module id is a string representation of Move module.\n * Module name is case-sensitive.\n */\nexport type MoveModuleId = `${string}::${string}`;\n\n/**\n * Move function visibility\n */\nexport enum MoveFunctionVisibility {\n PRIVATE = \"private\",\n PUBLIC = \"public\",\n FRIEND = \"friend\",\n}\n\n/**\n * Move function ability\n */\nexport enum MoveAbility {\n STORE = \"store\",\n DROP = \"drop\",\n KEY = \"key\",\n COPY = \"copy\",\n}\n\n/**\n * Move abilities tied to the generic type param and associated with the function that uses it\n */\nexport type MoveFunctionGenericTypeParam = {\n constraints: Array<MoveAbility>;\n};\n\n/**\n * Move struct field\n */\nexport type MoveStructField = {\n name: string;\n type: string;\n};\n\n/**\n * A Move module\n */\nexport type MoveModule = {\n address: string;\n name: string;\n /**\n * Friends of the module\n */\n friends: Array<MoveModuleId>;\n /**\n * Public functions of the module\n */\n exposed_functions: Array<MoveFunction>;\n /**\n * Structs of the module\n */\n structs: Array<MoveStruct>;\n};\n\n/**\n * A move struct\n */\nexport type MoveStruct = {\n name: string;\n /**\n * Whether the struct is a native struct of Move\n */\n is_native: boolean;\n /**\n * Abilities associated with the struct\n */\n abilities: Array<MoveAbility>;\n /**\n * Generic types associated with the struct\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Fields associated with the struct\n */\n fields: Array<MoveStructField>;\n};\n\n/**\n * Move function\n */\nexport type MoveFunction = {\n name: string;\n visibility: MoveFunctionVisibility;\n /**\n * Whether the function can be called as an entry function directly in a transaction\n */\n is_entry: boolean;\n /**\n * Whether the function is a view function or not\n */\n is_view: boolean;\n /**\n * Generic type params associated with the Move function\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Parameters associated with the move function\n */\n params: Array<string>;\n /**\n * Return type of the function\n */\n return: Array<string>;\n};\n\nexport enum RoleType {\n VALIDATOR = \"validator\",\n FULL_NODE = \"full_node\",\n}\n\nexport type LedgerInfo = {\n /**\n * Chain ID of the current chain\n */\n chain_id: number;\n epoch: string;\n ledger_version: string;\n oldest_ledger_version: string;\n ledger_timestamp: string;\n node_role: RoleType;\n oldest_block_height: string;\n block_height: string;\n /**\n * Git hash of the build of the API endpoint. Can be used to determine the exact\n * software version used by the API endpoint.\n */\n git_hash?: string;\n};\n\n/**\n * A Block type\n */\nexport type Block = {\n block_height: string;\n block_hash: string;\n block_timestamp: string;\n first_version: string;\n last_version: string;\n /**\n * The transactions in the block in sequential order\n */\n transactions?: Array<TransactionResponse>;\n};\n\n/**\n * The data needed to generate a View Request payload\n */\nexport type ViewRequestData = {\n function: MoveStructType;\n typeArguments?: Array<MoveStructType>;\n functionArguments?: Array<MoveValue>;\n};\n\n// REQUEST TYPES\n\n/**\n * View request for the Move view function API\n *\n * `type MoveStructType = ${string}::${string}::${string}`;\n */\nexport type ViewRequest = {\n function: MoveStructType;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<MoveStructType>;\n /**\n * Arguments of the function\n */\n functionArguments: Array<MoveValue>;\n};\n\n/**\n * Table Item request for the GetTableItem API\n */\nexport type TableItemRequest = {\n key_type: MoveValue;\n value_type: MoveValue;\n /**\n * The value of the table item's key\n */\n key: any;\n};\n\n/**\n * A list of Authentication Key schemes that are supported by Aptos.\n *\n * They are combinations of signing schemes and derive schemes.\n */\nexport type AuthenticationKeyScheme = SigningScheme | DeriveScheme;\n\nexport enum SigningScheme {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For MultiEd25519PublicKey\n */\n MultiEd25519 = 1,\n /**\n * For SingleKey ecdsa\n */\n SingleKey = 2,\n\n MultiKey = 3,\n}\n\nexport enum SigningSchemeInput {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For Secp256k1Ecdsa\n */\n Secp256k1Ecdsa = 2,\n}\n\n/**\n * Scheme used for deriving account addresses from other data\n */\nexport enum DeriveScheme {\n /**\n * Derives an address using an AUID, used for objects\n */\n DeriveAuid = 251,\n /**\n * Derives an address from another object address\n */\n DeriveObjectAddressFromObject = 252,\n /**\n * Derives an address from a GUID, used for objects\n */\n DeriveObjectAddressFromGuid = 253,\n /**\n * Derives an address from seed bytes, used for named objects\n */\n DeriveObjectAddressFromSeed = 254,\n /**\n * Derives an address from seed bytes, used for resource accounts\n */\n DeriveResourceAccountAddress = 255,\n}\n\n/**\n * Option properties to pass for waitForTransaction() function\n */\nexport type WaitForTransactionOptions = {\n timeoutSecs?: number;\n checkSuccess?: boolean;\n indexerVersionCheck?: boolean;\n};\n\n/**\n * Input type to generate an account using Single Signer\n * Ed25519 or Legacy Ed25519\n */\nexport type GenerateAccountWithEd25519 = {\n scheme: SigningSchemeInput.Ed25519;\n legacy: boolean;\n};\n\n/**\n * Input type to generate an account using Single Signer\n * Secp256k1\n */\nexport type GenerateAccountWithSingleSignerSecp256k1Key = {\n scheme: SigningSchemeInput.Secp256k1Ecdsa;\n legacy?: false;\n};\n\nexport type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;\n"],"mappings":"AAOO,IAAKA,OAIVA,EAAA,KAAO,mBAIPA,EAAA,IAAM,oBAINA,EAAA,uBAAyB,6CAZ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cAAgB,6BAChBA,EAAA,gBAAkB,+BALRA,OAAA,IA+dAC,OACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,OAAS,SAHCA,OAAA,IASAC,OACVA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,KAAO,OAJGA,OAAA,IA6FAC,OACVA,EAAA,UAAY,YACZA,EAAA,UAAY,YAFFA,OAAA,IAsFAC,OAIVA,IAAA,QAAU,GAAV,UAIAA,IAAA,aAAe,GAAf,eAIAA,IAAA,UAAY,GAAZ,YAEAA,IAAA,SAAW,GAAX,WAdUA,OAAA,IAiBAC,OAIVA,IAAA,QAAU,GAAV,UAIAA,IAAA,eAAiB,GAAjB,iBARUA,OAAA,IAcAC,OAIVA,IAAA,WAAa,KAAb,aAIAA,IAAA,8BAAgC,KAAhC,gCAIAA,IAAA,4BAA8B,KAA9B,8BAIAA,IAAA,4BAA8B,KAA9B,8BAIAA,IAAA,6BAA+B,KAA/B,+BApBUA,OAAA","names":["MimeType","TypeTagVariants","ScriptTransactionArgumentVariants","TransactionPayloadVariants","TransactionVariants","TransactionAuthenticatorVariant","AccountAuthenticatorVariant","AnyPublicKeyVariant","AnySignatureVariant","TransactionResponseType","MoveFunctionVisibility","MoveAbility","RoleType","SigningScheme","SigningSchemeInput","DeriveScheme"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-27P7PELS.mjs";import{a as s}from"./chunk-FBPNHF54.mjs";import{bytesToHex as d,hexToBytes as h}from"@noble/hashes/utils";var g=(a=>(a.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",a.INVALID_HEX_CHARS="invalid_hex_chars",a.TOO_SHORT="too_short",a.TOO_LONG="too_long",a.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",a.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",a.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",a))(g||{}),t=class extends o{constructor(e){super();if(e.length!==t.LENGTH)throw new s("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=d(this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return d(this.data)}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let r=e.deserializeFixedBytes(t.LENGTH);return new t(r)}static fromString(e){if(!e.startsWith("0x"))throw new s("Hex string must start with a leading 0x.","leading_zero_x_required");let r=t.fromStringRelaxed(e);if(e.length!==t.LONG_STRING_LENGTH+2)if(r.isSpecial()){if(e.length!==3)throw new s(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new s(`The given hex string ${r} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return r}static fromStringRelaxed(e){let r=e;if(e.startsWith("0x")&&(r=e.slice(2)),r.length===0)throw new s("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(r.length>64)throw new s("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let n;try{n=h(r.padStart(64,"0"))}catch(l){let c=l;throw new s(`Hex characters are invalid: ${c.message}`,"invalid_hex_chars")}return new t(n)}static fromRelaxed(e){return e instanceof t?e:e instanceof Uint8Array?new t(e):t.fromStringRelaxed(e)}static from(e){return e instanceof t?e:e instanceof Uint8Array?new t(e):t.fromString(e)}static isValid(e){try{return e.relaxed?t.fromRelaxed(e.input):t.from(e.input),{valid:!0}}catch(r){let n=r;return{valid:!1,invalidReason:n.invalidReason,invalidReasonMessage:n.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((r,n)=>r===e.data[n])}},i=t;i.LENGTH=32,i.LONG_STRING_LENGTH=64,i.ZERO=t.from("0x0"),i.ONE=t.from("0x1"),i.TWO=t.from("0x2"),i.THREE=t.from("0x3"),i.FOUR=t.from("0x4");export{g as a,i as b};
|
|
2
|
-
//# sourceMappingURL=chunk-HH5RSP2H.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as i}from"./chunk-BIUGRAMO.mjs";import{c as t}from"./chunk-YS2OX7AB.mjs";import{c as s}from"./chunk-E72CFUU4.mjs";var e=class extends s{constructor(r){super();this.signature=r}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(r){if(this.signature instanceof i)r.serializeU32AsUleb128(0),this.signature.serialize(r);else if(this.signature instanceof t)r.serializeU32AsUleb128(1),this.signature.serialize(r);else throw new Error("Unknown signature type")}static deserialize(r){let n=r.deserializeUleb128AsU32();switch(n){case 0:return new e(i.load(r));case 1:return new e(t.load(r));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};export{e as a};
|
|
2
|
-
//# sourceMappingURL=chunk-IPJKGHQY.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-FBPNHF54.mjs";import{bytesToHex as s,hexToBytes as o}from"@noble/hashes/utils";var l=(e=>(e.TOO_SHORT="too_short",e.INVALID_LENGTH="invalid_length",e.INVALID_HEX_CHARS="invalid_hex_chars",e))(l||{}),n=class{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return s(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromString(t){let r=t;if(r.startsWith("0x")&&(r=r.slice(2)),r.length===0)throw new a("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(r.length%2!==0)throw new a("Hex string must be an even number of hex characters.","invalid_length");try{return new n(o(r))}catch(e){let i=e;throw new a(`Hex string contains invalid hex characters: ${i.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new n(t):n.fromString(t)}static isValid(t){try{return n.fromString(t),{valid:!0}}catch(r){let e=r;return{valid:!1,invalidReason:e.invalidReason,invalidReasonMessage:e.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((r,e)=>r===t.data[e])}};export{l as a,n as b};
|
|
2
|
-
//# sourceMappingURL=chunk-IZHPCZE3.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk-ZXJ5ZBTL.mjs";import{a as K}from"./chunk-FNB6CFQR.mjs";import{a as c}from"./chunk-UVGCVCNG.mjs";import{a as p,b as o}from"./chunk-BIUGRAMO.mjs";import{a as d,b as y}from"./chunk-YS2OX7AB.mjs";import{b as l}from"./chunk-IZHPCZE3.mjs";var s=class{constructor(t){let{privateKey:e,address:i,legacy:r}=t,n=r??!0;if(this.publicKey=e.publicKey(),this.publicKey instanceof p)n?this.signingScheme=0:(this.publicKey=new c(this.publicKey),this.signingScheme=2);else if(this.publicKey instanceof K)this.signingScheme=1;else if(this.publicKey instanceof d)this.publicKey=new c(this.publicKey),this.signingScheme=2;else throw new Error("Can not create new Account, unsupported public key type");this.privateKey=e,this.accountAddress=i}static generate(t){let e=t?.legacy??!0,i,r;switch(t?.scheme){case 2:i=y.generate(),r=new c(i.publicKey());break;default:i=o.generate(),e===!1?r=new c(i.publicKey()):r=i.publicKey()}let a=u.fromPublicKey({publicKey:r}).derivedAddress();return new s({privateKey:i,address:a,legacy:t?.legacy})}static fromPrivateKey(t){let{privateKey:e,legacy:i}=t,r=i??!0,n;if(e instanceof y)n=new c(e.publicKey());else if(e instanceof o)r?n=e.publicKey():n=new c(e.publicKey());else throw new Error(`Unsupported private key ${e}`);let g=u.fromPublicKey({publicKey:n}).derivedAddress();return new s({privateKey:e,address:g,legacy:r})}static fromPrivateKeyAndAddress(t){let{privateKey:e,address:i,legacy:r}=t;return new s({privateKey:e,address:i,legacy:r})}static fromDerivationPath(t){let{path:e,mnemonic:i,scheme:r,legacy:n}=t,a;switch(r){case 2:a=y.fromDerivationPath(e,i);break;case 0:a=o.fromDerivationPath(e,i);break;default:throw new Error(`Unsupported scheme ${r}`)}return s.fromPrivateKey({privateKey:a,legacy:n})}static authKey(t){let{publicKey:e}=t;return u.fromPublicKey({publicKey:e})}sign(t){return this.privateKey.sign(t)}verifySignature(t){let{message:e,signature:i}=t,r=l.fromHexInput(e).toUint8Array();return this.publicKey.verifySignature({message:r,signature:i})}};export{s as a};
|
|
2
|
-
//# sourceMappingURL=chunk-J3QOSJFP.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-7TL2MY2B.mjs";import{c as r}from"./chunk-NKTKHC3Z.mjs";import{b as t}from"./chunk-HH5RSP2H.mjs";import{e as o}from"./chunk-PDLUCVJB.mjs";import{f as n}from"./chunk-KC64ESLO.mjs";async function O(i){let{aptosConfig:s,sender:c,recipient:a,amount:p,coinType:u,options:m}=i,f=u??n;return await e({aptosConfig:s,sender:c.accountAddress,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[r(f)],functionArguments:[t.from(a),new o(p)]},options:m})}export{O as a};
|
|
2
|
-
//# sourceMappingURL=chunk-J5OKXARS.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/internal/coin.ts"],"sourcesContent":["import { AptosConfig } from \"../api/aptosConfig\";\nimport { U64 } from \"../bcs/serializable/movePrimitives\";\nimport { Account, AccountAddress, AccountAddressInput } from \"../core\";\nimport { InputGenerateTransactionOptions, InputSingleSignerTransaction } from \"../transactions/types\";\nimport { AnyNumber, MoveStructType } from \"../types\";\nimport { APTOS_COIN } from \"../utils/const\";\nimport { generateTransaction } from \"./transactionSubmission\";\nimport { parseTypeTag } from \"../transactions/typeTag/parser\";\n\nexport async function transferCoinTransaction(args: {\n aptosConfig: AptosConfig;\n sender: Account;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n coinType?: MoveStructType;\n options?: InputGenerateTransactionOptions;\n}): Promise<InputSingleSignerTransaction> {\n const { aptosConfig, sender, recipient, amount, coinType, options } = args;\n const coinStructType = coinType ?? APTOS_COIN;\n const transaction = await generateTransaction({\n aptosConfig,\n sender: sender.accountAddress,\n data: {\n function: \"0x1::aptos_account::transfer_coins\",\n typeArguments: [parseTypeTag(coinStructType)],\n functionArguments: [AccountAddress.from(recipient), new U64(amount)],\n },\n options,\n });\n\n return transaction as InputSingleSignerTransaction;\n}\n"],"mappings":"6MASA,eAAsBA,EAAwBC,EAOJ,CACxC,GAAM,CAAE,YAAAC,EAAa,OAAAC,EAAQ,UAAAC,EAAW,OAAAC,EAAQ,SAAAC,EAAU,QAAAC,CAAQ,EAAIN,EAChEO,EAAiBF,GAAYG,EAYnC,OAXoB,MAAMC,EAAoB,CAC5C,YAAAR,EACA,OAAQC,EAAO,eACf,KAAM,CACJ,SAAU,qCACV,cAAe,CAACQ,EAAaH,CAAc,CAAC,EAC5C,kBAAmB,CAACI,EAAe,KAAKR,CAAS,EAAG,IAAIS,EAAIR,CAAM,CAAC,CACrE,EACA,QAAAE,CACF,CAAC,CAGH","names":["transferCoinTransaction","args","aptosConfig","sender","recipient","amount","coinType","options","coinStructType","APTOS_COIN","generateTransaction","parseTypeTag","AccountAddress","U64"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as c}from"./chunk-IPJKGHQY.mjs";import{a as d,b as p}from"./chunk-FNB6CFQR.mjs";import{a as z}from"./chunk-CZZJAR3B.mjs";import{a as g}from"./chunk-UVGCVCNG.mjs";import{a as y,c as b}from"./chunk-BIUGRAMO.mjs";import{a as o}from"./chunk-27P7PELS.mjs";var s=class extends o{static deserialize(r){let e=r.deserializeUleb128AsU32();switch(e){case 0:return a.load(r);case 1:return l.load(r);case 2:return u.load(r);case 3:return n.load(r);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}},a=class extends s{constructor(e,i){super();this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=y.deserialize(e),t=b.deserialize(e);return new a(i,t)}},l=class extends s{constructor(e,i){super();this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=d.deserialize(e),t=p.deserialize(e);return new l(i,t)}},u=class extends s{constructor(e,i){super();this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=g.deserialize(e),t=c.deserialize(e);return new u(i,t)}},n=class extends s{constructor(e,i,t){super();this.public_keys=e,this.signatures=i,this.signatures_bitmap=t}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),e.serializeVector(this.signatures),e.serializeBytes(this.signatures_bitmap)}static load(e){let i=z.deserialize(e),t=e.deserializeVector(c),S=e.deserializeBytes();return new n(i,t,S)}};export{s as a,a as b,l as c,u as d,n as e};
|
|
2
|
-
//# sourceMappingURL=chunk-JTGGMXB7.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-SJLO3JIH.mjs";import{a as g}from"./chunk-DNYVUM3K.mjs";import{a as l}from"./chunk-KYWYIK5P.mjs";import{a as m}from"./chunk-IXMH6AXJ.mjs";import{a as p}from"./chunk-KPESAXVI.mjs";import{a as h}from"./chunk-3YOV42H5.mjs";import{a as s}from"./chunk-TYHBYRUA.mjs";import{a as u}from"./chunk-Z56AKXJ7.mjs";import{a as A}from"./chunk-N6XWY4UT.mjs";import{a as r}from"./chunk-XFSL7O6Q.mjs";import{a}from"./chunk-VAGYTPSI.mjs";import{a as c}from"./chunk-WNEZCERQ.mjs";var n=class{constructor(i){this.config=new A(i),this.account=new s(this.config),this.ans=new u(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new f(this.config),this.fungibleAsset=new g(this.config),this.general=new l(this.config),this.staking=new m(this.config),this.transaction=new p(this.config),this.transactionSubmission=new h(this.config)}};function t(y,i,d){Object.getOwnPropertyNames(i.prototype).forEach(o=>{let e=Object.getOwnPropertyDescriptor(i.prototype,o);!e||(e.value=function(...b){return this[d][o](...b)},Object.defineProperty(y.prototype,o,e))})}t(n,s,"account");t(n,u,"ans");t(n,r,"coin");t(n,a,"digitalAsset");t(n,c,"event");t(n,f,"faucet");t(n,g,"fungibleAsset");t(n,l,"general");t(n,m,"staking");t(n,p,"transaction");t(n,h,"transactionSubmission");export{n as a};
|
|
2
|
-
//# sourceMappingURL=chunk-KJDY66XF.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-ADR4XQPR.mjs";import{a as n}from"./chunk-WGXAIQ7K.mjs";import{a as i}from"./chunk-27P7PELS.mjs";var r=class extends i{constructor(t,a){super();this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=n.deserialize(t),o=e.deserialize(t);return new r(a,o)}};export{r as a};
|
|
2
|
-
//# sourceMappingURL=chunk-KNLMUSIO.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-LAXIJRYU.mjs";import{b as s}from"./chunk-HH5RSP2H.mjs";import{a as o}from"./chunk-27P7PELS.mjs";var i=class extends o{constructor(e,r){super();this.address=e,this.name=r}static fromStr(e){let r=e.split("::");if(r.length!==2)throw new Error("Invalid module id.");return new i(s.fromStringRelaxed(r[0]),new t(r[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let r=s.deserialize(e),d=t.deserialize(e);return new i(r,d)}};export{i as a};
|
|
2
|
-
//# sourceMappingURL=chunk-KWJ6XKNF.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/general.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getBlockByHeight,\n getBlockByVersion,\n getChainTopUserTransactions,\n getIndexerLastSuccessVersion,\n getLedgerInfo,\n getTableItem,\n queryIndexer,\n view,\n} from \"../internal/general\";\nimport {\n AnyNumber,\n Block,\n GetChainTopUserTransactionsResponse,\n GraphqlQuery,\n LedgerInfo,\n LedgerVersion,\n MoveValue,\n TableItemRequest,\n ViewRequestData,\n} from \"../types\";\n\n/**\n * A class to query all `General` Aptos related queries\n */\nexport class General {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries for the Aptos ledger info\n *\n * @returns Aptos Ledger Info\n *\n * @example An example of the returned data\n * ```\n * {\n * \"chain_id\": 4,\n * \"epoch\": \"8\",\n * \"ledger_version\": \"714\",\n * \"oldest_ledger_version\": \"0\",\n * \"ledger_timestamp\": \"1694695496521775\",\n * \"node_role\": \"validator\",\n * \"oldest_block_height\": \"0\",\n * \"block_height\": \"359\",\n * \"git_hash\": \"c82193f36f4e185fed9f68c4ad21f6c6dd390c6e\"\n * }\n * ```\n */\n async getLedgerInfo(): Promise<LedgerInfo> {\n return getLedgerInfo({ aptosConfig: this.config });\n }\n\n /**\n * Queries for the chain id\n *\n * @returns The chain id\n */\n async getChainId(): Promise<number> {\n const result = await this.getLedgerInfo();\n return result.chain_id;\n }\n\n /**\n * Queries for block by transaction version\n *\n * @param args.ledgerVersion Ledger version to lookup block information for\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block information with optional transactions\n */\n async getBlockByVersion(args: {\n ledgerVersion: AnyNumber;\n options?: { withTransactions?: boolean };\n }): Promise<Block> {\n return getBlockByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Get block by block height\n *\n * @param args.blockHeight Block height to lookup. Starts at 0\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block with optional transactions\n */\n async getBlockByHeight(args: { blockHeight: AnyNumber; options?: { withTransactions?: boolean } }): Promise<Block> {\n return getBlockByHeight({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a table item for a table identified by the handle and the key for the item.\n * Key and value types need to be passed in to help with key serialization and value deserialization.\n * @param args.handle A pointer to where that table is stored\n * @param args.data Object that describes table item\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @example https://fullnode.devnet.aptoslabs.com/v1/accounts/0x1/resource/0x1::coin::CoinInfo%3C0x1::aptos_coin::AptosCoin%3E\n * {\n * data.key_type = \"address\" // Move type of table key\n * data.value_type = \"u128\" // Move type of table value\n * data.key = \"0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935\" // Value of table key\n * }\n *\n * @returns Table item value rendered in JSON\n */\n async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: LedgerVersion }): Promise<T> {\n return getTableItem<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a Move view function\n * @param args.payload Payload for the view function\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n * @example\n * `\n * const payload: ViewRequest = {\n * function: \"0x1::coin::balance\",\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * functionArguments: [accountAddress],\n * };\n * `\n *\n * @returns an array of Move values\n */\n async view(args: { payload: ViewRequestData; options?: LedgerVersion }): Promise<Array<MoveValue>> {\n return view({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries top user transactions\n *\n * @param args.limit The number of transactions to return\n * @returns GetChainTopUserTransactionsResponse\n */\n async getChainTopUserTransactions(args: { limit: number }): Promise<GetChainTopUserTransactionsResponse> {\n return getChainTopUserTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * A generic function for retrieving data from Aptos Indexer.\n * For more detailed queries specification see\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://indexer.mainnet.aptoslabs.com/v1/graphql}\n *\n * @param args.query.query A GraphQL query\n * @param args.query.variables The variables for the query\n * @example\n * ```\n * {\n * query: `query MyQuery {\n ledger_infos {\n chain_id\n }\n }`;\n * }\n * ```\n *\n * @return The provided T type\n */\n async queryIndexer<T>(args: { query: GraphqlQuery }): Promise<T> {\n return queryIndexer<T>({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for the last successful indexer version\n *\n * This is useful to tell what ledger version the indexer is updated to, as it can be behind the full nodes.\n */\n async getIndexerLastSuccessVersion(): Promise<number> {\n return getIndexerLastSuccessVersion({ aptosConfig: this.config });\n }\n}\n"],"mappings":"0FA6BO,IAAMA,EAAN,KAAc,CAGnB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAsBA,MAAM,eAAqC,CACzC,OAAOC,EAAc,CAAE,YAAa,KAAK,MAAO,CAAC,CACnD,CAOA,MAAM,YAA8B,CAElC,OADe,MAAM,KAAK,cAAc,GAC1B,QAChB,CAUA,MAAM,kBAAkBC,EAGL,CACjB,OAAOC,EAAkB,CACvB,YAAa,KAAK,OAClB,GAAGD,CACL,CAAC,CACH,CAUA,MAAM,iBAAiBA,EAA4F,CACjH,OAAOE,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CAC/D,CAkBA,MAAM,aAAgBA,EAAuF,CAC3G,OAAOG,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CAC9D,CAiBA,MAAM,KAAKA,EAAwF,CACjG,OAAOI,EAAK,CAAE,YAAa,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CACnD,CAQA,MAAM,4BAA4BA,EAAuE,CACvG,OAAOK,EAA4B,CACjC,YAAa,KAAK,OAClB,GAAGL,CACL,CAAC,CACH,CAsBA,MAAM,aAAgBA,EAA2C,CAC/D,OAAOM,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGN,CACL,CAAC,CACH,CAOA,MAAM,8BAAgD,CACpD,OAAOO,EAA6B,CAAE,YAAa,KAAK,MAAO,CAAC,CAClE,CACF","names":["General","config","getLedgerInfo","args","getBlockByVersion","getBlockByHeight","getTableItem","view","getChainTopUserTransactions","queryIndexer","getIndexerLastSuccessVersion"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-V6AAQLLJ.mjs";import{a as t}from"./chunk-27P7PELS.mjs";var i=class extends t{constructor(e){super();this.value=new r(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,l){let a=r.deserialize(e,l);return new i(a.value)}};export{i as a};
|
|
2
|
-
//# sourceMappingURL=chunk-LU6VS7PJ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/internal/general.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/general}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * general namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { getAptosFullNode, postAptosFullNode, postAptosIndexer } from \"../client\";\nimport {\n AnyNumber,\n Block,\n GetChainTopUserTransactionsResponse,\n GetProcessorStatusResponse,\n GraphqlQuery,\n LedgerInfo,\n LedgerVersion,\n MoveValue,\n TableItemRequest,\n ViewRequest,\n ViewRequestData,\n} from \"../types\";\nimport { GetChainTopUserTransactionsQuery, GetProcessorStatusQuery } from \"../types/generated/operations\";\nimport { GetChainTopUserTransactions, GetProcessorStatus } from \"../types/generated/queries\";\n\nexport async function getLedgerInfo(args: { aptosConfig: AptosConfig }): Promise<LedgerInfo> {\n const { aptosConfig } = args;\n const { data } = await getAptosFullNode<{}, LedgerInfo>({\n aptosConfig,\n originMethod: \"getLedgerInfo\",\n path: \"\",\n });\n return data;\n}\n\nexport async function getBlockByVersion(args: {\n aptosConfig: AptosConfig;\n ledgerVersion: AnyNumber;\n options?: { withTransactions?: boolean };\n}): Promise<Block> {\n const { aptosConfig, ledgerVersion, options } = args;\n const { data } = await getAptosFullNode<{}, Block>({\n aptosConfig,\n originMethod: \"getBlockByVersion\",\n path: `blocks/by_version/${ledgerVersion}`,\n params: { with_transactions: options?.withTransactions },\n });\n return data;\n}\n\nexport async function getBlockByHeight(args: {\n aptosConfig: AptosConfig;\n blockHeight: AnyNumber;\n options?: { withTransactions?: boolean };\n}): Promise<Block> {\n const { aptosConfig, blockHeight, options } = args;\n const { data } = await getAptosFullNode<{}, Block>({\n aptosConfig,\n originMethod: \"getBlockByHeight\",\n path: `blocks/by_height/${blockHeight}`,\n params: { with_transactions: options?.withTransactions },\n });\n return data;\n}\n\nexport async function getTableItem<T>(args: {\n aptosConfig: AptosConfig;\n handle: string;\n data: TableItemRequest;\n options?: LedgerVersion;\n}): Promise<T> {\n const { aptosConfig, handle, data, options } = args;\n const response = await postAptosFullNode<TableItemRequest, any>({\n aptosConfig,\n originMethod: \"getTableItem\",\n path: `tables/${handle}/item`,\n params: { ledger_version: options?.ledgerVersion },\n body: data,\n });\n return response.data as T;\n}\n\nexport async function view(args: {\n aptosConfig: AptosConfig;\n payload: ViewRequestData;\n options?: LedgerVersion;\n}): Promise<MoveValue[]> {\n const { aptosConfig, payload, options } = args;\n const { data } = await postAptosFullNode<ViewRequest, MoveValue[]>({\n aptosConfig,\n originMethod: \"view\",\n path: \"view\",\n params: { ledger_version: options?.ledgerVersion },\n body: {\n function: payload.function,\n type_arguments: payload.typeArguments ?? [],\n arguments: payload.functionArguments ?? [],\n },\n });\n return data;\n}\n\nexport async function getChainTopUserTransactions(args: {\n aptosConfig: AptosConfig;\n limit: number;\n}): Promise<GetChainTopUserTransactionsResponse> {\n const { aptosConfig, limit } = args;\n const graphqlQuery = {\n query: GetChainTopUserTransactions,\n variables: { limit },\n };\n\n const data = await queryIndexer<GetChainTopUserTransactionsQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getChainTopUserTransactions\",\n });\n\n return data.user_transactions;\n}\n\nexport async function queryIndexer<T>(args: {\n aptosConfig: AptosConfig;\n query: GraphqlQuery;\n originMethod?: string;\n}): Promise<T> {\n const { aptosConfig, query, originMethod } = args;\n const { data } = await postAptosIndexer<GraphqlQuery, T>({\n aptosConfig,\n originMethod: originMethod ?? \"queryIndexer\",\n path: \"\",\n body: query,\n overrides: { WITH_CREDENTIALS: false },\n });\n return data;\n}\n\nexport async function getProcessorStatuses(args: { aptosConfig: AptosConfig }): Promise<GetProcessorStatusResponse> {\n const { aptosConfig } = args;\n\n const graphqlQuery = {\n query: GetProcessorStatus,\n };\n\n const data = await queryIndexer<GetProcessorStatusQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getProcessorStatuses\",\n });\n\n return data.processor_status;\n}\n\nexport async function getIndexerLastSuccessVersion(args: { aptosConfig: AptosConfig }): Promise<number> {\n const response = await getProcessorStatuses({ aptosConfig: args.aptosConfig });\n return response[0].last_success_version;\n}\n"],"mappings":"yIA4BA,eAAsBA,EAAcC,EAAyD,CAC3F,GAAM,CAAE,YAAAC,CAAY,EAAID,EAClB,CAAE,KAAAE,CAAK,EAAI,MAAMC,EAAiC,CACtD,YAAAF,EACA,aAAc,gBACd,KAAM,EACR,CAAC,EACD,OAAOC,CACT,CAEA,eAAsBE,EAAkBJ,EAIrB,CACjB,GAAM,CAAE,YAAAC,EAAa,cAAAI,EAAe,QAAAC,CAAQ,EAAIN,EAC1C,CAAE,KAAAE,CAAK,EAAI,MAAMC,EAA4B,CACjD,YAAAF,EACA,aAAc,oBACd,KAAM,qBAAqBI,IAC3B,OAAQ,CAAE,kBAAmBC,GAAS,gBAAiB,CACzD,CAAC,EACD,OAAOJ,CACT,CAEA,eAAsBK,EAAiBP,EAIpB,CACjB,GAAM,CAAE,YAAAC,EAAa,YAAAO,EAAa,QAAAF,CAAQ,EAAIN,EACxC,CAAE,KAAAE,CAAK,EAAI,MAAMC,EAA4B,CACjD,YAAAF,EACA,aAAc,mBACd,KAAM,oBAAoBO,IAC1B,OAAQ,CAAE,kBAAmBF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gB,EAAsC,CACvD,YAAAf,EACA,MANmB,CACnB,MAAOqB,CACT,EAKE,aAAc,sBAChB,CAAC,GAEW,gBACd,CAEA,eAAsBC,EAA6BvB,EAAqD,CAEtG,OADiB,MAAMqB,EAAqB,CAAE,YAAarB,EAAK,WAAY,CAAC,GAC7D,GAAG,oBACrB","names":["getLedgerInfo","args","aptosConfig","data","getAptosFullNode","getBlockByVersion","ledgerVersion","options","getBlockByHeight","blockHeight","getTableItem","handle","postAptosFullNode","view","payload","getChainTopUserTransactions","limit","queryIndexer","GetChainTopUserTransactions","query","originMethod","postAptosIndexer","getProcessorStatuses","GetProcessorStatus","getIndexerLastSuccessVersion"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as w,c as f,d as x,e as v,f as A,g as U,h as P,i as C,j as l,k as E,l as b,m as I,n as M,o as N}from"./chunk-BREUBEPM.mjs";import{a as d}from"./chunk-LAXIJRYU.mjs";import{b as y}from"./chunk-HH5RSP2H.mjs";function V(e){return!!e.match(/^[_a-zA-Z0-9]+$/)}function W(e){return!!e.match(/\s/)}function $(e,n){let i=n;for(;i<e.length;i+=1){let c=e[i];if(!W(c))break}return i}var F=(t=>(t.InvalidTypeTag="unknown type",t.UnexpectedTypeArgumentClose="unexpected '>'",t.UnexpectedWhitespaceCharacter="unexpected whitespace character",t.UnexpectedComma="unexpected ','",t.TypeArgumentCountMismatch="type argument count doesn't match expected amount",t.MissingTypeArgumentClose="no matching '>' for '<'",t.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",t.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",t.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",t.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",t.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",t))(F||{}),r=class extends Error{constructor(n,i){super(`Failed to parse typeTag '${n}', ${i}`)}};function B(e,n){let i=n?.allowGenerics??!1,c=[],o=[],p=[],T=0,a="",u=1;for(;T<e.length;){let g=e[T];if(g==="<")c.push({savedExpectedTypes:u,savedStr:a,savedTypes:p}),a="",p=[],u=1;else if(g===">"){if(a!==""){let G=h(a,o,i);p.push(G)}let s=c.pop();if(s===void 0)throw new r(e,"unexpected '>'");if(u!==p.length)throw new r(e,"type argument count doesn't match expected amount");let{savedStr:t,savedTypes:m,savedExpectedTypes:_}=s;o=p,p=m,a=t,u=_}else if(g===","){if(a.length!==0){let s=h(a,o,i);o=[],p.push(s),a="",u+=1}}else if(W(g)){let s=!1;if(a.length!==0){let m=h(a,o,i);o=[],p.push(m),a="",s=!0}T=$(e,T);let t=e[T];if(T<e.length&&s&&t!==","&&t!==">")throw new r(e,"unexpected whitespace character");continue}else a+=g;T+=1}if(c.length>0)throw new r(e,"no matching '>' for '<'");switch(p.length){case 0:return h(a,o,i);case 1:if(a==="")return p[0];throw new r(e,"unexpected ','");default:throw new r(e,"unexpected whitespace character")}}function h(e,n,i){switch(e){case"&signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new E(new l);case"signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new l;case"bool":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new w;case"address":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new C;case"u8":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new f;case"u16":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new x;case"u32":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new v;case"u64":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new A;case"u128":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new U;case"u256":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new P;case"vector":if(n.length!==1)throw new r(e,"vector type expected to have exactly one type argument");return new I(n[0]);default:if(i&&e.match(/^T[0-9]+$/))return new b(Number(e.split("T")[1]));if(!e.match(/.*:.*/))throw new r(e,"unknown type");let c=e.split("::");if(c.length!==3)throw new r(e,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!V(c[1]))throw new r(e,"module name must only contain alphanumeric or '_' characters");if(!V(c[2]))throw new r(e,"struct name must only contain alphanumeric or '_' characters");return new M(new N(y.fromStringRelaxed(c[0]),new d(c[1]),new d(c[2]),n))}}export{F as a,r as b,B as c};
|
|
2
|
-
//# sourceMappingURL=chunk-NKTKHC3Z.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transactions/typeTag/parser.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n StructTag,\n TypeTag,\n TypeTagAddress,\n TypeTagBool,\n TypeTagGeneric,\n TypeTagReference,\n TypeTagSigner,\n TypeTagStruct,\n TypeTagU128,\n TypeTagU16,\n TypeTagU256,\n TypeTagU32,\n TypeTagU64,\n TypeTagU8,\n TypeTagVector,\n} from \".\";\nimport { AccountAddress } from \"../../core\";\nimport { Identifier } from \"../instances/identifier\";\n\nfunction isValidIdentifier(str: string) {\n return !!str.match(/^[_a-zA-Z0-9]+$/);\n}\n\nfunction isValidWhitespaceCharacter(char: string) {\n return !!char.match(/\\s/);\n}\n\nfunction consumeWhitespace(tagStr: string, pos: number) {\n let i = pos;\n for (; i < tagStr.length; i += 1) {\n const innerChar = tagStr[i];\n\n if (!isValidWhitespaceCharacter(innerChar)) {\n // If it's not colons, and it's an invalid character, we will stop here\n break;\n }\n }\n return i;\n}\n\ntype TypeTagState = {\n savedExpectedTypes: number;\n savedStr: string;\n savedTypes: Array<TypeTag>;\n};\n\nexport enum TypeTagParserErrorType {\n InvalidTypeTag = \"unknown type\",\n UnexpectedTypeArgumentClose = \"unexpected '>'\",\n UnexpectedWhitespaceCharacter = \"unexpected whitespace character\",\n UnexpectedComma = \"unexpected ','\",\n TypeArgumentCountMismatch = \"type argument count doesn't match expected amount\",\n MissingTypeArgumentClose = \"no matching '>' for '<'\",\n UnexpectedPrimitiveTypeArguments = \"primitive types not expected to have type arguments\",\n UnexpectedVectorTypeArgumentCount = \"vector type expected to have exactly one type argument\",\n UnexpectedStructFormat = \"unexpected struct format, must be of the form 0xaddress::module_name::struct_name\",\n InvalidModuleNameCharacter = \"module name must only contain alphanumeric or '_' characters\",\n InvalidStructNameCharacter = \"struct name must only contain alphanumeric or '_' characters\",\n}\n\nexport class TypeTagParserError extends Error {\n constructor(typeTagStr: string, invalidReason: TypeTagParserErrorType) {\n super(`Failed to parse typeTag '${typeTagStr}', ${invalidReason}`);\n }\n}\n\n/**\n * All types are made of a few parts they're either:\n * 1. A simple type e.g. u8\n * 2. A standalone struct e.g. 0x1::account::Account\n * 3. A nested struct e.g. 0x1::coin::Coin<0x1234::coin::MyCoin>\n *\n * There are a few more special cases that need to be handled, however.\n * 1. Multiple generics e.g 0x1::pair::Pair<u8, u16>\n * 2. Spacing in the generics e.g. 0x1::pair::Pair< u8 , u16>\n * 3. Nested generics of different depths e.g. 0x1::pair::Pair<0x1::coin::Coin<0x1234::coin::MyCoin>, u8>\n * 4. Generics for types in ABIs are filled in with placeholders e.g T1, T2, T3\n */\nexport function parseTypeTag(typeStr: string, options?: { allowGenerics?: boolean }) {\n const allowGenerics = options?.allowGenerics ?? false;\n\n const saved: Array<TypeTagState> = [];\n // This represents the internal types for a type tag e.g. '0x1::coin::Coin<innerTypes>'\n let innerTypes: Array<TypeTag> = [];\n // This represents the current parsed types in a comma list e.g. 'u8, u8'\n let curTypes: Array<TypeTag> = [];\n // This represents the current character index\n let cur: number = 0;\n // This represents the current working string as a type or struct name\n let currentStr: string = \"\";\n let expectedTypes: number = 1;\n\n // Iterate through each character, and handle the border conditions\n while (cur < typeStr.length) {\n const char = typeStr[cur];\n\n if (char === \"<\") {\n // Start of a type argument, push current state onto a stack\n saved.push({\n savedExpectedTypes: expectedTypes,\n savedStr: currentStr,\n savedTypes: curTypes,\n });\n\n // Clear current state\n currentStr = \"\";\n curTypes = [];\n expectedTypes = 1;\n } else if (char === \">\") {\n // Process last type, if there is no type string, then don't parse it\n if (currentStr !== \"\") {\n const newType = parseTypeTagInner(currentStr, innerTypes, allowGenerics);\n curTypes.push(newType);\n }\n\n // Pop off stack outer type, if there's nothing left, there were too many '>'\n const savedPop = saved.pop();\n if (savedPop === undefined) {\n throw new TypeTagParserError(typeStr, TypeTagParserErrorType.UnexpectedTypeArgumentClose);\n }\n\n // If the expected types don't match the number of commas, then we also fail\n if (expectedTypes !== curTypes.length) {\n throw new TypeTagParserError(typeStr, TypeTagParserErrorType.TypeArgumentCountMismatch);\n }\n\n // Add in the new created type, shifting the current types to the inner types\n const { savedStr, savedTypes, savedExpectedTypes } = savedPop;\n innerTypes = curTypes;\n curTypes = savedTypes;\n currentStr = savedStr;\n expectedTypes = savedExpectedTypes;\n } else if (char === \",\") {\n // Comma means we need to start parsing a new tag, push the previous one to the curTypes\n // Process last type, if there is no type string, then don't parse it\n if (currentStr.length !== 0) {\n const newType = parseTypeTagInner(currentStr, innerTypes, allowGenerics);\n\n // parse type tag and push it on the types\n innerTypes = [];\n curTypes.push(newType);\n currentStr = \"\";\n expectedTypes += 1;\n }\n } else if (isValidWhitespaceCharacter(char)) {\n // This means we should save what we have and everything else should skip until the next\n let parsedTypeTag = false;\n if (currentStr.length !== 0) {\n const newType = parseTypeTagInner(currentStr, innerTypes, allowGenerics);\n\n // parse type tag and push it on the types\n innerTypes = [];\n curTypes.push(newType);\n currentStr = \"\";\n parsedTypeTag = true;\n }\n\n // Skip ahead on any more whitespace\n cur = consumeWhitespace(typeStr, cur);\n\n // The next space MUST be a comma, or a closing > if there was something parsed before\n // e.g. `u8 u8` is invalid but `u8, u8` is valid\n const nextChar = typeStr[cur];\n if (cur < typeStr.length && parsedTypeTag && nextChar !== \",\" && nextChar !== \">\") {\n throw new TypeTagParserError(typeStr, TypeTagParserErrorType.UnexpectedWhitespaceCharacter);\n }\n\n // eslint-disable-next-line no-continue\n continue;\n } else {\n // Any other characters just append to the current string\n currentStr += char;\n }\n\n cur += 1;\n }\n\n // This prevents a missing '>' on type arguments\n if (saved.length > 0) {\n throw new TypeTagParserError(typeStr, TypeTagParserErrorType.MissingTypeArgumentClose);\n }\n\n // This prevents 'u8, u8' as an input\n switch (curTypes.length) {\n case 0:\n return parseTypeTagInner(currentStr, innerTypes, allowGenerics);\n case 1:\n if (currentStr === \"\") {\n return curTypes[0];\n }\n throw new TypeTagParserError(typeStr, TypeTagParserErrorType.UnexpectedComma);\n default:\n throw new TypeTagParserError(typeStr, TypeTagParserErrorType.UnexpectedWhitespaceCharacter);\n }\n}\n\n/**\n * Parses a type tag with internal types associated\n * @param str\n * @param types\n */\nfunction parseTypeTagInner(str: string, types: Array<TypeTag>, allowGenerics: boolean): TypeTag {\n // TODO: Parse references to any item not just signer\n switch (str) {\n case \"&signer\":\n if (types.length > 0) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedPrimitiveTypeArguments);\n }\n return new TypeTagReference(new TypeTagSigner());\n case \"signer\":\n if (types.length > 0) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedPrimitiveTypeArguments);\n }\n return new TypeTagSigner();\n case \"bool\":\n if (types.length > 0) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedPrimitiveTypeArguments);\n }\n return new TypeTagBool();\n case \"address\":\n if (types.length > 0) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedPrimitiveTypeArguments);\n }\n return new TypeTagAddress();\n case \"u8\":\n if (types.length > 0) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedPrimitiveTypeArguments);\n }\n return new TypeTagU8();\n case \"u16\":\n if (types.length > 0) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedPrimitiveTypeArguments);\n }\n return new TypeTagU16();\n case \"u32\":\n if (types.length > 0) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedPrimitiveTypeArguments);\n }\n return new TypeTagU32();\n case \"u64\":\n if (types.length > 0) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedPrimitiveTypeArguments);\n }\n return new TypeTagU64();\n case \"u128\":\n if (types.length > 0) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedPrimitiveTypeArguments);\n }\n return new TypeTagU128();\n case \"u256\":\n if (types.length > 0) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedPrimitiveTypeArguments);\n }\n return new TypeTagU256();\n case \"vector\":\n if (types.length !== 1) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedVectorTypeArgumentCount);\n }\n return new TypeTagVector(types[0]);\n default:\n if (allowGenerics && str.match(/^T[0-9]+$/)) {\n return new TypeTagGeneric(Number(str.split(\"T\")[1]));\n }\n\n // If the value doesn't contain a colon, then we'll assume it isn't trying to be a struct\n if (!str.match(/.*:.*/)) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.InvalidTypeTag);\n }\n\n // Parse for a struct tag\n // eslint-disable-next-line no-case-declarations\n const structParts = str.split(\"::\");\n if (structParts.length !== 3) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedStructFormat);\n }\n\n // Validate identifier characters\n if (!isValidIdentifier(structParts[1])) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.InvalidModuleNameCharacter);\n }\n if (!isValidIdentifier(structParts[2])) {\n throw new TypeTagParserError(str, TypeTagParserErrorType.InvalidStructNameCharacter);\n }\n\n return new TypeTagStruct(\n new StructTag(\n AccountAddress.fromStringRelaxed(structParts[0]),\n new Identifier(structParts[1]),\n new Identifier(structParts[2]),\n types,\n ),\n );\n }\n}\n"],"mappings":"sNAuBA,SAASA,EAAkBC,EAAa,CACtC,MAAO,CAAC,CAACA,EAAI,MAAM,iBAAiB,CACtC,CAEA,SAASC,EAA2BC,EAAc,CAChD,MAAO,CAAC,CAACA,EAAK,MAAM,IAAI,CAC1B,CAEA,SAASC,EAAkBC,EAAgBC,EAAa,CACtD,IAAI,EAAIA,EACR,KAAO,EAAID,EAAO,OAA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BR,EAAK,mFAA6C,EAIjF,GAAI,CAACD,EAAkB2C,EAAY,EAAE,EACnC,MAAM,IAAIlC,EAAmBR,EAAK,8DAAiD,EAErF,GAAI,CAACD,EAAkB2C,EAAY,EAAE,EACnC,MAAM,IAAIlC,EAAmBR,EAAK,8DAAiD,EAGrF,OAAO,IAAI2C,EACT,IAAIC,EACFC,EAAe,kBAAkBH,EAAY,EAAE,EAC/C,IAAII,EAAWJ,EAAY,EAAE,EAC7B,IAAII,EAAWJ,EAAY,EAAE,EAC7Bb,CACF,CACF,CACJ,CACF","names":["isValidIdentifier","str","isValidWhitespaceCharacter","char","consumeWhitespace","tagStr","pos","innerChar","TypeTagParserErrorType","TypeTagParserError","typeTagStr","invalidReason","parseTypeTag","typeStr","options","allowGenerics","saved","innerTypes","curTypes","cur","currentStr","expectedTypes","newType","parseTypeTagInner","savedPop","savedStr","savedTypes","savedExpectedTypes","parsedTypeTag","nextChar","types","TypeTagReference","TypeTagSigner","TypeTagBool","TypeTagAddress","TypeTagU8","TypeTagU16","TypeTagU32","TypeTagU64","TypeTagU128","TypeTagU256","TypeTagVector","TypeTagGeneric","structParts","TypeTagStruct","StructTag","AccountAddress","Identifier"]}
|
|
@@ -1 +0,0 @@
|
|
|
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 MoveStructType,\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: MoveStructType;\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,GACjE,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,YAC/D,OAAQ,CACN,eAAgBK,GAAS,cACzB,MAAOA,GAAS,OAChB,MAAOA,GAAS,OAAS,G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C2C,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,GAAY,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,EAAP,CAEA,GAAIA,EAAM,SAAW,IACnB,MAAO,GAET,MAAM,IAAI,MAAM,2CAA2C3D,EAAe,SAAS,GAAG,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"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as r,c as v,e as s}from"./chunk-27P7PELS.mjs";import{a as d,b as U,c as p,d as b,e as y,f as m}from"./chunk-DNDWTM7A.mjs";var a=class extends r{constructor(e){super();v(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}static deserialize(e){return new a(e.deserializeBool())}},l=class extends r{constructor(e){super();s(e,0,d),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new l(e.deserializeU8())}},n=class extends r{constructor(e){super();s(e,0,U),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new n(e.deserializeU16())}},o=class extends r{constructor(e){super();s(e,0,p),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new o(e.deserializeU32())}},c=class extends r{constructor(e){super();s(e,BigInt(0),b),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new c(e.deserializeU64())}},z=class extends r{constructor(e){super();s(e,BigInt(0),y),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new z(e.deserializeU128())}},u=class extends r{constructor(e){super();s(e,BigInt(0),m),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let i=this.bcsToBytes();e.serializeBytes(i)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new u(e.deserializeU256())}};export{a,l as b,n as c,o as d,c as e,z as f,u as g};
|
|
2
|
-
//# sourceMappingURL=chunk-PDLUCVJB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport { AccountAddress, PrivateKey, Account as AccountModule, AccountAddressInput } from \"../core\";\nimport {\n AccountData,\n GetAccountCoinsDataResponse,\n GetAccountCollectionsWithOwnedTokenResponse,\n GetAccountOwnedObjectsResponse,\n GetAccountOwnedTokensFromCollectionResponse,\n GetAccountOwnedTokensQueryResponse,\n LedgerVersion,\n MoveModuleBytecode,\n MoveResource,\n MoveStructType,\n OrderBy,\n PaginationArgs,\n TokenStandard,\n TransactionResponse,\n} from \"../types\";\nimport {\n deriveAccountFromPrivateKey,\n getAccountCoinsCount,\n getAccountCoinsData,\n getAccountCollectionsWithOwnedTokens,\n getAccountOwnedObjects,\n getAccountOwnedTokens,\n getAccountOwnedTokensFromCollectionAddress,\n getAccountTokensCount,\n getAccountTransactionsCount,\n getInfo,\n getModule,\n getModules,\n getResource,\n getResources,\n getTransactions,\n lookupOriginalAccountAddress,\n} from \"../internal/account\";\n\n/**\n * A class to query all `Account` related queries on Aptos.\n */\nexport class Account {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries the current state for an Aptos account given its account address\n *\n * @param args.accountAddress Aptos account address\n *\n * @returns The account data\n *\n * @example An example of the returned account\n * ```\n * {\n * sequence_number: \"1\",\n * authentication_key: \"0x5307b5f4bc67829097a8ba9b43dba3b88261eeccd1f709d9bde240fc100fbb69\"\n * }\n * ```\n */\n async getAccountInfo(args: { accountAddress: AccountAddressInput }): Promise<AccountData> {\n return getInfo({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for all modules in an account given an account address\n *\n * Note: In order to get all account modules, this function may call the API\n * multiple times as it auto paginates.\n *\n * @param args.accountAddress Aptos account address\n * @param args.options.offset The number module to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Account modules\n */\n\n async getAccountModules(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersion;\n }): Promise<MoveModuleBytecode[]> {\n return getModules({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a specific account module given account address and module name\n *\n * @param args.accountAddress Aptos account address\n * @param args.moduleName The name of the module\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Account module\n *\n * @example An example of an account module\n * ```\n * {\n * bytecode: \"0xa11ceb0b0600000006010002030206050807070f0d081c200\",\n * abi: { address: \"0x1\" }\n * }\n * ```\n */\n async getAccountModule(args: {\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersion;\n }): Promise<MoveModuleBytecode> {\n return getModule({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries account transactions given an account address\n *\n * Note: In order to get all account transactions, this function may call the API\n * multiple times as it auto paginates.\n *\n * @param args.accountAddress Aptos account address\n * @param args.options.offset The number transaction to start returning results from\n * @param args.options.limit The number of results to return\n *\n * @returns The account transactions\n */\n async getAccountTransactions(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs;\n }): Promise<TransactionResponse[]> {\n return getTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries all account resources given an account address\n *\n * Note: In order to get all account resources, this function may call the API\n * multiple times as it auto paginates.\n *\n * @param args.accountAddress Aptos account address\n * @param args.options.offset The number resource to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n * @returns Account resources\n */\n async getAccountResources(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersion;\n }): Promise<MoveResource[]> {\n return getResources({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries a specific account resource given account address and resource type. Note that the default is `any` in order\n * to allow for ease of accessing properties of the object.\n *\n * @type The typed output of the resource\n * @param args.accountAddress Aptos account address\n * @param args.resourceType String representation of an on-chain Move struct type, i.e \"0x1::aptos_coin::AptosCoin\"\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Account resource\n *\n * @example An example of an account resource\n * ```\n * {\n * data: { value: 6 }\n * }\n * ```\n */\n async getAccountResource<T extends {} = any>(args: {\n accountAddress: AccountAddressInput;\n resourceType: MoveStructType;\n options?: LedgerVersion;\n }): Promise<T> {\n return getResource<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Looks up the account address for a given authentication key\n *\n * This handles both if the account's authentication key has been rotated or not.\n *\n * @param args.authenticationKey The authentication key\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n * @returns Promise<AccountAddress> The accountAddress associated with the authentication key\n */\n async lookupOriginalAccountAddress(args: {\n authenticationKey: AccountAddressInput;\n options?: LedgerVersion;\n }): Promise<AccountAddress> {\n return lookupOriginalAccountAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the current count of tokens owned by an account\n *\n * @param args.accountAddress The account address\n * @returns Current count of tokens owned by the account\n */\n async getAccountTokensCount(args: { accountAddress: AccountAddressInput }): Promise<number> {\n return getAccountTokensCount({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the account's current owned tokens.\n *\n * This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.\n * If you want to get only the token from a specific standard, you can pass an optional tokenStandard param\n *\n * @param args.accountAddress The account address we want to get the tokens for\n * @param args.options.tokenStandard The NFT standard to query for\n * @param args.options.pagination.offset The number token to start returning results from\n * @param args.options.pagination.limit The number of results to return\n * @param args.options.orderBy The order to sort the tokens by\n * @returns Tokens array with the token data\n */\n async getAccountOwnedTokens(args: {\n accountAddress: AccountAddressInput;\n options?: {\n tokenStandard?: TokenStandard;\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetAccountOwnedTokensQueryResponse[0]>;\n };\n }): Promise<GetAccountOwnedTokensQueryResponse> {\n return getAccountOwnedTokens({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries all current tokens of a specific collection that an account owns by the collection address\n *\n * This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.\n * If you want to get only the token from a specific standard, you can pass an optional tokenStandard param\n *\n * @param args.accountAddress The account address we want to get the tokens for\n * @param args.collectionAddress The address of the collection being queried\n * @param args.options.tokenStandard The NFT standard to query for\n * @param args.options.pagination.offset The number token to start returning results from\n * @param args.options.pagination.limit The number of results to return\n * @param args.options.orderBy The order to sort the tokens by\n * @returns Tokens array with the token data\n */\n async getAccountOwnedTokensFromCollectionAddress(args: {\n accountAddress: AccountAddressInput;\n collectionAddress: AccountAddressInput;\n options?: {\n tokenStandard?: TokenStandard;\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetAccountOwnedTokensFromCollectionResponse[0]>;\n };\n }): Promise<GetAccountOwnedTokensFromCollectionResponse> {\n return getAccountOwnedTokensFromCollectionAddress({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for all collections that an account currently has tokens for.\n *\n * This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.\n * If you want to get only the token from a specific standard, you can pass an optional tokenStandard param\n *\n * @param args.accountAddress The account address we want to get the collections for\n * @param args.options.tokenStandard The NFT standard to query for\n * @param args.options.pagination.offset The number collection to start returning results from\n * @param args.options.pagination.limit The number of results to return\n * @param args.options.orderBy The order to sort the tokens by\n * @returns Collections array with the collections data\n */\n async getAccountCollectionsWithOwnedTokens(args: {\n accountAddress: AccountAddressInput;\n options?: {\n tokenStandard?: TokenStandard;\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetAccountCollectionsWithOwnedTokenResponse[0]>;\n };\n }): Promise<GetAccountCollectionsWithOwnedTokenResponse> {\n return getAccountCollectionsWithOwnedTokens({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the current count of transactions submitted by an account\n *\n * @param args.accountAddress The account address we want to get the total count for\n * @returns Current count of transactions made by an account\n */\n async getAccountTransactionsCount(args: { accountAddress: AccountAddressInput }): Promise<number> {\n return getAccountTransactionsCount({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries an account's coins data\n *\n * @param args.accountAddress The account address we want to get the coins data for\n * @param args.options.pagination.offset The number coin to start returning results from\n * @param args.options.pagination.limit The number of results to return\n * @param args.options.orderBy The order to sort the coins by\n * @returns Array with the coins data\n */\n async getAccountCoinsData(args: {\n accountAddress: AccountAddressInput;\n options?: {\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetAccountCoinsDataResponse[0]>;\n };\n }): Promise<GetAccountCoinsDataResponse> {\n return getAccountCoinsData({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the current count of an account's coins aggregated\n *\n * @param args.accountAddress The account address we want to get the total count for\n * @returns Current count of the aggregated count of all account's coins\n */\n async getAccountCoinsCount(args: { accountAddress: AccountAddressInput }): Promise<number> {\n return getAccountCoinsCount({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries an account's owned objects\n *\n * @param args.accountAddress The account address we want to get the objects for\n * @param args.options.pagination.offset The number coin to start returning results from\n * @param args.options.pagination.limit The number of results to return\n * @param args.options.orderBy The order to sort the coins by\n * @returns Objects array with the object data\n */\n async getAccountOwnedObjects(args: {\n accountAddress: AccountAddressInput;\n options?: {\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetAccountOwnedObjectsResponse[0]>;\n };\n }): Promise<GetAccountOwnedObjectsResponse> {\n return getAccountOwnedObjects({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Derives an account by providing a private key.\n * This functions resolves the provided private key type and derives the public key from it.\n *\n * If the privateKey is a Secp256k1 type, it derives the account using the derived public key and\n * auth key using the SingleKey scheme locally.\n *\n * If the privateKey is a ED25519 type, it looks up the authentication key on chain, and uses it to resolve\n * whether it is a Legacy ED25519 key or a Unified ED25519 key. It then derives the account based\n * on that.\n *\n * @param args.privateKey An account private key\n * @returns Account type\n */\n async deriveAccountFromPrivateKey(args: { privateKey: PrivateKey }): Promise<AccountModule> {\n return deriveAccountFromPrivateKey({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"kJA2CO,IAAMA,EAAN,KAAc,CAGnB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAiBA,MAAM,eAAeC,EAAqE,CACxF,OAAOC,EAAQ,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CACtD,CAgBA,MAAM,kBAAkBA,EAGU,CAChC,OAAOE,EAAW,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CACzD,CAmBA,MAAM,iBAAiBA,EAIS,CAC9B,OAAOG,EAAU,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CACxD,CAcA,MAAM,uBAAuBA,EAGM,CACjC,OAAOI,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGJ,CACL,CAAC,CACH,CAcA,MAAM,oBAAoBA,EAGE,CAC1B,OAAOK,EAAa,CAAE,YAAa,KAAK,OAAQ,GAAGL,CAAK,CAAC,CAC3D,CAoBA,MAAM,mBAAuCA,EAI9B,CACb,OAAOM,EAAe,CAAE,YAAa,KAAK,OAAQ,GAAGN,CAAK,CAAC,CAC7D,CAWA,MAAM,6BAA6BA,EAGP,CAC1B,OAAOO,EAA6B,CAAE,YAAa,KAAK,OAAQ,GAAGP,CAAK,CAAC,CAC3E,CAQA,MAAM,sBAAsBA,EAAgE,CAC1F,OAAOQ,EAAsB,CAC3B,YAAa,KAAK,OAClB,GAAGR,CACL,CAAC,CACH,CAeA,MAAM,sBAAsBA,EAOoB,CAC9C,OAAOS,EAAsB,CAC3B,YAAa,KAAK,OAClB,GAAGT,CACL,CAAC,CACH,CAgBA,MAAM,2CAA2CA,EAQQ,CACvD,OAAOU,EAA2C,CAChD,YAAa,KAAK,OAClB,GAAGV,CACL,CAAC,CACH,CAeA,MAAM,qCAAqCA,EAOc,CACvD,OAAOW,EAAqC,CAC1C,YAAa,KAAK,OAClB,GAAGX,CACL,CAAC,CACH,CAQA,MAAM,4BAA4BA,EAAgE,CAChG,OAAOY,EAA4B,CACjC,YAAa,KAAK,OAClB,GAAGZ,CACL,CAAC,CACH,CAWA,MAAM,oBAAoBA,EAMe,CACvC,OAAOa,EAAoB,CACzB,YAAa,KAAK,OAClB,GAAGb,CACL,CAAC,CACH,CAQA,MAAM,qBAAqBA,EAAgE,CACzF,OAAOc,EAAqB,CAAE,YAAa,KAAK,OAAQ,GAAGd,CAAK,CAAC,CACnE,CAWA,MAAM,uBAAuBA,EAMe,CAC1C,OAAOe,EAAuB,CAC5B,YAAa,KAAK,OAClB,GAAGf,CACL,CAAC,CACH,CAgBA,MAAM,4BAA4BA,EAA0D,CAC1F,OAAOgB,EAA4B,CAAE,YAAa,KAAK,OAAQ,GAAGhB,CAAK,CAAC,CAC1E,CACF","names":["Account","config","args","getInfo","getModules","getModule","getTransactions","getResources","getResource","lookupOriginalAccountAddress","getAccountTokensCount","getAccountOwnedTokens","getAccountOwnedTokensFromCollectionAddress","getAccountCollectionsWithOwnedTokens","getAccountTransactionsCount","getAccountCoinsData","getAccountCoinsCount","getAccountOwnedObjects","deriveAccountFromPrivateKey"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-BIUGRAMO.mjs";import{a as n}from"./chunk-YS2OX7AB.mjs";import{a as s}from"./chunk-E72CFUU4.mjs";var i=class extends s{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:r,signature:o}=e;return this.publicKey.verifySignature({message:r,signature:o})}serialize(e){if(this.publicKey instanceof t)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof n)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return new i(t.load(e));case 1:return new i(n.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${r}`)}}};export{i as a};
|
|
2
|
-
//# sourceMappingURL=chunk-UVGCVCNG.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-27P7PELS.mjs";import{b as r}from"./chunk-IZHPCZE3.mjs";var i=class extends t{constructor(e){super();this.value=r.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,a){let s=e.deserializeFixedBytes(a);return new i(s)}};export{i as a};
|
|
2
|
-
//# sourceMappingURL=chunk-V6AAQLLJ.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as h}from"./chunk-DXUIJ6KA.mjs";import{a as y}from"./chunk-UQIOMAXE.mjs";import{b as t}from"./chunk-HH5RSP2H.mjs";import{a as p}from"./chunk-27P7PELS.mjs";var r=class extends p{constructor(e,s,i,n,l,_,u){super();this.sender=e,this.sequence_number=s,this.payload=i,this.max_gas_amount=n,this.gas_unit_price=l,this.expiration_timestamp_secs=_,this.chain_id=u}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=t.deserialize(e),i=e.deserializeU64(),n=h.deserialize(e),l=e.deserializeU64(),_=e.deserializeU64(),u=e.deserializeU64(),m=y.deserialize(e);return new r(s,i,n,l,_,u,m)}},d=class extends p{static deserialize(a){let e=a.deserializeUleb128AsU32();switch(e){case 0:return o.load(a);case 1:return c.load(a);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},o=class extends d{constructor(e,s){super();this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=r.deserialize(e),i=e.deserializeVector(t);return new o(s,i)}},c=class extends d{constructor(e,s,i){super();this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=i}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=r.deserialize(e),i=e.deserializeVector(t),n=t.deserialize(e);return new c(s,i,n)}};export{r as a,d as b,o as c,c as d};
|
|
2
|
-
//# sourceMappingURL=chunk-WGXAIQ7K.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t,b as n,c as o}from"./chunk-2B5QXKPU.mjs";var s=class{constructor(e){this.config=e}async getAccountEventsByCreationNumber(e){return t({aptosConfig:this.config,...e})}async getAccountEventsByEventType(e){return n({aptosConfig:this.config,...e})}async getEvents(e){return o({aptosConfig:this.config,...e})}};export{s as a};
|
|
2
|
-
//# sourceMappingURL=chunk-WNEZCERQ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/event.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport { getAccountEventsByCreationNumber, getAccountEventsByEventType, getEvents } from \"../internal/event\";\nimport { AnyNumber, GetEventsResponse, MoveStructType, OrderBy, PaginationArgs } from \"../types\";\nimport { EventsBoolExp } from \"../types/generated/types\";\nimport { AccountAddressInput } from \"../core\";\n\n/**\n * A class to query all `Event` Aptos related queries\n */\nexport class Event {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Get events by creation number and an account address\n *\n * @param args.accountAddress - The account address\n * @param args.creationNumber - The event creation number\n *\n * @returns Promise<GetEventsResponse>\n */\n async getAccountEventsByCreationNumber(args: {\n accountAddress: AccountAddressInput;\n creationNumber: AnyNumber;\n }): Promise<GetEventsResponse> {\n return getAccountEventsByCreationNumber({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Get events by event type and an account address\n *\n * @param args.accountAddress - The account address\n * @param args.eventType - The event type\n *\n * @returns Promise<GetEventsResponse>\n */\n async getAccountEventsByEventType(args: {\n accountAddress: AccountAddressInput;\n eventType: MoveStructType;\n options?: {\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetEventsResponse[0]>;\n };\n }): Promise<GetEventsResponse> {\n return getAccountEventsByEventType({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Get all events\n *\n * An optional `where` can be passed in to filter out the response.\n *\n * @example\n * ```\n * { where:\n * {\n * transaction_version: { _eq: 123456 },\n * }\n * }\n * ```\n *\n * @returns GetEventsQuery response type\n */\n async getEvents(args?: {\n options?: {\n where?: EventsBoolExp;\n pagination?: PaginationArgs;\n orderBy?: OrderBy<GetEventsResponse[0]>;\n };\n }): Promise<GetEventsResponse> {\n return getEvents({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"uDAYO,IAAMA,EAAN,KAAY,CAGjB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAUA,MAAM,iCAAiCC,EAGR,CAC7B,OAAOC,EAAiC,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAC/E,CAUA,MAAM,4BAA4BA,EAOH,CAC7B,OAAOE,EAA4B,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CAC1E,CAkBA,MAAM,UAAUA,EAMe,CAC7B,OAAOG,EAAU,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CACxD,CACF","names":["Event","config","args","getAccountEventsByCreationNumber","getAccountEventsByEventType","getEvents"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/coin.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Account, AccountAddressInput } from \"../core\";\nimport { transferCoinTransaction } from \"../internal/coin\";\nimport { InputSingleSignerTransaction, InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { AnyNumber, MoveStructType } from \"../types\";\n\n/**\n * A class to handle all `Coin` operations\n */\nexport class Coin {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Generate a transfer coin transaction that can be simulated and/or signed and submitted\n *\n * @param args.sender The sender account\n * @param args.recipient The recipient address\n * @param args.amount The amount to transfer\n * @param args.coinType optional. The coin struct type to transfer. Defaults to 0x1::aptos_coin::AptosCoin\n *\n * @returns SingleSignerTransaction\n */\n async transferCoinTransaction(args: {\n sender: Account;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n coinType?: MoveStructType;\n options?: InputGenerateTransactionOptions;\n }): Promise<InputSingleSignerTransaction> {\n return transferCoinTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"yCAYO,IAAMA,EAAN,KAAW,CAGhB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAYA,MAAM,wBAAwBC,EAMY,CACxC,OAAOC,EAAwB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CACtE,CACF","names":["Coin","config","args","transferCoinTransaction"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as d,b as p,c as g}from"./chunk-E72CFUU4.mjs";import{e as m,j as x}from"./chunk-LR65XHSF.mjs";import{b as n}from"./chunk-IZHPCZE3.mjs";import{sha3_256 as H}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as z}from"@scure/bip32";var s=class extends d{constructor(e){super();let t=n.fromHexInput(e);if(t.toUint8Array().length!==s.LENGTH)throw new Error(`PublicKey length should be ${s.LENGTH}`);this.key=t}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:t,signature:i}=e,u=n.fromHexInput(t).toUint8Array(),f=H(u),v=i.toUint8Array();return o.verify(v,f,this.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new s(t)}static load(e){let t=e.deserializeBytes();return new s(t)}},y=s;y.LENGTH=65;var r=class extends p{constructor(e){super();let t=n.fromHexInput(e);if(t.toUint8Array().length!==r.LENGTH)throw new Error(`PrivateKey length should be ${r.LENGTH}`);this.key=t}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}sign(e){let t=n.fromHexInput(e),i=H(t.toUint8Array()),u=o.sign(i,this.key.toUint8Array());return new l(u.toCompactRawBytes())}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new r(t)}static generate(){let e=o.utils.randomPrivateKey();return new r(e)}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new y(e)}static fromDerivationPath(e,t){if(!m(e))throw new Error(`Invalid derivation path ${e}`);return r.fromDerivationPathInner(e,x(t))}static fromDerivationPathInner(e,t){let{privateKey:i}=z.fromMasterSeed(t).derive(e);if(i===null)throw new Error("Invalid key");return new r(i)}},c=r;c.LENGTH=32;var a=class extends g{constructor(e){super();let t=n.fromHexInput(e);if(t.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, recieved ${t.toUint8Array().length}`);this.data=t}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new a(t)}static load(e){let t=e.deserializeBytes();return new a(t)}},l=a;l.LENGTH=64;export{y as a,c as b,l as c};
|
|
2
|
-
//# sourceMappingURL=chunk-YS2OX7AB.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-FNB6CFQR.mjs";import{a as h}from"./chunk-CZZJAR3B.mjs";import{a as m}from"./chunk-UVGCVCNG.mjs";import{a as y}from"./chunk-BIUGRAMO.mjs";import{b as l}from"./chunk-HH5RSP2H.mjs";import{a as u}from"./chunk-27P7PELS.mjs";import{b as s}from"./chunk-IZHPCZE3.mjs";import{sha3_256 as b}from"@noble/hashes/sha3";var i=class extends u{constructor(r){super();let{data:t}=r,e=s.fromHexInput(t);if(e.toUint8Array().length!==i.LENGTH)throw new Error(`Authentication Key length should be ${i.LENGTH}`);this.data=e}serialize(r){r.serializeFixedBytes(this.data.toUint8Array())}static deserialize(r){let t=r.deserializeFixedBytes(i.LENGTH);return new i({data:t})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromPublicKeyAndScheme(r){let{publicKey:t,scheme:e}=r,n;switch(e){case 3:case 2:{let a=t.bcsToBytes();n=new Uint8Array([...a,e]);break}case 0:case 1:{let a=t.toUint8Array(),p=s.fromHexInput(a).toUint8Array();n=new Uint8Array([...p,e]);break}default:throw new Error(`Scheme ${e} is not supported`)}let c=b.create();c.update(n);let f=c.digest();return new i({data:f})}static fromPublicKey(r){let{publicKey:t}=r,e;if(t instanceof y)e=0 .valueOf();else if(t instanceof d)e=1 .valueOf();else if(t instanceof m)e=2 .valueOf();else if(t instanceof h)e=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return i.fromPublicKeyAndScheme({publicKey:t,scheme:e})}derivedAddress(){return new l(this.data.toUint8Array())}},o=i;o.LENGTH=32;export{o as a};
|
|
2
|
-
//# sourceMappingURL=chunk-ZXJ5ZBTL.mjs.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { aptosRequest, request } from './core.js';
|
|
2
|
-
export { GetAptosRequestOptions, GetRequestOptions, get, getAptosFullNode, paginateWithCursor } from './get.js';
|
|
3
|
-
export { PostAptosRequestOptions, PostRequestOptions, post, postAptosFaucet, postAptosFullNode, postAptosIndexer } from './post.js';
|
|
4
|
-
export { AptosApiError, AptosResponse } from './types.js';
|
|
5
|
-
import '../api/aptosConfig.js';
|
|
6
|
-
import '../types/index.js';
|
|
7
|
-
import '../utils/apiEndpoints.js';
|
|
8
|
-
import '../types/indexer.js';
|
|
9
|
-
import '../types/generated/operations.js';
|
|
10
|
-
import '../types/generated/types.js';
|
|
11
|
-
import '../utils/const.js';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export { PrivateKey, PublicKey, Signature } from './asymmetricCrypto.js';
|
|
2
|
-
export { Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature } from './ed25519.js';
|
|
3
|
-
export { MultiEd25519PublicKey, MultiEd25519Signature } from './multiEd25519.js';
|
|
4
|
-
export { Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature } from './secp256k1.js';
|
|
5
|
-
export { MultiKey } from './multiKey.js';
|
|
6
|
-
export { APTOS_BIP44_REGEX, APTOS_HARDENED_REGEX, CKDPriv, DerivedKeys, HARDENED_OFFSET, KeyType, deriveKey, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, splitPath } from './hdKey.js';
|
|
7
|
-
import '../../types/index.js';
|
|
8
|
-
import '../../utils/apiEndpoints.js';
|
|
9
|
-
import '../../types/indexer.js';
|
|
10
|
-
import '../../types/generated/operations.js';
|
|
11
|
-
import '../../types/generated/types.js';
|
|
12
|
-
import '../../bcs/serializer.js';
|
|
13
|
-
import '../hex.js';
|
|
14
|
-
import '../common.js';
|
|
15
|
-
import '../../bcs/deserializer.js';
|
|
16
|
-
import './anyPublicKey.js';
|
|
17
|
-
import './anySignature.js';
|