@aptos-labs/ts-sdk 0.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -17
- package/dist/browser/index.d.ts +528 -209
- package/dist/browser/index.global.js +25 -25
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +528 -209
- package/dist/common/index.js +26 -26
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +9 -9
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +4 -11
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/coin.d.mts +3 -3
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +317 -73
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +3 -3
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +0 -2
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +118 -13
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +25 -4
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/helpers.d.mts +4 -0
- package/dist/esm/api/transactionSubmission/helpers.mjs +2 -0
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +23 -2
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +21 -2
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-ZJUDDSWN.mjs → chunk-2HBIGMDV.mjs} +2 -2
- package/dist/esm/{chunk-GIZLK7M7.mjs → chunk-3O4GKLXA.mjs} +2 -2
- package/dist/esm/chunk-3O4GKLXA.mjs.map +1 -0
- package/dist/esm/{chunk-CJPCOS4R.mjs → chunk-3QS3MFWJ.mjs} +2 -2
- package/dist/esm/{chunk-AZUWHKN5.mjs → chunk-4K252UDE.mjs} +2 -2
- package/dist/esm/{chunk-MWAMLQ25.mjs → chunk-4TIQQKXV.mjs} +2 -2
- package/dist/esm/{chunk-GMG4VR3K.mjs → chunk-4VG7DV6F.mjs} +2 -2
- package/dist/esm/{chunk-CCXMVVXD.mjs → chunk-4ZYW3BPF.mjs} +2 -2
- package/dist/esm/chunk-4ZYW3BPF.mjs.map +1 -0
- package/dist/esm/{chunk-UW6HQ643.mjs → chunk-5HZKDT5C.mjs} +2 -2
- package/dist/esm/{chunk-73VWOS4Z.mjs → chunk-6DYNAFAP.mjs} +2 -2
- package/dist/esm/chunk-6EMN3BOV.mjs +2 -0
- package/dist/esm/chunk-6EMN3BOV.mjs.map +1 -0
- package/dist/esm/{chunk-HTI5LEST.mjs → chunk-6F4ACCCZ.mjs} +2 -2
- package/dist/esm/chunk-6MKBROIC.mjs +2 -0
- package/dist/esm/chunk-6MKBROIC.mjs.map +1 -0
- package/dist/esm/{chunk-53DS6NBQ.mjs → chunk-7B3VSBCX.mjs} +2 -2
- package/dist/esm/{chunk-F7EWDYTE.mjs → chunk-7QJYTQSU.mjs} +2 -2
- package/dist/esm/{chunk-OZZDXS26.mjs → chunk-AS7RX4RK.mjs} +2 -2
- package/dist/esm/chunk-AS7RX4RK.mjs.map +1 -0
- package/dist/esm/{chunk-GEZSEAL5.mjs → chunk-BUM2FIHF.mjs} +2 -2
- package/dist/esm/chunk-BV6SCEXY.mjs +2 -0
- package/dist/esm/chunk-BV6SCEXY.mjs.map +1 -0
- package/dist/esm/chunk-C3Y52GHM.mjs +2 -0
- package/dist/esm/chunk-C3Y52GHM.mjs.map +1 -0
- package/dist/esm/{chunk-OBOOY2QD.mjs → chunk-D2XLC3KK.mjs} +2 -2
- package/dist/esm/chunk-EHJEK7FU.mjs +2 -0
- package/dist/esm/chunk-EMQWD6KP.mjs +2 -0
- package/dist/esm/chunk-EMQWD6KP.mjs.map +1 -0
- package/dist/esm/{chunk-PL2VA73L.mjs → chunk-F2GFSFPW.mjs} +2 -2
- package/dist/esm/{chunk-GXPGRCSW.mjs → chunk-F52GIFKT.mjs} +2 -2
- package/dist/esm/{chunk-QNTV5NMH.mjs → chunk-FGTQT7Q5.mjs} +2 -2
- package/dist/esm/{chunk-RCM3K5JL.mjs → chunk-GQI3HWOB.mjs} +2 -2
- package/dist/esm/chunk-HDNJ4JK4.mjs +2 -0
- package/dist/esm/chunk-HDNJ4JK4.mjs.map +1 -0
- package/dist/esm/{chunk-2SAKPC5Q.mjs → chunk-HQ4DGB7L.mjs} +2 -2
- package/dist/esm/{chunk-KNMWDGP4.mjs → chunk-IEL6J6Z3.mjs} +2 -2
- package/dist/esm/{chunk-NZSGGL25.mjs → chunk-IPW2YTRD.mjs} +2 -2
- package/dist/esm/{chunk-F6K26WV5.mjs → chunk-IU5JZNH4.mjs} +2 -2
- package/dist/esm/{chunk-Y6PVFMBS.mjs → chunk-KH3M3YPI.mjs} +2 -2
- package/dist/esm/chunk-KSWQZKMQ.mjs +2 -0
- package/dist/esm/chunk-KSWQZKMQ.mjs.map +1 -0
- package/dist/esm/{chunk-5OPOJ43H.mjs → chunk-KVJ2KGMW.mjs} +2 -2
- package/dist/esm/{chunk-TZ623H2V.mjs → chunk-LUCDRB52.mjs} +2 -2
- package/dist/esm/chunk-LUCDRB52.mjs.map +1 -0
- package/dist/esm/{chunk-WTGGCH34.mjs → chunk-N25GOEVL.mjs} +2 -2
- package/dist/esm/{chunk-CU2DINU4.mjs → chunk-NLONZHYT.mjs} +2 -2
- package/dist/esm/{chunk-FZ56IS3E.mjs → chunk-NMFS5KAE.mjs} +2 -2
- package/dist/esm/chunk-NZ6RYGJQ.mjs +2 -0
- package/dist/esm/chunk-NZ6RYGJQ.mjs.map +1 -0
- package/dist/esm/chunk-OU4MEM5F.mjs +2 -0
- package/dist/esm/chunk-OU4MEM5F.mjs.map +1 -0
- package/dist/esm/{chunk-KZSJ5MFF.mjs → chunk-OWP2MKTX.mjs} +2 -2
- package/dist/esm/{chunk-QCBIJCU4.mjs → chunk-OXO3Z2MF.mjs} +2 -2
- package/dist/esm/{chunk-CL5B2QNS.mjs → chunk-PANYJULW.mjs} +2 -2
- package/dist/esm/{chunk-QEXAMHPU.mjs → chunk-PJMRQLJ5.mjs} +2 -2
- package/dist/esm/chunk-PJMRQLJ5.mjs.map +1 -0
- package/dist/esm/{chunk-XMUUI6HG.mjs → chunk-PRKZ2KJ4.mjs} +2 -2
- package/dist/esm/{chunk-SGTFMSOG.mjs → chunk-R3SAAJ2N.mjs} +2 -2
- package/dist/esm/{chunk-VQ7LYNMD.mjs → chunk-R4APGSSC.mjs} +2 -2
- package/dist/esm/{chunk-3F5WV6US.mjs → chunk-RCYWJZR4.mjs} +2 -2
- package/dist/esm/chunk-SI6QMT4N.mjs +2 -0
- package/dist/esm/chunk-SI6QMT4N.mjs.map +1 -0
- package/dist/esm/{chunk-SSJQOXEP.mjs → chunk-SMN2QQ4Q.mjs} +2 -2
- package/dist/esm/chunk-SMN2QQ4Q.mjs.map +1 -0
- package/dist/esm/chunk-SODP7NAK.mjs +2 -0
- package/dist/esm/{chunk-SDPICQ5B.mjs.map → chunk-SODP7NAK.mjs.map} +1 -1
- package/dist/esm/{chunk-OT2UDMUU.mjs → chunk-SR7XLV76.mjs} +2 -2
- package/dist/esm/{chunk-APSQ4M23.mjs → chunk-T3ID6KFN.mjs} +2 -2
- package/dist/esm/{chunk-5UY5OKXR.mjs → chunk-TCSN7PYL.mjs} +2 -2
- package/dist/esm/chunk-TCSN7PYL.mjs.map +1 -0
- package/dist/esm/chunk-TTDCRLRD.mjs +2 -0
- package/dist/esm/chunk-TTDCRLRD.mjs.map +1 -0
- package/dist/esm/{chunk-G36AY4R7.mjs → chunk-UR5E2UDO.mjs} +2 -2
- package/dist/esm/{chunk-JI2BBZ2W.mjs → chunk-UZB7CTLX.mjs} +2 -2
- package/dist/esm/chunk-VA4K6DEK.mjs +2 -0
- package/dist/esm/chunk-VA4K6DEK.mjs.map +1 -0
- package/dist/esm/{chunk-CLJLQXFQ.mjs → chunk-VBUKPN4Q.mjs} +2 -2
- package/dist/esm/chunk-VBUKPN4Q.mjs.map +1 -0
- package/dist/esm/{chunk-XITLXPBK.mjs → chunk-VMCFN5CT.mjs} +2 -2
- package/dist/esm/{chunk-SRGPSANH.mjs → chunk-YLI6J47P.mjs} +2 -2
- package/dist/esm/chunk-YLPG6XMH.mjs +2 -0
- package/dist/esm/chunk-YLPG6XMH.mjs.map +1 -0
- package/dist/esm/{chunk-HC5VMNXA.mjs → chunk-ZLYSA7JR.mjs} +2 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account.d.mts +2 -2
- package/dist/esm/core/account.mjs +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
- package/dist/esm/core/crypto/anySignature.mjs +1 -1
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +1 -3
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +5 -5
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +2 -2
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +151 -26
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +12 -5
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +6 -6
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +3 -3
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +4 -2
- package/src/api/ans.ts +9 -9
- package/src/api/aptos.ts +3 -28
- package/src/api/coin.ts +3 -3
- package/src/api/digitalAsset.ts +387 -88
- package/src/api/fungibleAsset.ts +3 -3
- package/src/api/transaction.ts +172 -2
- package/src/api/transactionSubmission/build.ts +25 -4
- package/src/api/transactionSubmission/helpers.ts +31 -0
- package/src/api/transactionSubmission/simulate.ts +26 -20
- package/src/api/transactionSubmission/submit.ts +24 -20
- package/src/client/core.ts +1 -1
- package/src/core/account.ts +2 -2
- package/src/internal/ans.ts +5 -5
- package/src/internal/coin.ts +2 -2
- package/src/internal/digitalAsset.ts +482 -58
- package/src/internal/fungibleAsset.ts +2 -2
- package/src/internal/transactionSubmission.ts +6 -6
- package/src/transactions/management/transactionWorker.ts +2 -9
- package/src/transactions/transactionBuilder/remoteAbi.ts +13 -5
- package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -4
- package/src/transactions/typeTag/index.ts +1 -0
- package/src/transactions/types.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/esm/api/transactionSubmission.d.mts +0 -113
- package/dist/esm/api/transactionSubmission.mjs +0 -2
- package/dist/esm/chunk-2YQXX64E.mjs +0 -2
- package/dist/esm/chunk-2YQXX64E.mjs.map +0 -1
- package/dist/esm/chunk-5CUNY7X2.mjs +0 -2
- package/dist/esm/chunk-5CUNY7X2.mjs.map +0 -1
- package/dist/esm/chunk-5UY5OKXR.mjs.map +0 -1
- package/dist/esm/chunk-5ZVCSKFX.mjs +0 -2
- package/dist/esm/chunk-5ZVCSKFX.mjs.map +0 -1
- package/dist/esm/chunk-CCXMVVXD.mjs.map +0 -1
- package/dist/esm/chunk-CLJLQXFQ.mjs.map +0 -1
- package/dist/esm/chunk-EFRFDFS4.mjs +0 -2
- package/dist/esm/chunk-EFRFDFS4.mjs.map +0 -1
- package/dist/esm/chunk-GIZLK7M7.mjs.map +0 -1
- package/dist/esm/chunk-IELTCGLP.mjs +0 -2
- package/dist/esm/chunk-IELTCGLP.mjs.map +0 -1
- package/dist/esm/chunk-KKER5KL4.mjs +0 -2
- package/dist/esm/chunk-KKER5KL4.mjs.map +0 -1
- package/dist/esm/chunk-OZZDXS26.mjs.map +0 -1
- package/dist/esm/chunk-P5747ZYC.mjs +0 -2
- package/dist/esm/chunk-P5747ZYC.mjs.map +0 -1
- package/dist/esm/chunk-PXTMLJKO.mjs +0 -2
- package/dist/esm/chunk-QEXAMHPU.mjs.map +0 -1
- package/dist/esm/chunk-RLG3WOTH.mjs +0 -2
- package/dist/esm/chunk-RLG3WOTH.mjs.map +0 -1
- package/dist/esm/chunk-SDPICQ5B.mjs +0 -2
- package/dist/esm/chunk-SO6EE5DX.mjs +0 -2
- package/dist/esm/chunk-SO6EE5DX.mjs.map +0 -1
- package/dist/esm/chunk-SSJQOXEP.mjs.map +0 -1
- package/dist/esm/chunk-TZ623H2V.mjs.map +0 -1
- package/dist/esm/chunk-UKSA4H2O.mjs +0 -2
- package/dist/esm/chunk-UKSA4H2O.mjs.map +0 -1
- package/dist/esm/chunk-UWXDXOFK.mjs +0 -2
- package/dist/esm/chunk-UWXDXOFK.mjs.map +0 -1
- package/dist/esm/chunk-XX2Z26FH.mjs +0 -2
- package/dist/esm/chunk-XX2Z26FH.mjs.map +0 -1
- package/dist/esm/chunk-YN6UIVFB.mjs +0 -2
- package/dist/esm/chunk-YN6UIVFB.mjs.map +0 -1
- package/dist/esm/chunk-ZFK7QD3B.mjs +0 -2
- package/dist/esm/chunk-ZFK7QD3B.mjs.map +0 -1
- package/src/api/transactionSubmission.ts +0 -121
- /package/dist/esm/api/{transactionSubmission.mjs.map → transactionSubmission/helpers.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZJUDDSWN.mjs.map → chunk-2HBIGMDV.mjs.map} +0 -0
- /package/dist/esm/{chunk-CJPCOS4R.mjs.map → chunk-3QS3MFWJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-AZUWHKN5.mjs.map → chunk-4K252UDE.mjs.map} +0 -0
- /package/dist/esm/{chunk-MWAMLQ25.mjs.map → chunk-4TIQQKXV.mjs.map} +0 -0
- /package/dist/esm/{chunk-GMG4VR3K.mjs.map → chunk-4VG7DV6F.mjs.map} +0 -0
- /package/dist/esm/{chunk-UW6HQ643.mjs.map → chunk-5HZKDT5C.mjs.map} +0 -0
- /package/dist/esm/{chunk-73VWOS4Z.mjs.map → chunk-6DYNAFAP.mjs.map} +0 -0
- /package/dist/esm/{chunk-HTI5LEST.mjs.map → chunk-6F4ACCCZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-53DS6NBQ.mjs.map → chunk-7B3VSBCX.mjs.map} +0 -0
- /package/dist/esm/{chunk-F7EWDYTE.mjs.map → chunk-7QJYTQSU.mjs.map} +0 -0
- /package/dist/esm/{chunk-GEZSEAL5.mjs.map → chunk-BUM2FIHF.mjs.map} +0 -0
- /package/dist/esm/{chunk-OBOOY2QD.mjs.map → chunk-D2XLC3KK.mjs.map} +0 -0
- /package/dist/esm/{chunk-PXTMLJKO.mjs.map → chunk-EHJEK7FU.mjs.map} +0 -0
- /package/dist/esm/{chunk-PL2VA73L.mjs.map → chunk-F2GFSFPW.mjs.map} +0 -0
- /package/dist/esm/{chunk-GXPGRCSW.mjs.map → chunk-F52GIFKT.mjs.map} +0 -0
- /package/dist/esm/{chunk-QNTV5NMH.mjs.map → chunk-FGTQT7Q5.mjs.map} +0 -0
- /package/dist/esm/{chunk-RCM3K5JL.mjs.map → chunk-GQI3HWOB.mjs.map} +0 -0
- /package/dist/esm/{chunk-2SAKPC5Q.mjs.map → chunk-HQ4DGB7L.mjs.map} +0 -0
- /package/dist/esm/{chunk-KNMWDGP4.mjs.map → chunk-IEL6J6Z3.mjs.map} +0 -0
- /package/dist/esm/{chunk-NZSGGL25.mjs.map → chunk-IPW2YTRD.mjs.map} +0 -0
- /package/dist/esm/{chunk-F6K26WV5.mjs.map → chunk-IU5JZNH4.mjs.map} +0 -0
- /package/dist/esm/{chunk-Y6PVFMBS.mjs.map → chunk-KH3M3YPI.mjs.map} +0 -0
- /package/dist/esm/{chunk-5OPOJ43H.mjs.map → chunk-KVJ2KGMW.mjs.map} +0 -0
- /package/dist/esm/{chunk-WTGGCH34.mjs.map → chunk-N25GOEVL.mjs.map} +0 -0
- /package/dist/esm/{chunk-CU2DINU4.mjs.map → chunk-NLONZHYT.mjs.map} +0 -0
- /package/dist/esm/{chunk-FZ56IS3E.mjs.map → chunk-NMFS5KAE.mjs.map} +0 -0
- /package/dist/esm/{chunk-KZSJ5MFF.mjs.map → chunk-OWP2MKTX.mjs.map} +0 -0
- /package/dist/esm/{chunk-QCBIJCU4.mjs.map → chunk-OXO3Z2MF.mjs.map} +0 -0
- /package/dist/esm/{chunk-CL5B2QNS.mjs.map → chunk-PANYJULW.mjs.map} +0 -0
- /package/dist/esm/{chunk-XMUUI6HG.mjs.map → chunk-PRKZ2KJ4.mjs.map} +0 -0
- /package/dist/esm/{chunk-SGTFMSOG.mjs.map → chunk-R3SAAJ2N.mjs.map} +0 -0
- /package/dist/esm/{chunk-VQ7LYNMD.mjs.map → chunk-R4APGSSC.mjs.map} +0 -0
- /package/dist/esm/{chunk-3F5WV6US.mjs.map → chunk-RCYWJZR4.mjs.map} +0 -0
- /package/dist/esm/{chunk-OT2UDMUU.mjs.map → chunk-SR7XLV76.mjs.map} +0 -0
- /package/dist/esm/{chunk-APSQ4M23.mjs.map → chunk-T3ID6KFN.mjs.map} +0 -0
- /package/dist/esm/{chunk-G36AY4R7.mjs.map → chunk-UR5E2UDO.mjs.map} +0 -0
- /package/dist/esm/{chunk-JI2BBZ2W.mjs.map → chunk-UZB7CTLX.mjs.map} +0 -0
- /package/dist/esm/{chunk-XITLXPBK.mjs.map → chunk-VMCFN5CT.mjs.map} +0 -0
- /package/dist/esm/{chunk-SRGPSANH.mjs.map → chunk-YLI6J47P.mjs.map} +0 -0
- /package/dist/esm/{chunk-HC5VMNXA.mjs.map → chunk-ZLYSA7JR.mjs.map} +0 -0
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
|
-
import { MoveString,
|
|
12
|
+
import { MoveString, Bool, U64 } from "../bcs";
|
|
13
13
|
import { Account, AccountAddress, AccountAddressInput } from "../core";
|
|
14
|
-
import { InputGenerateTransactionOptions,
|
|
14
|
+
import { InputGenerateTransactionOptions, SimpleTransaction } from "../transactions/types";
|
|
15
15
|
import {
|
|
16
16
|
AnyNumber,
|
|
17
17
|
GetCollectionDataResponse,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
GetOwnedTokensResponse,
|
|
20
20
|
GetTokenActivityResponse,
|
|
21
21
|
GetTokenDataResponse,
|
|
22
|
+
MoveStructId,
|
|
22
23
|
OrderByArg,
|
|
23
24
|
PaginationArgs,
|
|
24
25
|
TokenStandardArg,
|
|
@@ -39,52 +40,41 @@ import { queryIndexer } from "./general";
|
|
|
39
40
|
import { generateTransaction } from "./transactionSubmission";
|
|
40
41
|
import { MAX_U64_BIG_INT } from "../bcs/consts";
|
|
41
42
|
import { CurrentTokenOwnershipsV2BoolExp, TokenActivitiesV2BoolExp } from "../types/generated/types";
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
MoveVector.MoveString([]),
|
|
71
|
-
MoveVector.MoveString([]),
|
|
72
|
-
new MoveVector<MoveVector<U8>>([]),
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
options,
|
|
76
|
-
});
|
|
77
|
-
return transaction;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export async function getTokenData(args: {
|
|
43
|
+
import { checkOrConvertArgument, parseTypeTag } from "../transactions";
|
|
44
|
+
|
|
45
|
+
// A property type map for the user input and what Move expects
|
|
46
|
+
const PropertyTypeMap = {
|
|
47
|
+
BOOLEAN: "bool",
|
|
48
|
+
U8: "u8",
|
|
49
|
+
U16: "u16",
|
|
50
|
+
U32: "u32",
|
|
51
|
+
U64: "u64",
|
|
52
|
+
U128: "u128",
|
|
53
|
+
U256: "u256",
|
|
54
|
+
ADDRESS: "address",
|
|
55
|
+
STRING: "0x1::string::String",
|
|
56
|
+
// TODO support array/vector property types and values
|
|
57
|
+
// ARRAY: "vector<u8>",
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type PropertyType = keyof typeof PropertyTypeMap;
|
|
61
|
+
|
|
62
|
+
// Accepted property value types for user input
|
|
63
|
+
export type PropertyValue = boolean | number | bigint | string | AccountAddress | Array<PropertyValue>;
|
|
64
|
+
|
|
65
|
+
// The default digital asset type to use if non provided
|
|
66
|
+
const defaultDigitalAssetType = "0x4::token::Token";
|
|
67
|
+
|
|
68
|
+
// FETCH QUERIES
|
|
69
|
+
|
|
70
|
+
export async function getDigitalAssetData(args: {
|
|
81
71
|
aptosConfig: AptosConfig;
|
|
82
|
-
|
|
72
|
+
digitalAssetAddress: AccountAddressInput;
|
|
83
73
|
}): Promise<GetTokenDataResponse> {
|
|
84
|
-
const { aptosConfig,
|
|
74
|
+
const { aptosConfig, digitalAssetAddress } = args;
|
|
85
75
|
|
|
86
76
|
const whereCondition: { token_data_id: { _eq: string } } = {
|
|
87
|
-
token_data_id: { _eq: AccountAddress.from(
|
|
77
|
+
token_data_id: { _eq: AccountAddress.from(digitalAssetAddress).toStringLong() },
|
|
88
78
|
};
|
|
89
79
|
|
|
90
80
|
const graphqlQuery = {
|
|
@@ -97,20 +87,20 @@ export async function getTokenData(args: {
|
|
|
97
87
|
const data = await queryIndexer<GetTokenDataQuery>({
|
|
98
88
|
aptosConfig,
|
|
99
89
|
query: graphqlQuery,
|
|
100
|
-
originMethod: "
|
|
90
|
+
originMethod: "getDigitalAssetData",
|
|
101
91
|
});
|
|
102
92
|
|
|
103
93
|
return data.current_token_datas_v2[0];
|
|
104
94
|
}
|
|
105
95
|
|
|
106
|
-
export async function
|
|
96
|
+
export async function getCurrentDigitalAssetOwnership(args: {
|
|
107
97
|
aptosConfig: AptosConfig;
|
|
108
|
-
|
|
98
|
+
digitalAssetAddress: AccountAddressInput;
|
|
109
99
|
}): Promise<GetCurrentTokenOwnershipResponse> {
|
|
110
|
-
const { aptosConfig,
|
|
100
|
+
const { aptosConfig, digitalAssetAddress } = args;
|
|
111
101
|
|
|
112
102
|
const whereCondition: CurrentTokenOwnershipsV2BoolExp = {
|
|
113
|
-
token_data_id: { _eq: AccountAddress.from(
|
|
103
|
+
token_data_id: { _eq: AccountAddress.from(digitalAssetAddress).toStringLong() },
|
|
114
104
|
};
|
|
115
105
|
|
|
116
106
|
const graphqlQuery = {
|
|
@@ -123,13 +113,13 @@ export async function getCurrentTokenOwnership(args: {
|
|
|
123
113
|
const data = await queryIndexer<GetCurrentTokenOwnershipQuery>({
|
|
124
114
|
aptosConfig,
|
|
125
115
|
query: graphqlQuery,
|
|
126
|
-
originMethod: "
|
|
116
|
+
originMethod: "getCurrentDigitalAssetOwnership",
|
|
127
117
|
});
|
|
128
118
|
|
|
129
119
|
return data.current_token_ownerships_v2[0];
|
|
130
120
|
}
|
|
131
121
|
|
|
132
|
-
export async function
|
|
122
|
+
export async function getOwnedDigitalAssets(args: {
|
|
133
123
|
aptosConfig: AptosConfig;
|
|
134
124
|
ownerAddress: AccountAddressInput;
|
|
135
125
|
options?: PaginationArgs & OrderByArg<GetTokenActivityResponse[0]>;
|
|
@@ -138,6 +128,7 @@ export async function getOwnedTokens(args: {
|
|
|
138
128
|
|
|
139
129
|
const whereCondition: CurrentTokenOwnershipsV2BoolExp = {
|
|
140
130
|
owner_address: { _eq: AccountAddress.from(ownerAddress).toStringLong() },
|
|
131
|
+
amount: { _gt: 0 },
|
|
141
132
|
};
|
|
142
133
|
|
|
143
134
|
const graphqlQuery = {
|
|
@@ -153,21 +144,21 @@ export async function getOwnedTokens(args: {
|
|
|
153
144
|
const data = await queryIndexer<GetCurrentTokenOwnershipQuery>({
|
|
154
145
|
aptosConfig,
|
|
155
146
|
query: graphqlQuery,
|
|
156
|
-
originMethod: "
|
|
147
|
+
originMethod: "getOwnedDigitalAssets",
|
|
157
148
|
});
|
|
158
149
|
|
|
159
150
|
return data.current_token_ownerships_v2;
|
|
160
151
|
}
|
|
161
152
|
|
|
162
|
-
export async function
|
|
153
|
+
export async function getDigitalAssetActivity(args: {
|
|
163
154
|
aptosConfig: AptosConfig;
|
|
164
|
-
|
|
155
|
+
digitalAssetAddress: AccountAddressInput;
|
|
165
156
|
options?: PaginationArgs & OrderByArg<GetTokenActivityResponse[0]>;
|
|
166
157
|
}): Promise<GetTokenActivityResponse> {
|
|
167
|
-
const { aptosConfig,
|
|
158
|
+
const { aptosConfig, digitalAssetAddress, options } = args;
|
|
168
159
|
|
|
169
160
|
const whereCondition: TokenActivitiesV2BoolExp = {
|
|
170
|
-
token_data_id: { _eq: AccountAddress.from(
|
|
161
|
+
token_data_id: { _eq: AccountAddress.from(digitalAssetAddress).toStringLong() },
|
|
171
162
|
};
|
|
172
163
|
|
|
173
164
|
const graphqlQuery = {
|
|
@@ -183,7 +174,7 @@ export async function getTokenActivity(args: {
|
|
|
183
174
|
const data = await queryIndexer<GetTokenActivityQuery>({
|
|
184
175
|
aptosConfig,
|
|
185
176
|
query: graphqlQuery,
|
|
186
|
-
originMethod: "
|
|
177
|
+
originMethod: "getDigitalAssetActivity",
|
|
187
178
|
});
|
|
188
179
|
|
|
189
180
|
return data.token_activities_v2;
|
|
@@ -213,7 +204,7 @@ export async function createCollectionTransaction(
|
|
|
213
204
|
uri: string;
|
|
214
205
|
options?: InputGenerateTransactionOptions;
|
|
215
206
|
} & CreateCollectionOptions,
|
|
216
|
-
): Promise<
|
|
207
|
+
): Promise<SimpleTransaction> {
|
|
217
208
|
const { aptosConfig, options, creator } = args;
|
|
218
209
|
const transaction = await generateTransaction({
|
|
219
210
|
aptosConfig,
|
|
@@ -285,3 +276,436 @@ export async function getCollectionId(args: {
|
|
|
285
276
|
}): Promise<string> {
|
|
286
277
|
return (await getCollectionData(args)).collection_id;
|
|
287
278
|
}
|
|
279
|
+
|
|
280
|
+
// TRANSACTIONS
|
|
281
|
+
|
|
282
|
+
export async function mintDigitalAssetTransaction(args: {
|
|
283
|
+
aptosConfig: AptosConfig;
|
|
284
|
+
creator: Account;
|
|
285
|
+
collection: string;
|
|
286
|
+
description: string;
|
|
287
|
+
name: string;
|
|
288
|
+
uri: string;
|
|
289
|
+
propertyKeys?: Array<string>;
|
|
290
|
+
propertyTypes?: Array<PropertyType>;
|
|
291
|
+
propertyValues?: Array<PropertyValue>;
|
|
292
|
+
options?: InputGenerateTransactionOptions;
|
|
293
|
+
}): Promise<SimpleTransaction> {
|
|
294
|
+
const {
|
|
295
|
+
aptosConfig,
|
|
296
|
+
options,
|
|
297
|
+
creator,
|
|
298
|
+
collection,
|
|
299
|
+
description,
|
|
300
|
+
name,
|
|
301
|
+
uri,
|
|
302
|
+
propertyKeys,
|
|
303
|
+
propertyTypes,
|
|
304
|
+
propertyValues,
|
|
305
|
+
} = args;
|
|
306
|
+
const convertedPropertyType = propertyTypes?.map((type) => PropertyTypeMap[type]);
|
|
307
|
+
const transaction = await generateTransaction({
|
|
308
|
+
aptosConfig,
|
|
309
|
+
sender: creator.accountAddress,
|
|
310
|
+
data: {
|
|
311
|
+
function: "0x4::aptos_token::mint",
|
|
312
|
+
functionArguments: [
|
|
313
|
+
collection,
|
|
314
|
+
description,
|
|
315
|
+
name,
|
|
316
|
+
uri,
|
|
317
|
+
propertyKeys ?? [],
|
|
318
|
+
convertedPropertyType ?? [],
|
|
319
|
+
getPropertyValueRaw(propertyValues ?? [], convertedPropertyType ?? []),
|
|
320
|
+
],
|
|
321
|
+
},
|
|
322
|
+
options,
|
|
323
|
+
});
|
|
324
|
+
return transaction;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export async function transferDigitalAssetTransaction(args: {
|
|
328
|
+
aptosConfig: AptosConfig;
|
|
329
|
+
sender: Account;
|
|
330
|
+
digitalAssetAddress: AccountAddressInput;
|
|
331
|
+
recipient: AccountAddress;
|
|
332
|
+
digitalAssetType?: MoveStructId;
|
|
333
|
+
options?: InputGenerateTransactionOptions;
|
|
334
|
+
}): Promise<SimpleTransaction> {
|
|
335
|
+
const { aptosConfig, sender, digitalAssetAddress, recipient, digitalAssetType, options } = args;
|
|
336
|
+
const transaction = await generateTransaction({
|
|
337
|
+
aptosConfig,
|
|
338
|
+
sender: sender.accountAddress,
|
|
339
|
+
data: {
|
|
340
|
+
function: "0x1::object::transfer",
|
|
341
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
342
|
+
functionArguments: [digitalAssetAddress, recipient],
|
|
343
|
+
},
|
|
344
|
+
options,
|
|
345
|
+
});
|
|
346
|
+
return transaction;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export async function mintSoulBoundTransaction(args: {
|
|
350
|
+
aptosConfig: AptosConfig;
|
|
351
|
+
account: Account;
|
|
352
|
+
collection: string;
|
|
353
|
+
description: string;
|
|
354
|
+
name: string;
|
|
355
|
+
uri: string;
|
|
356
|
+
recipient: AccountAddress;
|
|
357
|
+
propertyKeys?: Array<string>;
|
|
358
|
+
propertyTypes?: Array<PropertyType>;
|
|
359
|
+
propertyValues?: Array<PropertyValue>;
|
|
360
|
+
options?: InputGenerateTransactionOptions;
|
|
361
|
+
}): Promise<SimpleTransaction> {
|
|
362
|
+
const {
|
|
363
|
+
aptosConfig,
|
|
364
|
+
account,
|
|
365
|
+
collection,
|
|
366
|
+
description,
|
|
367
|
+
name,
|
|
368
|
+
uri,
|
|
369
|
+
recipient,
|
|
370
|
+
propertyKeys,
|
|
371
|
+
propertyTypes,
|
|
372
|
+
propertyValues,
|
|
373
|
+
options,
|
|
374
|
+
} = args;
|
|
375
|
+
if (propertyKeys?.length !== propertyValues?.length) {
|
|
376
|
+
throw new Error("Property keys and property values counts do not match");
|
|
377
|
+
}
|
|
378
|
+
if (propertyTypes?.length !== propertyValues?.length) {
|
|
379
|
+
throw new Error("Property types and property values counts do not match");
|
|
380
|
+
}
|
|
381
|
+
const convertedPropertyType = propertyTypes?.map((type) => PropertyTypeMap[type]);
|
|
382
|
+
const transaction = await generateTransaction({
|
|
383
|
+
aptosConfig,
|
|
384
|
+
sender: account.accountAddress,
|
|
385
|
+
data: {
|
|
386
|
+
function: "0x4::aptos_token::mint_soul_bound",
|
|
387
|
+
functionArguments: [
|
|
388
|
+
collection,
|
|
389
|
+
description,
|
|
390
|
+
name,
|
|
391
|
+
uri,
|
|
392
|
+
propertyKeys ?? [],
|
|
393
|
+
convertedPropertyType ?? [],
|
|
394
|
+
getPropertyValueRaw(propertyValues ?? [], convertedPropertyType ?? []),
|
|
395
|
+
recipient,
|
|
396
|
+
],
|
|
397
|
+
},
|
|
398
|
+
options,
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
return transaction;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export async function burnDigitalAssetTransaction(args: {
|
|
405
|
+
aptosConfig: AptosConfig;
|
|
406
|
+
creator: Account;
|
|
407
|
+
digitalAssetAddress: AccountAddressInput;
|
|
408
|
+
digitalAssetType?: MoveStructId;
|
|
409
|
+
options?: InputGenerateTransactionOptions;
|
|
410
|
+
}): Promise<SimpleTransaction> {
|
|
411
|
+
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, options } = args;
|
|
412
|
+
const transaction = await generateTransaction({
|
|
413
|
+
aptosConfig,
|
|
414
|
+
sender: creator.accountAddress,
|
|
415
|
+
data: {
|
|
416
|
+
function: "0x4::aptos_token::burn",
|
|
417
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
418
|
+
functionArguments: [digitalAssetAddress],
|
|
419
|
+
},
|
|
420
|
+
options,
|
|
421
|
+
});
|
|
422
|
+
return transaction;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export async function freezeDigitalAssetTransaferTransaction(args: {
|
|
426
|
+
aptosConfig: AptosConfig;
|
|
427
|
+
creator: Account;
|
|
428
|
+
digitalAssetAddress: AccountAddressInput;
|
|
429
|
+
digitalAssetType?: MoveStructId;
|
|
430
|
+
options?: InputGenerateTransactionOptions;
|
|
431
|
+
}): Promise<SimpleTransaction> {
|
|
432
|
+
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, options } = args;
|
|
433
|
+
const transaction = await generateTransaction({
|
|
434
|
+
aptosConfig,
|
|
435
|
+
sender: creator.accountAddress,
|
|
436
|
+
data: {
|
|
437
|
+
function: "0x4::aptos_token::freeze_transfer",
|
|
438
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
439
|
+
functionArguments: [digitalAssetAddress],
|
|
440
|
+
},
|
|
441
|
+
options,
|
|
442
|
+
});
|
|
443
|
+
return transaction;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export async function unfreezeDigitalAssetTransaferTransaction(args: {
|
|
447
|
+
aptosConfig: AptosConfig;
|
|
448
|
+
creator: Account;
|
|
449
|
+
digitalAssetAddress: AccountAddressInput;
|
|
450
|
+
digitalAssetType?: MoveStructId;
|
|
451
|
+
options?: InputGenerateTransactionOptions;
|
|
452
|
+
}): Promise<SimpleTransaction> {
|
|
453
|
+
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, options } = args;
|
|
454
|
+
const transaction = await generateTransaction({
|
|
455
|
+
aptosConfig,
|
|
456
|
+
sender: creator.accountAddress,
|
|
457
|
+
data: {
|
|
458
|
+
function: "0x4::aptos_token::unfreeze_transfer",
|
|
459
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
460
|
+
functionArguments: [digitalAssetAddress],
|
|
461
|
+
},
|
|
462
|
+
options,
|
|
463
|
+
});
|
|
464
|
+
return transaction;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
export async function setDigitalAssetDescriptionTransaction(args: {
|
|
468
|
+
aptosConfig: AptosConfig;
|
|
469
|
+
creator: Account;
|
|
470
|
+
description: string;
|
|
471
|
+
digitalAssetAddress: AccountAddressInput;
|
|
472
|
+
digitalAssetType?: MoveStructId;
|
|
473
|
+
options?: InputGenerateTransactionOptions;
|
|
474
|
+
}): Promise<SimpleTransaction> {
|
|
475
|
+
const { aptosConfig, creator, description, digitalAssetAddress, digitalAssetType, options } = args;
|
|
476
|
+
const transaction = await generateTransaction({
|
|
477
|
+
aptosConfig,
|
|
478
|
+
sender: creator.accountAddress,
|
|
479
|
+
data: {
|
|
480
|
+
function: "0x4::aptos_token::set_description",
|
|
481
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
482
|
+
functionArguments: [digitalAssetAddress, description],
|
|
483
|
+
},
|
|
484
|
+
options,
|
|
485
|
+
});
|
|
486
|
+
return transaction;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export async function setDigitalAssetNameTransaction(args: {
|
|
490
|
+
aptosConfig: AptosConfig;
|
|
491
|
+
creator: Account;
|
|
492
|
+
name: string;
|
|
493
|
+
digitalAssetAddress: AccountAddressInput;
|
|
494
|
+
digitalAssetType?: MoveStructId;
|
|
495
|
+
options?: InputGenerateTransactionOptions;
|
|
496
|
+
}): Promise<SimpleTransaction> {
|
|
497
|
+
const { aptosConfig, creator, name, digitalAssetAddress, digitalAssetType, options } = args;
|
|
498
|
+
const transaction = await generateTransaction({
|
|
499
|
+
aptosConfig,
|
|
500
|
+
sender: creator.accountAddress,
|
|
501
|
+
data: {
|
|
502
|
+
function: "0x4::aptos_token::set_name",
|
|
503
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
504
|
+
functionArguments: [digitalAssetAddress, name],
|
|
505
|
+
},
|
|
506
|
+
options,
|
|
507
|
+
});
|
|
508
|
+
return transaction;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export async function setDigitalAssetURITransaction(args: {
|
|
512
|
+
aptosConfig: AptosConfig;
|
|
513
|
+
creator: Account;
|
|
514
|
+
uri: string;
|
|
515
|
+
digitalAssetAddress: AccountAddressInput;
|
|
516
|
+
digitalAssetType?: MoveStructId;
|
|
517
|
+
options?: InputGenerateTransactionOptions;
|
|
518
|
+
}): Promise<SimpleTransaction> {
|
|
519
|
+
const { aptosConfig, creator, uri, digitalAssetAddress, digitalAssetType, options } = args;
|
|
520
|
+
const transaction = await generateTransaction({
|
|
521
|
+
aptosConfig,
|
|
522
|
+
sender: creator.accountAddress,
|
|
523
|
+
data: {
|
|
524
|
+
function: "0x4::aptos_token::set_uri",
|
|
525
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
526
|
+
functionArguments: [digitalAssetAddress, uri],
|
|
527
|
+
},
|
|
528
|
+
options,
|
|
529
|
+
});
|
|
530
|
+
return transaction;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export async function addDigitalAssetPropertyTransaction(args: {
|
|
534
|
+
aptosConfig: AptosConfig;
|
|
535
|
+
creator: Account;
|
|
536
|
+
propertyKey: string;
|
|
537
|
+
propertyType: PropertyType;
|
|
538
|
+
propertyValue: PropertyValue;
|
|
539
|
+
digitalAssetAddress: AccountAddressInput;
|
|
540
|
+
digitalAssetType?: MoveStructId;
|
|
541
|
+
options?: InputGenerateTransactionOptions;
|
|
542
|
+
}): Promise<SimpleTransaction> {
|
|
543
|
+
const {
|
|
544
|
+
aptosConfig,
|
|
545
|
+
creator,
|
|
546
|
+
propertyKey,
|
|
547
|
+
propertyType,
|
|
548
|
+
propertyValue,
|
|
549
|
+
digitalAssetAddress,
|
|
550
|
+
digitalAssetType,
|
|
551
|
+
options,
|
|
552
|
+
} = args;
|
|
553
|
+
const transaction = await generateTransaction({
|
|
554
|
+
aptosConfig,
|
|
555
|
+
sender: creator.accountAddress,
|
|
556
|
+
data: {
|
|
557
|
+
function: "0x4::aptos_token::add_property",
|
|
558
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
559
|
+
functionArguments: [
|
|
560
|
+
digitalAssetAddress,
|
|
561
|
+
propertyKey,
|
|
562
|
+
PropertyTypeMap[propertyType],
|
|
563
|
+
getSinglePropertyValueRaw(propertyValue, PropertyTypeMap[propertyType]),
|
|
564
|
+
],
|
|
565
|
+
},
|
|
566
|
+
options,
|
|
567
|
+
});
|
|
568
|
+
return transaction;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
export async function removeDigitalAssetPropertyTransaction(args: {
|
|
572
|
+
aptosConfig: AptosConfig;
|
|
573
|
+
creator: Account;
|
|
574
|
+
propertyKey: string;
|
|
575
|
+
digitalAssetAddress: AccountAddressInput;
|
|
576
|
+
digitalAssetType?: MoveStructId;
|
|
577
|
+
options?: InputGenerateTransactionOptions;
|
|
578
|
+
}): Promise<SimpleTransaction> {
|
|
579
|
+
const { aptosConfig, creator, propertyKey, digitalAssetAddress, digitalAssetType, options } = args;
|
|
580
|
+
const transaction = await generateTransaction({
|
|
581
|
+
aptosConfig,
|
|
582
|
+
sender: creator.accountAddress,
|
|
583
|
+
data: {
|
|
584
|
+
function: "0x4::aptos_token::remove_property",
|
|
585
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
586
|
+
functionArguments: [digitalAssetAddress, propertyKey],
|
|
587
|
+
},
|
|
588
|
+
options,
|
|
589
|
+
});
|
|
590
|
+
return transaction;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
export async function updateDigitalAssetPropertyTransaction(args: {
|
|
594
|
+
aptosConfig: AptosConfig;
|
|
595
|
+
creator: Account;
|
|
596
|
+
propertyKey: string;
|
|
597
|
+
propertyType: PropertyType;
|
|
598
|
+
propertyValue: PropertyValue;
|
|
599
|
+
digitalAssetAddress: AccountAddressInput;
|
|
600
|
+
digitalAssetType?: MoveStructId;
|
|
601
|
+
options?: InputGenerateTransactionOptions;
|
|
602
|
+
}): Promise<SimpleTransaction> {
|
|
603
|
+
const {
|
|
604
|
+
aptosConfig,
|
|
605
|
+
creator,
|
|
606
|
+
propertyKey,
|
|
607
|
+
propertyType,
|
|
608
|
+
propertyValue,
|
|
609
|
+
digitalAssetAddress,
|
|
610
|
+
digitalAssetType,
|
|
611
|
+
options,
|
|
612
|
+
} = args;
|
|
613
|
+
const transaction = await generateTransaction({
|
|
614
|
+
aptosConfig,
|
|
615
|
+
sender: creator.accountAddress,
|
|
616
|
+
data: {
|
|
617
|
+
function: "0x4::aptos_token::update_property",
|
|
618
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
619
|
+
functionArguments: [
|
|
620
|
+
digitalAssetAddress,
|
|
621
|
+
propertyKey,
|
|
622
|
+
PropertyTypeMap[propertyType],
|
|
623
|
+
getSinglePropertyValueRaw(propertyValue, PropertyTypeMap[propertyType]),
|
|
624
|
+
],
|
|
625
|
+
},
|
|
626
|
+
options,
|
|
627
|
+
});
|
|
628
|
+
return transaction;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
export async function addDigitalAssetTypedPropertyTransaction(args: {
|
|
632
|
+
aptosConfig: AptosConfig;
|
|
633
|
+
creator: Account;
|
|
634
|
+
propertyKey: string;
|
|
635
|
+
propertyType: PropertyType;
|
|
636
|
+
propertyValue: PropertyValue;
|
|
637
|
+
digitalAssetAddress: AccountAddressInput;
|
|
638
|
+
digitalAssetType?: MoveStructId;
|
|
639
|
+
options?: InputGenerateTransactionOptions;
|
|
640
|
+
}): Promise<SimpleTransaction> {
|
|
641
|
+
const {
|
|
642
|
+
aptosConfig,
|
|
643
|
+
creator,
|
|
644
|
+
propertyKey,
|
|
645
|
+
propertyType,
|
|
646
|
+
propertyValue,
|
|
647
|
+
digitalAssetAddress,
|
|
648
|
+
digitalAssetType,
|
|
649
|
+
options,
|
|
650
|
+
} = args;
|
|
651
|
+
const transaction = await generateTransaction({
|
|
652
|
+
aptosConfig,
|
|
653
|
+
sender: creator.accountAddress,
|
|
654
|
+
data: {
|
|
655
|
+
function: "0x4::aptos_token::add_typed_property",
|
|
656
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType, PropertyTypeMap[propertyType]],
|
|
657
|
+
functionArguments: [digitalAssetAddress, propertyKey, propertyValue],
|
|
658
|
+
},
|
|
659
|
+
options,
|
|
660
|
+
});
|
|
661
|
+
return transaction;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
export async function updateDigitalAssetTypedPropertyTransaction(args: {
|
|
665
|
+
aptosConfig: AptosConfig;
|
|
666
|
+
creator: Account;
|
|
667
|
+
propertyKey: string;
|
|
668
|
+
propertyType: PropertyType;
|
|
669
|
+
propertyValue: PropertyValue;
|
|
670
|
+
digitalAssetAddress: AccountAddressInput;
|
|
671
|
+
digitalAssetType?: MoveStructId;
|
|
672
|
+
options?: InputGenerateTransactionOptions;
|
|
673
|
+
}): Promise<SimpleTransaction> {
|
|
674
|
+
const {
|
|
675
|
+
aptosConfig,
|
|
676
|
+
creator,
|
|
677
|
+
propertyKey,
|
|
678
|
+
propertyType,
|
|
679
|
+
propertyValue,
|
|
680
|
+
digitalAssetAddress,
|
|
681
|
+
digitalAssetType,
|
|
682
|
+
options,
|
|
683
|
+
} = args;
|
|
684
|
+
const transaction = await generateTransaction({
|
|
685
|
+
aptosConfig,
|
|
686
|
+
sender: creator.accountAddress,
|
|
687
|
+
data: {
|
|
688
|
+
function: "0x4::aptos_token::update_typed_property",
|
|
689
|
+
typeArguments: [digitalAssetType ?? defaultDigitalAssetType, PropertyTypeMap[propertyType]],
|
|
690
|
+
functionArguments: [digitalAssetAddress, propertyKey, propertyValue],
|
|
691
|
+
},
|
|
692
|
+
options,
|
|
693
|
+
});
|
|
694
|
+
return transaction;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
function getPropertyValueRaw(propertyValues: Array<PropertyValue>, propertyTypes: Array<string>): Array<Uint8Array> {
|
|
698
|
+
const results = new Array<Uint8Array>();
|
|
699
|
+
|
|
700
|
+
propertyTypes.forEach((typ, index) => {
|
|
701
|
+
results.push(getSinglePropertyValueRaw(propertyValues[index], typ));
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
return results;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
function getSinglePropertyValueRaw(propertyValue: PropertyValue, propertyType: string): Uint8Array {
|
|
708
|
+
const typeTag = parseTypeTag(propertyType);
|
|
709
|
+
const res = checkOrConvertArgument(propertyValue, typeTag, 0, []);
|
|
710
|
+
return res.bcsToBytes();
|
|
711
|
+
}
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
FungibleAssetMetadataBoolExp,
|
|
35
35
|
} from "../types/generated/types";
|
|
36
36
|
import { Account, AccountAddress } from "../core";
|
|
37
|
-
import { InputGenerateTransactionOptions } from "../transactions";
|
|
37
|
+
import { InputGenerateTransactionOptions, SimpleTransaction } from "../transactions";
|
|
38
38
|
import { generateTransaction } from "./transactionSubmission";
|
|
39
39
|
|
|
40
40
|
export async function getFungibleAssetMetadata(args: {
|
|
@@ -116,7 +116,7 @@ export async function transferFungibleAsset(args: {
|
|
|
116
116
|
recipient: AccountAddress;
|
|
117
117
|
amount: AnyNumber;
|
|
118
118
|
options?: InputGenerateTransactionOptions;
|
|
119
|
-
}) {
|
|
119
|
+
}): Promise<SimpleTransaction> {
|
|
120
120
|
const { aptosConfig, sender, fungibleAssetMetadataAddress, recipient, amount, options } = args;
|
|
121
121
|
const transaction = await generateTransaction({
|
|
122
122
|
aptosConfig,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file contains the underlying implementations for exposed API surface in
|
|
3
|
-
* the {@link api/
|
|
2
|
+
* This file contains the underlying implementations for exposed submission API surface in
|
|
3
|
+
* the {@link api/transaction}. By moving the methods out into a separate file,
|
|
4
4
|
* other namespaces and processes can access these methods without depending on the entire
|
|
5
|
-
*
|
|
5
|
+
* transaction namespace and without having a dependency cycle error.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { AptosConfig } from "../api/aptosConfig";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
AnyRawTransaction,
|
|
27
27
|
InputSimulateTransactionData,
|
|
28
28
|
InputGenerateTransactionOptions,
|
|
29
|
-
|
|
29
|
+
SimpleTransaction,
|
|
30
30
|
InputGenerateTransactionPayloadDataWithRemoteABI,
|
|
31
31
|
InputSubmitTransactionData,
|
|
32
32
|
InputGenerateMultiAgentRawTransactionData,
|
|
@@ -45,7 +45,7 @@ import { UserTransactionResponse, PendingTransactionResponse, MimeType, HexInput
|
|
|
45
45
|
*/
|
|
46
46
|
export async function generateTransaction(
|
|
47
47
|
args: { aptosConfig: AptosConfig } & InputGenerateSingleSignerRawTransactionData,
|
|
48
|
-
): Promise<
|
|
48
|
+
): Promise<SimpleTransaction>;
|
|
49
49
|
export async function generateTransaction(
|
|
50
50
|
args: { aptosConfig: AptosConfig } & InputGenerateMultiAgentRawTransactionData,
|
|
51
51
|
): Promise<MultiAgentTransaction>;
|
|
@@ -287,7 +287,7 @@ export async function publicPackageTransaction(args: {
|
|
|
287
287
|
metadataBytes: HexInput;
|
|
288
288
|
moduleBytecode: Array<HexInput>;
|
|
289
289
|
options?: InputGenerateTransactionOptions;
|
|
290
|
-
}): Promise<
|
|
290
|
+
}): Promise<SimpleTransaction> {
|
|
291
291
|
const { aptosConfig, account, metadataBytes, moduleBytecode, options } = args;
|
|
292
292
|
|
|
293
293
|
const totalByteCode = moduleBytecode.map((bytecode) => MoveVector.U8(bytecode));
|