@aptos-labs/ts-sdk 0.0.8 → 1.0.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 +14 -14
- package/dist/browser/index.d.ts +20 -0
- package/dist/browser/index.global.js +24 -24
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +20 -0
- package/dist/common/index.js +23 -23
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +22 -2
- 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.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/transactionSubmission.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-26GRNGPL.mjs +2 -0
- package/dist/esm/chunk-26GRNGPL.mjs.map +1 -0
- package/dist/esm/{chunk-5UY5OKXR.mjs → chunk-2AMFCGJ3.mjs} +2 -2
- package/dist/esm/{chunk-UWXDXOFK.mjs → chunk-2X3FRUKX.mjs} +2 -2
- package/dist/esm/{chunk-VQ7LYNMD.mjs → chunk-32A35CPU.mjs} +2 -2
- package/dist/esm/{chunk-CJPCOS4R.mjs → chunk-3QS3MFWJ.mjs} +2 -2
- package/dist/esm/chunk-4FDIPWVB.mjs +2 -0
- package/dist/esm/chunk-4FDIPWVB.mjs.map +1 -0
- package/dist/esm/{chunk-AZUWHKN5.mjs → chunk-4K252UDE.mjs} +2 -2
- package/dist/esm/{chunk-RLG3WOTH.mjs → chunk-4XQ5IV6C.mjs} +2 -2
- package/dist/esm/{chunk-UW6HQ643.mjs → chunk-5HZKDT5C.mjs} +2 -2
- package/dist/esm/{chunk-OT2UDMUU.mjs → chunk-5IVRKK5V.mjs} +2 -2
- package/dist/esm/{chunk-SRGPSANH.mjs → chunk-5SRMD5C6.mjs} +2 -2
- package/dist/esm/{chunk-SO6EE5DX.mjs → chunk-5X46HDCI.mjs} +2 -2
- package/dist/esm/{chunk-73VWOS4Z.mjs → chunk-6DYNAFAP.mjs} +2 -2
- package/dist/esm/{chunk-HTI5LEST.mjs → chunk-6F4ACCCZ.mjs} +2 -2
- package/dist/esm/{chunk-53DS6NBQ.mjs → chunk-7B3VSBCX.mjs} +2 -2
- package/dist/esm/{chunk-CLJLQXFQ.mjs → chunk-7IY2Y73Q.mjs} +2 -2
- package/dist/esm/{chunk-F7EWDYTE.mjs → chunk-7QJYTQSU.mjs} +2 -2
- package/dist/esm/{chunk-KNMWDGP4.mjs → chunk-BA4TDBYB.mjs} +2 -2
- package/dist/esm/{chunk-Y6PVFMBS.mjs → chunk-BDTDWLGO.mjs} +2 -2
- package/dist/esm/chunk-C3Y52GHM.mjs +2 -0
- package/dist/esm/chunk-C3Y52GHM.mjs.map +1 -0
- package/dist/esm/{chunk-OBOOY2QD.mjs → chunk-CBAVJ5EN.mjs} +2 -2
- package/dist/esm/{chunk-GMG4VR3K.mjs → chunk-DBJTMCAG.mjs} +2 -2
- package/dist/esm/{chunk-OZZDXS26.mjs → chunk-DYJVDOBH.mjs} +2 -2
- package/dist/esm/chunk-EHJEK7FU.mjs +2 -0
- package/dist/esm/{chunk-TZ623H2V.mjs → chunk-ELWWME6B.mjs} +2 -2
- 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-MWAMLQ25.mjs → chunk-GMOHGD73.mjs} +2 -2
- package/dist/esm/{chunk-RCM3K5JL.mjs → chunk-GQI3HWOB.mjs} +2 -2
- package/dist/esm/{chunk-2SAKPC5Q.mjs → chunk-HQ4DGB7L.mjs} +2 -2
- package/dist/esm/{chunk-F6K26WV5.mjs → chunk-IU5JZNH4.mjs} +2 -2
- package/dist/esm/{chunk-HC5VMNXA.mjs → chunk-KR5JAN32.mjs} +2 -2
- package/dist/esm/{chunk-5OPOJ43H.mjs → chunk-KVJ2KGMW.mjs} +2 -2
- package/dist/esm/{chunk-APSQ4M23.mjs → chunk-LBNMY7EM.mjs} +2 -2
- package/dist/esm/{chunk-GIZLK7M7.mjs → chunk-MNFGMNYS.mjs} +2 -2
- package/dist/esm/{chunk-WTGGCH34.mjs → chunk-N25GOEVL.mjs} +2 -2
- package/dist/esm/{chunk-XX2Z26FH.mjs → chunk-NBSXZKMQ.mjs} +2 -2
- package/dist/esm/{chunk-JI2BBZ2W.mjs → chunk-NFGAZSSK.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-ZFK7QD3B.mjs → chunk-NZ36UN4C.mjs} +2 -2
- 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-P5747ZYC.mjs → chunk-PEBXSNMJ.mjs} +2 -2
- package/dist/esm/{chunk-QEXAMHPU.mjs → chunk-PLY7MQKE.mjs} +2 -2
- package/dist/esm/{chunk-XMUUI6HG.mjs → chunk-PRKZ2KJ4.mjs} +2 -2
- package/dist/esm/{chunk-SSJQOXEP.mjs → chunk-PZ5JKQSP.mjs} +2 -2
- package/dist/esm/{chunk-NZSGGL25.mjs → chunk-Q3R3KKKP.mjs} +2 -2
- package/dist/esm/{chunk-3F5WV6US.mjs → chunk-RCYWJZR4.mjs} +2 -2
- package/dist/esm/chunk-TNUGIBLO.mjs +2 -0
- package/dist/esm/chunk-TNUGIBLO.mjs.map +1 -0
- package/dist/esm/{chunk-2YQXX64E.mjs → chunk-TTICPGX6.mjs} +2 -2
- package/dist/esm/{chunk-KKER5KL4.mjs → chunk-UES76WF2.mjs} +2 -2
- package/dist/esm/{chunk-G36AY4R7.mjs → chunk-UR5E2UDO.mjs} +2 -2
- package/dist/esm/{chunk-XITLXPBK.mjs → chunk-VMCFN5CT.mjs} +2 -2
- package/dist/esm/{chunk-EFRFDFS4.mjs → chunk-W44E6YAW.mjs} +2 -2
- package/dist/esm/chunk-W4JEP5GW.mjs +2 -0
- package/dist/esm/{chunk-SDPICQ5B.mjs.map → chunk-W4JEP5GW.mjs.map} +1 -1
- package/dist/esm/{chunk-5ZVCSKFX.mjs → chunk-WXISFVRU.mjs} +2 -2
- package/dist/esm/{chunk-GEZSEAL5.mjs → chunk-X7QBDRQR.mjs} +2 -2
- package/dist/esm/{chunk-CCXMVVXD.mjs → chunk-XKINEFAA.mjs} +2 -2
- package/dist/esm/chunk-XKINEFAA.mjs.map +1 -0
- package/dist/esm/{chunk-SGTFMSOG.mjs → chunk-Y5RQOXZH.mjs} +2 -2
- package/dist/esm/{chunk-ZJUDDSWN.mjs → chunk-ZKFDLJ2F.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.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.mjs +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +11 -3
- 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 +10 -3
- 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.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.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.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.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/src/api/digitalAsset.ts +26 -1
- package/src/internal/digitalAsset.ts +24 -0
- package/src/internal/fungibleAsset.ts +2 -2
- package/src/transactions/transactionBuilder/remoteAbi.ts +13 -5
- package/src/transactions/typeTag/index.ts +1 -0
- package/src/version.ts +1 -1
- package/dist/esm/chunk-5CUNY7X2.mjs +0 -2
- package/dist/esm/chunk-5CUNY7X2.mjs.map +0 -1
- package/dist/esm/chunk-CCXMVVXD.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-PXTMLJKO.mjs +0 -2
- package/dist/esm/chunk-SDPICQ5B.mjs +0 -2
- package/dist/esm/chunk-UKSA4H2O.mjs +0 -2
- package/dist/esm/chunk-UKSA4H2O.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-5UY5OKXR.mjs.map → chunk-2AMFCGJ3.mjs.map} +0 -0
- /package/dist/esm/{chunk-UWXDXOFK.mjs.map → chunk-2X3FRUKX.mjs.map} +0 -0
- /package/dist/esm/{chunk-VQ7LYNMD.mjs.map → chunk-32A35CPU.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-RLG3WOTH.mjs.map → chunk-4XQ5IV6C.mjs.map} +0 -0
- /package/dist/esm/{chunk-UW6HQ643.mjs.map → chunk-5HZKDT5C.mjs.map} +0 -0
- /package/dist/esm/{chunk-OT2UDMUU.mjs.map → chunk-5IVRKK5V.mjs.map} +0 -0
- /package/dist/esm/{chunk-SRGPSANH.mjs.map → chunk-5SRMD5C6.mjs.map} +0 -0
- /package/dist/esm/{chunk-SO6EE5DX.mjs.map → chunk-5X46HDCI.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-CLJLQXFQ.mjs.map → chunk-7IY2Y73Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-F7EWDYTE.mjs.map → chunk-7QJYTQSU.mjs.map} +0 -0
- /package/dist/esm/{chunk-KNMWDGP4.mjs.map → chunk-BA4TDBYB.mjs.map} +0 -0
- /package/dist/esm/{chunk-Y6PVFMBS.mjs.map → chunk-BDTDWLGO.mjs.map} +0 -0
- /package/dist/esm/{chunk-OBOOY2QD.mjs.map → chunk-CBAVJ5EN.mjs.map} +0 -0
- /package/dist/esm/{chunk-GMG4VR3K.mjs.map → chunk-DBJTMCAG.mjs.map} +0 -0
- /package/dist/esm/{chunk-OZZDXS26.mjs.map → chunk-DYJVDOBH.mjs.map} +0 -0
- /package/dist/esm/{chunk-PXTMLJKO.mjs.map → chunk-EHJEK7FU.mjs.map} +0 -0
- /package/dist/esm/{chunk-TZ623H2V.mjs.map → chunk-ELWWME6B.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-MWAMLQ25.mjs.map → chunk-GMOHGD73.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-F6K26WV5.mjs.map → chunk-IU5JZNH4.mjs.map} +0 -0
- /package/dist/esm/{chunk-HC5VMNXA.mjs.map → chunk-KR5JAN32.mjs.map} +0 -0
- /package/dist/esm/{chunk-5OPOJ43H.mjs.map → chunk-KVJ2KGMW.mjs.map} +0 -0
- /package/dist/esm/{chunk-APSQ4M23.mjs.map → chunk-LBNMY7EM.mjs.map} +0 -0
- /package/dist/esm/{chunk-GIZLK7M7.mjs.map → chunk-MNFGMNYS.mjs.map} +0 -0
- /package/dist/esm/{chunk-WTGGCH34.mjs.map → chunk-N25GOEVL.mjs.map} +0 -0
- /package/dist/esm/{chunk-XX2Z26FH.mjs.map → chunk-NBSXZKMQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-JI2BBZ2W.mjs.map → chunk-NFGAZSSK.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-ZFK7QD3B.mjs.map → chunk-NZ36UN4C.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-P5747ZYC.mjs.map → chunk-PEBXSNMJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-QEXAMHPU.mjs.map → chunk-PLY7MQKE.mjs.map} +0 -0
- /package/dist/esm/{chunk-XMUUI6HG.mjs.map → chunk-PRKZ2KJ4.mjs.map} +0 -0
- /package/dist/esm/{chunk-SSJQOXEP.mjs.map → chunk-PZ5JKQSP.mjs.map} +0 -0
- /package/dist/esm/{chunk-NZSGGL25.mjs.map → chunk-Q3R3KKKP.mjs.map} +0 -0
- /package/dist/esm/{chunk-3F5WV6US.mjs.map → chunk-RCYWJZR4.mjs.map} +0 -0
- /package/dist/esm/{chunk-2YQXX64E.mjs.map → chunk-TTICPGX6.mjs.map} +0 -0
- /package/dist/esm/{chunk-KKER5KL4.mjs.map → chunk-UES76WF2.mjs.map} +0 -0
- /package/dist/esm/{chunk-G36AY4R7.mjs.map → chunk-UR5E2UDO.mjs.map} +0 -0
- /package/dist/esm/{chunk-XITLXPBK.mjs.map → chunk-VMCFN5CT.mjs.map} +0 -0
- /package/dist/esm/{chunk-EFRFDFS4.mjs.map → chunk-W44E6YAW.mjs.map} +0 -0
- /package/dist/esm/{chunk-5ZVCSKFX.mjs.map → chunk-WXISFVRU.mjs.map} +0 -0
- /package/dist/esm/{chunk-GEZSEAL5.mjs.map → chunk-X7QBDRQR.mjs.map} +0 -0
- /package/dist/esm/{chunk-SGTFMSOG.mjs.map → chunk-Y5RQOXZH.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZJUDDSWN.mjs.map → chunk-ZKFDLJ2F.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as E,f as H,g as K,h as P,i as S,j as f}from"./chunk-LR65XHSF.mjs";import{a as h,b as p,c as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as E,f as H,g as K,h as P,i as S,j as f}from"./chunk-LR65XHSF.mjs";import{a as h,b as p,c as m}from"./chunk-EHJEK7FU.mjs";import{b as s}from"./chunk-NL72WE3E.mjs";import o from"tweetnacl";var i=class i extends h{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==i.LENGTH)throw new Error(`PublicKey length should be ${i.LENGTH}`);this.key=t}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:t,signature:a}=e,y=s.fromHexInput(t).toUint8Array(),c=a.toUint8Array();return o.sign.detached.verify(y,c,this.key.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new i(t)}static load(e){let t=e.deserializeBytes();return new i(t)}static isPublicKey(e){return e instanceof i}};i.LENGTH=32;var l=i,r=class r extends p{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==r.LENGTH)throw new Error(`PrivateKey length should be ${r.LENGTH}`);this.signingKeyPair=o.sign.keyPair.fromSeed(t.toUint8Array().slice(0,r.LENGTH))}toUint8Array(){return this.signingKeyPair.secretKey.slice(0,r.LENGTH)}toString(){return s.fromHexInput(this.toUint8Array()).toString()}sign(e){let t=s.fromHexInput(e),a=o.sign.detached(t.toUint8Array(),this.signingKeyPair.secretKey);return new d(a)}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new r(t)}static generate(){let e=o.sign.keyPair();return new r(e.secretKey.slice(0,r.LENGTH))}publicKey(){let e=this.signingKeyPair.publicKey;return new l(e)}static fromDerivationPath(e,t){if(!H(e))throw new Error(`Invalid derivation path ${e}`);return r.fromDerivationPathInner(e,f(t))}static fromDerivationPathInner(e,t,a=E){let{key:y,chainCode:c}=K(r.SLIP_0010_SEED,t),x=S(e).map(u=>parseInt(u,10)),{key:z}=x.reduce((u,A)=>P(u,A+a),{key:y,chainCode:c});return new r(z)}static isPrivateKey(e){return e instanceof r}};r.LENGTH=32,r.SLIP_0010_SEED="ed25519 seed";var v=r,n=class n extends m{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==n.LENGTH)throw new Error(`Signature length should be ${n.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 n(t)}static load(e){let t=e.deserializeBytes();return new n(t)}static isSignature(e){return e instanceof n}};n.LENGTH=64;var d=n;export{l as a,v as b,d as c};
|
|
2
|
+
//# sourceMappingURL=chunk-5HZKDT5C.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{m as g,v as i}from"./chunk-BQSE5HHW.mjs";import{b as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{m as g,v as i}from"./chunk-BQSE5HHW.mjs";import{b as n}from"./chunk-NFGAZSSK.mjs";import{b as a,c}from"./chunk-KR5JAN32.mjs";async function l(o){let{aptosConfig:e}=o,{data:t}=await n({aptosConfig:e,originMethod:"getLedgerInfo",path:""});return t}async function h(o){let{aptosConfig:e,ledgerVersion:t,options:s}=o,{data:r}=await n({aptosConfig:e,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return r}async function m(o){let{aptosConfig:e,blockHeight:t,options:s}=o,{data:r}=await n({aptosConfig:e,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return r}async function C(o){let{aptosConfig:e,handle:t,data:s,options:r}=o;return(await a({aptosConfig:e,originMethod:"getTableItem",path:`tables/${t}/item`,params:{ledger_version:r?.ledgerVersion},body:s})).data}async function T(o){let{aptosConfig:e,payload:t,options:s}=o,{data:r}=await a({aptosConfig:e,originMethod:"view",path:"view",params:{ledger_version:s?.ledgerVersion},body:{function:t.function,type_arguments:t.typeArguments??[],arguments:t.functionArguments??[]}});return r}async function q(o){let{aptosConfig:e,limit:t}=o;return(await p({aptosConfig:e,query:{query:g,variables:{limit:t}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function p(o){let{aptosConfig:e,query:t,originMethod:s}=o,{data:r}=await c({aptosConfig:e,originMethod:s??"queryIndexer",path:"",body:t,overrides:{WITH_CREDENTIALS:!1}});return r}async function f(o){let{aptosConfig:e}=o;return(await p({aptosConfig:e,query:{query:i},originMethod:"getProcessorStatuses"})).processor_status}async function w(o){return(await f({aptosConfig:o.aptosConfig}))[0].last_success_version}async function A(o){let{aptosConfig:e,processorType:t}=o,s={processor:{_eq:t.valueOf()}};return(await p({aptosConfig:e,query:{query:i,variables:{where_condition:s}},originMethod:"getProcessorStatus"})).processor_status[0]}export{l as a,h as b,m as c,C as d,T as e,q as f,p as g,f as h,w as i,A as j};
|
|
2
|
+
//# sourceMappingURL=chunk-5IVRKK5V.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-DBJTMCAG.mjs";import{g as t}from"./chunk-X7QBDRQR.mjs";var r=class{constructor(o){this.config=o}async fundAccount(o){let n=await i({aptosConfig:this.config,...o});return o.options?.waitForIndexer!==!1&&await t({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version)}),n}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5SRMD5C6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R}from"./chunk-W4JEP5GW.mjs";import{a as d}from"./chunk-6FBKUTGF.mjs";var l={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function p(n,a){let{url:o,method:u,body:i,contentType:s,params:e,overrides:t}=n,r={...t?.HEADERS,"x-aptos-client":`aptos-ts-sdk/${R}`,"content-type":s??"application/json"};return t?.AUTH_TOKEN&&o.includes("faucet")&&(r.Authorization=`Bearer ${t?.AUTH_TOKEN}`),t?.API_KEY&&!o.includes("faucet")&&(r.Authorization=`Bearer ${t?.API_KEY}`),a.provider({url:o,method:u,body:i,params:e,headers:r,overrides:t})}async function T(n,a){let{url:o,path:u}=n,i=`${o}/${u??""}`,s=await p({...n,url:i},a.client),e={status:s.status,statusText:s.statusText,data:s.data,headers:s.headers,config:s.config,request:s.request,url:i};if(a.isIndexerRequest(o)){let r=e.data;if(r.errors)throw new d(n,e,r.errors[0].message??`Unhandled Error ${s.status} : ${s.statusText}`);e.data=r.data}if(e.status>=200&&e.status<300)return e;let t;throw e&&e.data&&"message"in e.data&&"error_code"in e.data?t=JSON.stringify(e.data):e.status in l?t=l[e.status]:t=`Unhandled Error ${e.status} : ${e.statusText}`,new d(n,e,t)}export{p as a,T as b};
|
|
2
|
+
//# sourceMappingURL=chunk-5X46HDCI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-F2GFSFPW.mjs";import{a as r}from"./chunk-IU5JZNH4.mjs";var t=class l extends r{constructor(e){super();this.value=new i(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let a=i.deserialize(e,s);return new l(a.value)}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6DYNAFAP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-KVJ2KGMW.mjs";import{a as p,b as g}from"./chunk-4K252UDE.mjs";import{a as A}from"./chunk-NMFS5KAE.mjs";import{a as h}from"./chunk-OWP2MKTX.mjs";import{a as d,c as b}from"./chunk-5HZKDT5C.mjs";import{a as y}from"./chunk-IU5JZNH4.mjs";var n=class extends y{static deserialize(t){let i=t.deserializeUleb128AsU32();switch(i){case 0:return a.load(t);case 1:return u.load(t);case 2:return l.load(t);case 3:return c.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${i}`)}}isEd25519(){return this instanceof a}isMultiEd25519(){return this instanceof u}isSingleKey(){return this instanceof l}isMultiKey(){return this instanceof c}},a=class s extends n{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(0),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=d.deserialize(i),r=b.deserialize(i);return new s(e,r)}},u=class s extends n{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(1),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=p.deserialize(i),r=g.deserialize(i);return new s(e,r)}},l=class s extends n{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(2),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=h.deserialize(i),r=o.deserialize(i);return new s(e,r)}},c=class s extends n{constructor(i,e,r){super();this.public_keys=i,this.signatures=e,this.signatures_bitmap=r}serialize(i){i.serializeU32AsUleb128(3),this.public_keys.serialize(i),i.serializeVector(this.signatures),i.serializeBytes(this.signatures_bitmap)}static load(i){let e=A.deserialize(i),r=i.deserializeVector(o),z=i.deserializeBytes();return new s(e,r,z)}};export{n as a,a as b,u as c,l as d,c as e};
|
|
2
|
+
//# sourceMappingURL=chunk-6F4ACCCZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-VMCFN5CT.mjs";import{a as o}from"./chunk-IU5JZNH4.mjs";import{b as z}from"./chunk-NL72WE3E.mjs";var t=class n extends o{constructor(e){super();this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(!(this.values[0]instanceof s)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let i=z.fromHexInput(e);r=Array.from(i.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type");return new n(r.map(i=>new s(i)))}static U16(e){return new n(e.map(r=>new u(r)))}static U32(e){return new n(e.map(r=>new c(r)))}static U64(e){return new n(e.map(r=>new d(r)))}static U128(e){return new n(e.map(r=>new m(r)))}static U256(e){return new n(e.map(r=>new U(r)))}static Bool(e){return new n(e.map(r=>new l(r)))}static MoveString(e){return new n(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let i=e.deserializeUleb128AsU32(),y=new Array;for(let w=0;w<i;w+=1)y.push(r.deserialize(e));return new n(y)}},a=class n extends o{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let r=this.bcsToBytes().slice(1);t.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new n(e.deserializeStr())}},f=class n extends o{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new n(e!=null?new s(e):void 0)}static U16(e){return new n(e!=null?new u(e):void 0)}static U32(e){return new n(e!=null?new c(e):void 0)}static U64(e){return new n(e!=null?new d(e):void 0)}static U128(e){return new n(e!=null?new m(e):void 0)}static U256(e){return new n(e!=null?new U(e):void 0)}static Bool(e){return new n(e!=null?new l(e):void 0)}static MoveString(e){return new n(e!=null?new a(e):void 0)}static deserialize(e,r){let i=t.deserialize(e,r);return new n(i.values[0])}};export{t as a,a as b,f as c};
|
|
2
|
+
//# sourceMappingURL=chunk-7B3VSBCX.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g,d as m,e as l,g as P,h as I,k as C}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g,d as m,e as l,g as P,h as I,k as C}from"./chunk-MNFGMNYS.mjs";import{a as T}from"./chunk-HQ4DGB7L.mjs";import{a as d}from"./chunk-Y5RQOXZH.mjs";import{a as y}from"./chunk-PZ5JKQSP.mjs";import{b as p}from"./chunk-UR5E2UDO.mjs";import{a as r}from"./chunk-7B3VSBCX.mjs";import{b as f}from"./chunk-VMCFN5CT.mjs";import{b as A}from"./chunk-KR5JAN32.mjs";async function S(n){let a=await b(n);return h(n,a)}async function b(n){let{aptosConfig:a,data:t}=n,e,o;return"bytecode"in t?(e=t,o=await g(e)):"multisigAddress"in t?(e={aptosConfig:a,multisigAddress:t.multisigAddress,function:t.function,functionArguments:t.functionArguments,typeArguments:t.typeArguments},o=await g(e)):(e={aptosConfig:a,function:t.function,functionArguments:t.functionArguments,typeArguments:t.typeArguments},o=await g(e)),o}async function h(n,a){let{aptosConfig:t,sender:e,options:o}=n,i;if(x(n)&&(i=p.ZERO.toString()),D(n)){let{secondarySignerAddresses:s}=n;return m({aptosConfig:t,sender:e,payload:a,options:o,secondarySignerAddresses:s,feePayerAddress:i})}return m({aptosConfig:t,sender:e,payload:a,options:o,feePayerAddress:i})}function x(n){return n.withFeePayer===!0}function D(n){return"secondarySignerAddresses"in n}function j(n){let{transaction:a}=n;return C(a)}function G(n){return P({...n})}async function J(n){let{aptosConfig:a,transaction:t,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:s}=n,c=l({transaction:t,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:s}),{data:u}=await A({aptosConfig:a,body:c,path:"transactions/simulate",params:{estimate_gas_unit_price:n.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:n.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:n.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return u}async function _(n){let{aptosConfig:a}=n,t=I({...n}),{data:e}=await A({aptosConfig:a,body:t,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return e}async function U(n){let{aptosConfig:a,signer:t,transaction:e}=n,o=G({signer:t,transaction:e});return _({aptosConfig:a,transaction:e,senderAuthenticator:o})}async function L(n){let{aptosConfig:a,account:t,metadataBytes:e,moduleBytecode:o,options:i}=n,s=o.map(u=>r.U8(u));return await S({aptosConfig:a,sender:p.from(t),data:{function:"0x1::code::publish_package_txn",functionArguments:[r.U8(e),new r(s)]},options:i})}async function Q(n){let{aptosConfig:a,fromAccount:t,toNewPrivateKey:e}=n,o=await d({aptosConfig:a,accountAddress:t.accountAddress}),i=y.fromPrivateKey({privateKey:e,legacy:!0}),c=new T({sequenceNumber:BigInt(o.sequence_number),originator:t.accountAddress,currentAuthKey:p.from(o.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),u=t.sign(c),w=i.sign(c),R=await S({aptosConfig:a,sender:t.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new f(t.signingScheme.valueOf()),r.U8(t.publicKey.toUint8Array()),new f(i.signingScheme.valueOf()),r.U8(i.publicKey.toUint8Array()),r.U8(u.toUint8Array()),r.U8(w.toUint8Array())]}});return await U({aptosConfig:a,signer:t,transaction:R})}export{S as a,b,h as c,j as d,G as e,J as f,_ as g,U as h,L as i,Q as j};
|
|
2
|
+
//# sourceMappingURL=chunk-7IY2Y73Q.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as r}from"./chunk-UR5E2UDO.mjs";import{a as i}from"./chunk-F2GFSFPW.mjs";import{a,b as g,c as f}from"./chunk-7B3VSBCX.mjs";import{a as o,b as u,c as s,d as c,e as p,f as y,g as m}from"./chunk-VMCFN5CT.mjs";function M(n){return typeof n=="boolean"}function D(n){return typeof n=="string"}function N(n){return typeof n=="number"}function P(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function w(n){return n==null}function G(n){return A(n)||x(n)||S(n)||B(n)||U(n)||I(n)||b(n)||T(n)||E(n)||d(n)||n instanceof a||n instanceof f}function A(n){return n instanceof o}function T(n){return n instanceof r}function E(n){return n instanceof g}function d(n){return n instanceof i}function x(n){return n instanceof u}function S(n){return n instanceof s}function B(n){return n instanceof c}function U(n){return n instanceof p}function I(n){return n instanceof y}function b(n){return n instanceof m}function $(n){return"bytecode"in n}function R(n,t){throw new Error(`Type mismatch for argument ${t}, expected '${n}'`)}function W(n){let t=n.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?n.params.length:t}function L(n){let t=n.split("::");if(t.length!==3)throw new Error(`Invalid function ${n}`);let e=t[0],F=t[1],l=t[2];return{moduleAddress:e,moduleName:F,functionName:l}}export{M as a,D as b,N as c,P as d,w as e,G as f,A as g,T as h,E as i,d as j,x as k,S as l,B as m,U as n,I as o,b as p,$ as q,R as r,W as s,L as t};
|
|
2
|
+
//# sourceMappingURL=chunk-7QJYTQSU.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r,b as i,c as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r,b as i,c as s}from"./chunk-ZKFDLJ2F.mjs";import{a as o}from"./chunk-LBNMY7EM.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorTypes:["stake_processor"]}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorTypes:["stake_processor"]}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorTypes:["stake_processor"]}),s({aptosConfig:this.config,...e})}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BA4TDBYB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-Y5RQOXZH.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BDTDWLGO.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-NLONZHYT.mjs";import{b as n}from"./chunk-UR5E2UDO.mjs";import{a as x}from"./chunk-IU5JZNH4.mjs";var t=class extends x{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return u.load(e);case 1:return c.load(e);case 2:return p.load(e);case 3:return z.load(e);case 4:return S.load(e);case 5:return U.load(e);case 6:return y.load(e);case 7:return b.load(e);case 8:return d.load(e);case 9:return g.load(e);case 10:return T.load(e);case 255:return h.load(e);default:throw new Error(`Unknown variant index for TypeTag: ${r}`)}}isBool(){return this instanceof u}isAddress(){return this instanceof S}isGeneric(){return this instanceof h}isSigner(){return this instanceof U}isVector(){return this instanceof y}isStruct(){return this instanceof b}isU8(){return this instanceof c}isU16(){return this instanceof d}isU32(){return this instanceof g}isU64(){return this instanceof p}isU128(){return this instanceof z}isU256(){return this instanceof T}},u=class i extends t{toString(){return"bool"}serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new i}},c=class i extends t{toString(){return"u8"}serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new i}},d=class i extends t{toString(){return"u16"}serialize(e){e.serializeU32AsUleb128(8)}static load(e){return new i}},g=class i extends t{toString(){return"u32"}serialize(e){e.serializeU32AsUleb128(9)}static load(e){return new i}},p=class i extends t{toString(){return"u64"}serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new i}},z=class i extends t{toString(){return"u128"}serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new i}},T=class i extends t{toString(){return"u256"}serialize(e){e.serializeU32AsUleb128(10)}static load(e){return new i}},S=class i extends t{toString(){return"address"}serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new i}},U=class i extends t{toString(){return"signer"}serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new i}},f=class i extends t{constructor(r){super();this.value=r}toString(){return`&${this.value.toString()}`}serialize(r){r.serializeU32AsUleb128(254)}static load(r){let s=t.deserialize(r);return new i(s)}},h=class i extends t{constructor(r){super();this.value=r;if(r<0)throw new Error("Generic type parameter index cannot be negative")}toString(){return`T${this.value}`}serialize(r){r.serializeU32AsUleb128(255),r.serializeU32(this.value)}static load(r){let s=r.deserializeU32();return new i(s)}},y=class i extends t{constructor(r){super();this.value=r}toString(){return`vector<${this.value.toString()}>`}serialize(r){r.serializeU32AsUleb128(6),this.value.serialize(r)}static load(r){let s=t.deserialize(r);return new i(s)}},b=class i extends t{constructor(r){super();this.value=r}toString(){let r="";return this.value.typeArgs.length>0&&(r=`<${this.value.typeArgs.map(s=>s.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${r}`}serialize(r){r.serializeU32AsUleb128(7),this.value.serialize(r)}static load(r){let s=o.deserialize(r);return new i(s)}isTypeTag(r,s,l){return this.value.moduleName.identifier===s&&this.value.name.identifier===l&&this.value.address.equals(r)}isString(){return this.isTypeTag(n.ONE,"string","String")}isOption(){return this.isTypeTag(n.ONE,"option","Option")}isObject(){return this.isTypeTag(n.ONE,"object","Object")}},o=class i extends x{constructor(r,s,l,v){super();this.address=r,this.moduleName=s,this.name=l,this.typeArgs=v}serialize(r){r.serialize(this.address),r.serialize(this.moduleName),r.serialize(this.name),r.serializeVector(this.typeArgs)}static deserialize(r){let s=n.deserialize(r),l=a.deserialize(r),v=a.deserialize(r),A=r.deserializeVector(t);return new i(s,l,v,A)}};function E(){return new o(n.ONE,new a("aptos_coin"),new a("AptosCoin"),[])}function j(){return new o(n.ONE,new a("string"),new a("String"),[])}function V(i){return new o(n.ONE,new a("option"),new a("Option"),[i])}function G(i){return new o(n.ONE,new a("object"),new a("Object"),[i])}export{t as a,u as b,c,d,g as e,p as f,z as g,T as h,S as i,U as j,f as k,h as l,y as m,b as n,o,E as p,j as q,V as r,G as s};
|
|
2
|
+
//# sourceMappingURL=chunk-C3Y52GHM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/typeTag/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable max-classes-per-file */\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { AccountAddress } from \"../../core\";\nimport { Identifier } from \"../instances/identifier\";\nimport { TypeTagVariants } from \"../../types\";\n\nexport abstract class TypeTag extends Serializable {\n abstract serialize(serializer: Serializer): void;\n\n static deserialize(deserializer: Deserializer): TypeTag {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case TypeTagVariants.Bool:\n return TypeTagBool.load(deserializer);\n case TypeTagVariants.U8:\n return TypeTagU8.load(deserializer);\n case TypeTagVariants.U64:\n return TypeTagU64.load(deserializer);\n case TypeTagVariants.U128:\n return TypeTagU128.load(deserializer);\n case TypeTagVariants.Address:\n return TypeTagAddress.load(deserializer);\n case TypeTagVariants.Signer:\n return TypeTagSigner.load(deserializer);\n case TypeTagVariants.Vector:\n return TypeTagVector.load(deserializer);\n case TypeTagVariants.Struct:\n return TypeTagStruct.load(deserializer);\n case TypeTagVariants.U16:\n return TypeTagU16.load(deserializer);\n case TypeTagVariants.U32:\n return TypeTagU32.load(deserializer);\n case TypeTagVariants.U256:\n return TypeTagU256.load(deserializer);\n case TypeTagVariants.Generic:\n // This is only used for ABI representation, and cannot actually be used as a type.\n return TypeTagGeneric.load(deserializer);\n default:\n throw new Error(`Unknown variant index for TypeTag: ${index}`);\n }\n }\n\n abstract toString(): string;\n\n isBool(): this is TypeTagBool {\n return this instanceof TypeTagBool;\n }\n\n isAddress(): this is TypeTagAddress {\n return this instanceof TypeTagAddress;\n }\n\n isGeneric(): this is TypeTagGeneric {\n return this instanceof TypeTagGeneric;\n }\n\n isSigner(): this is TypeTagSigner {\n return this instanceof TypeTagSigner;\n }\n\n isVector(): this is TypeTagVector {\n return this instanceof TypeTagVector;\n }\n\n isStruct(): this is TypeTagStruct {\n return this instanceof TypeTagStruct;\n }\n\n isU8(): this is TypeTagU8 {\n return this instanceof TypeTagU8;\n }\n\n isU16(): this is TypeTagU16 {\n return this instanceof TypeTagU16;\n }\n\n isU32(): this is TypeTagU32 {\n return this instanceof TypeTagU32;\n }\n\n isU64(): this is TypeTagU64 {\n return this instanceof TypeTagU64;\n }\n\n isU128(): this is TypeTagU128 {\n return this instanceof TypeTagU128;\n }\n\n isU256(): this is TypeTagU256 {\n return this instanceof TypeTagU256;\n }\n}\n\nexport class TypeTagBool extends TypeTag {\n toString(): string {\n return \"bool\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Bool);\n }\n\n static load(_deserializer: Deserializer): TypeTagBool {\n return new TypeTagBool();\n }\n}\n\nexport class TypeTagU8 extends TypeTag {\n toString(): string {\n return \"u8\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U8);\n }\n\n static load(_deserializer: Deserializer): TypeTagU8 {\n return new TypeTagU8();\n }\n}\n\nexport class TypeTagU16 extends TypeTag {\n toString(): string {\n return \"u16\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U16);\n }\n\n static load(_deserializer: Deserializer): TypeTagU16 {\n return new TypeTagU16();\n }\n}\n\nexport class TypeTagU32 extends TypeTag {\n toString(): string {\n return \"u32\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U32);\n }\n\n static load(_deserializer: Deserializer): TypeTagU32 {\n return new TypeTagU32();\n }\n}\n\nexport class TypeTagU64 extends TypeTag {\n toString(): string {\n return \"u64\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U64);\n }\n\n static load(_deserializer: Deserializer): TypeTagU64 {\n return new TypeTagU64();\n }\n}\n\nexport class TypeTagU128 extends TypeTag {\n toString(): string {\n return \"u128\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U128);\n }\n\n static load(_deserializer: Deserializer): TypeTagU128 {\n return new TypeTagU128();\n }\n}\n\nexport class TypeTagU256 extends TypeTag {\n toString(): string {\n return \"u256\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U256);\n }\n\n static load(_deserializer: Deserializer): TypeTagU256 {\n return new TypeTagU256();\n }\n}\n\nexport class TypeTagAddress extends TypeTag {\n toString(): string {\n return \"address\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Address);\n }\n\n static load(_deserializer: Deserializer): TypeTagAddress {\n return new TypeTagAddress();\n }\n}\n\nexport class TypeTagSigner extends TypeTag {\n toString(): string {\n return \"signer\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Signer);\n }\n\n static load(_deserializer: Deserializer): TypeTagSigner {\n return new TypeTagSigner();\n }\n}\n\nexport class TypeTagReference extends TypeTag {\n toString(): `&${string}` {\n return `&${this.value.toString()}`;\n }\n\n constructor(public readonly value: TypeTag) {\n super();\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Reference);\n }\n\n static load(deserializer: Deserializer): TypeTagReference {\n const value = TypeTag.deserialize(deserializer);\n return new TypeTagReference(value);\n }\n}\n\n/**\n * Generics are used for type parameters in entry functions. However,\n * they are not actually serialized into a real type, so they cannot be\n * used as a type directly.\n */\nexport class TypeTagGeneric extends TypeTag {\n toString(): `T${number}` {\n return `T${this.value}`;\n }\n\n constructor(public readonly value: number) {\n super();\n if (value < 0) throw new Error(\"Generic type parameter index cannot be negative\");\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Generic);\n serializer.serializeU32(this.value);\n }\n\n static load(deserializer: Deserializer): TypeTagGeneric {\n const value = deserializer.deserializeU32();\n return new TypeTagGeneric(value);\n }\n}\n\nexport class TypeTagVector extends TypeTag {\n toString(): `vector<${string}>` {\n return `vector<${this.value.toString()}>`;\n }\n\n constructor(public readonly value: TypeTag) {\n super();\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Vector);\n this.value.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TypeTagVector {\n const value = TypeTag.deserialize(deserializer);\n return new TypeTagVector(value);\n }\n}\n\nexport class TypeTagStruct extends TypeTag {\n toString(): `0x${string}::${string}::${string}` {\n // Collect type args and add it if there are any\n let typePredicate = \"\";\n if (this.value.typeArgs.length > 0) {\n typePredicate = `<${this.value.typeArgs.map((typeArg) => typeArg.toString()).join(\", \")}>`;\n }\n\n return `${this.value.address.toString()}::${this.value.moduleName.identifier}::${\n this.value.name.identifier\n }${typePredicate}`;\n }\n\n constructor(public readonly value: StructTag) {\n super();\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Struct);\n this.value.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TypeTagStruct {\n const value = StructTag.deserialize(deserializer);\n return new TypeTagStruct(value);\n }\n\n isTypeTag(address: AccountAddress, moduleName: string, structName: string): boolean {\n return (\n this.value.moduleName.identifier === moduleName &&\n this.value.name.identifier === structName &&\n this.value.address.equals(address)\n );\n }\n\n isString(): boolean {\n return this.isTypeTag(AccountAddress.ONE, \"string\", \"String\");\n }\n\n isOption(): boolean {\n return this.isTypeTag(AccountAddress.ONE, \"option\", \"Option\");\n }\n\n isObject(): boolean {\n return this.isTypeTag(AccountAddress.ONE, \"object\", \"Object\");\n }\n}\n\nexport class StructTag extends Serializable {\n public readonly address: AccountAddress;\n\n public readonly moduleName: Identifier;\n\n public readonly name: Identifier;\n\n public readonly typeArgs: Array<TypeTag>;\n\n constructor(address: AccountAddress, module_name: Identifier, name: Identifier, type_args: Array<TypeTag>) {\n super();\n this.address = address;\n this.moduleName = module_name;\n this.name = name;\n this.typeArgs = type_args;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serialize(this.address);\n serializer.serialize(this.moduleName);\n serializer.serialize(this.name);\n serializer.serializeVector(this.typeArgs);\n }\n\n static deserialize(deserializer: Deserializer): StructTag {\n const address = AccountAddress.deserialize(deserializer);\n const moduleName = Identifier.deserialize(deserializer);\n const name = Identifier.deserialize(deserializer);\n const typeArgs = deserializer.deserializeVector(TypeTag);\n return new StructTag(address, moduleName, name, typeArgs);\n }\n}\n\nexport function aptosCoinStructTag(): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"aptos_coin\"), new Identifier(\"AptosCoin\"), []);\n}\n\nexport function stringStructTag(): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"string\"), new Identifier(\"String\"), []);\n}\n\nexport function optionStructTag(typeArg: TypeTag): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"option\"), new Identifier(\"Option\"), [typeArg]);\n}\n\nexport function objectStructTag(typeArg: TypeTag): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"object\"), new Identifier(\"Object\"), [typeArg]);\n}\n"],"mappings":"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","names":["TypeTag","Serializable","deserializer","index","TypeTagBool","TypeTagU8","TypeTagU64","TypeTagU128","TypeTagAddress","TypeTagSigner","TypeTagVector","TypeTagStruct","TypeTagU16","TypeTagU32","TypeTagU256","TypeTagGeneric","_TypeTagBool","serializer","_deserializer","_TypeTagU8","_TypeTagU16","_TypeTagU32","_TypeTagU64","_TypeTagU128","_TypeTagU256","_TypeTagAddress","_TypeTagSigner","TypeTagReference","_TypeTagReference","value","_TypeTagGeneric","_TypeTagVector","_TypeTagStruct","typePredicate","typeArg","StructTag","address","moduleName","structName","AccountAddress","_StructTag","module_name","name","type_args","Identifier","typeArgs","aptosCoinStructTag","stringStructTag","optionStructTag","objectStructTag"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as r}from"./chunk-UR5E2UDO.mjs";import{g as d}from"./chunk-5IVRKK5V.mjs";import{q as c}from"./chunk-BQSE5HHW.mjs";async function v(o){let{accountAddress:t,aptosConfig:e,creationNumber:n}=o,i={account_address:{_eq:r.from(t).toStringLong()},creation_number:{_eq:n}};return p({aptosConfig:e,options:{where:i}})}async function y(o){let{accountAddress:t,aptosConfig:e,eventType:n,options:s}=o,a={where:{account_address:{_eq:r.from(t).toStringLong()},indexed_type:{_eq:n}},pagination:s,orderBy:s?.orderBy};return p({aptosConfig:e,options:a})}async function p(o){let{aptosConfig:t,options:e}=o,n={query:c,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await d({aptosConfig:t,query:n,originMethod:"getEvents"})).events}export{v as a,y as b,p as c};
|
|
2
|
+
//# sourceMappingURL=chunk-CBAVJ5EN.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as e}from"./chunk-X7QBDRQR.mjs";import{b as c}from"./chunk-UR5E2UDO.mjs";import{d as r}from"./chunk-KR5JAN32.mjs";import{e as s}from"./chunk-EOC4UI5B.mjs";async function x(a){let{aptosConfig:t,accountAddress:i,amount:p,options:n}=a,u=n?.timeoutSecs||s,{data:d}=await r({aptosConfig:t,path:"fund",body:{address:c.from(i).toString(),amount:p},originMethod:"fundAccount"}),m=d.txn_hashes[0],o=await e({aptosConfig:t,transactionHash:m,options:{timeoutSecs:u,checkSuccess:n?.checkSuccess}});if(o.type==="user_transaction")return o;throw new Error(`Unexpected transaction received for fund account: ${o.type}`)}export{x as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DBJTMCAG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-BDTDWLGO.mjs";import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as h,h as d}from"./chunk-7IY2Y73Q.mjs";import{f as u}from"./chunk-X7QBDRQR.mjs";var p="fulfilled",f=class{constructor(t,n,e=30,s=100,r=10){this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=n,this.started=!1,this.accountSequnceNumber=new l(t,n,e,s,r)}async submitNextTransaction(){try{for(;;){if(this.transactionsQueue.isEmpty())return;let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let n=await this.generateNextTransaction(this.account,t);if(!n)return;let e=d({aptosConfig:this.aptosConfig,transaction:n,signer:this.account});await this.outstandingTransactions.enqueue([e,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],n=[],[e,s]=await this.outstandingTransactions.dequeue();for(t.push(e),n.push(s);!this.outstandingTransactions.isEmpty();)[e,s]=await this.outstandingTransactions.dequeue(),t.push(e),n.push(s);let r=await Promise.allSettled(t);for(let a=0;a<r.length&&a<n.length;a+=1){let i=r[a];s=n[a],i.status===p?(this.sentTransactions.push([i.value.hash,s,null]),await this.checkTransaction(i,s)):this.sentTransactions.push([i.status,s,i.reason])}}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,n){try{let e=[];e.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let s=await Promise.allSettled(e);for(let r=0;r<s.length;r+=1){let a=s[r];a.status===p?this.executedTransactions.push([a.value.hash,n,null]):this.executedTransactions.push([a.status,n,a.reason])}}catch(e){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${e}`)}}async push(t,n){await this.transactionsQueue.enqueue([t,n])}async generateNextTransaction(t,n){if(this.transactionsQueue.isEmpty())return;let[e,s]=await this.transactionsQueue.dequeue();return await h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:e,options:{...s,accountSequenceNumber:n}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{f as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DYJVDOBH.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-7IY2Y73Q.mjs";import{f as n}from"./chunk-EOC4UI5B.mjs";async function A(o){let{aptosConfig:r,sender:e,recipient:i,amount:c,coinType:s,options:a}=o,p=s??n;return await t({aptosConfig:r,sender:e.accountAddress,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[p],functionArguments:[i,c]},options:a})}export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ELWWME6B.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-IU5JZNH4.mjs";import{b as i}from"./chunk-NL72WE3E.mjs";var t=class a extends r{constructor(e){super();this.value=i.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,s){let o=e.deserializeFixedBytes(s);return new a(o)}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-F2GFSFPW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as l,c as f,d as x,e as v,f as U,g as A,h as P,i as C,j as y,k as E,l as b,m as I,n as G,o as M}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as l,c as f,d as x,e as v,f as U,g as A,h as P,i as C,j as y,k as E,l as b,m as I,n as G,o as M}from"./chunk-C3Y52GHM.mjs";import{a as d}from"./chunk-NLONZHYT.mjs";import{b as w}from"./chunk-UR5E2UDO.mjs";function N(e){return!!e.match(/^[_a-zA-Z0-9]+$/)}function V(e){return!!e.match(/\s/)}function $(e){return!!e.match(/^T[0-9]+$/)}function F(e,n){let i=n;for(;i<e.length;i+=1){let c=e[i];if(!V(c))break}return i}var S=(t=>(t.InvalidTypeTag="unknown type",t.UnexpectedGenericType="unexpected generic 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))(S||{}),r=class extends Error{constructor(n,i){super(`Failed to parse typeTag '${n}', ${i}`)}};function Z(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 _=m(a,o,i);p.push(_)}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:h,savedTypes:t,savedExpectedTypes:W}=s;o=p,p=t,a=h,u=W}else if(g===","){if(a.length!==0){let s=m(a,o,i);o=[],p.push(s),a="",u+=1}}else if(V(g)){let s=!1;if(a.length!==0){let t=m(a,o,i);o=[],p.push(t),a="",s=!0}T=F(e,T);let h=e[T];if(T<e.length&&s&&h!==","&&h!==">")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 m(a,o,i);case 1:if(a==="")return p[0];throw new r(e,"unexpected ','");default:throw new r(e,"unexpected whitespace character")}}function m(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 y);case"signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new y;case"bool":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new l;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 U;case"u128":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new A;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($(e)){if(i)return new b(Number(e.split("T")[1]));throw new r(e,"unexpected generic type")}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(!N(c[1]))throw new r(e,"module name must only contain alphanumeric or '_' characters");if(!N(c[2]))throw new r(e,"struct name must only contain alphanumeric or '_' characters");return new G(new M(w.fromString(c[0]),new d(c[1]),new d(c[2]),n))}}export{S as a,r as b,Z as c};
|
|
2
|
+
//# sourceMappingURL=chunk-F52GIFKT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-IU5JZNH4.mjs";var r=class a extends i{constructor(e){super();this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new a(s)}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FGTQT7Q5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,b as r,c as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o,b as r,c as t}from"./chunk-CBAVJ5EN.mjs";import{a as n}from"./chunk-LBNMY7EM.mjs";var s=class{constructor(e){this.config=e}async getAccountEventsByCreationNumber(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorTypes:["events_processor"]}),o({aptosConfig:this.config,...e})}async getAccountEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorTypes:["events_processor"]}),r({aptosConfig:this.config,...e})}async getEvents(e){return await n({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorTypes:["events_processor"]}),t({aptosConfig:this.config,...e})}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GMOHGD73.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-6F4ACCCZ.mjs";import{a as g,b as _}from"./chunk-4K252UDE.mjs";import{a as p,c as b}from"./chunk-5HZKDT5C.mjs";import{b as o}from"./chunk-UR5E2UDO.mjs";import{a as h}from"./chunk-IU5JZNH4.mjs";var c=class extends h{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return d.load(t);case 1:return u.load(t);case 2:return l.load(t);case 3:return A.load(t);case 4:return y.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},d=class i extends c{constructor(e,r){super();this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=p.deserialize(e),s=b.deserialize(e);return new i(r,s)}},u=class i extends c{constructor(e,r){super();this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=g.deserialize(e),s=_.deserialize(e);return new i(r,s)}},l=class i extends c{constructor(e,r,s){super();this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=s}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let r=n.deserialize(e),s=e.deserializeVector(o),a=e.deserializeVector(n);return new i(r,s,a)}},A=class i extends c{constructor(e,r,s,a){super();this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=s,this.fee_payer=a}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let r=n.deserialize(e),s=e.deserializeVector(o),a=e.deserializeVector(n),z=o.deserialize(e),S=n.deserialize(e),E={address:z,authenticator:S};return new i(r,s,a,E)}},y=class i extends c{constructor(e){super();this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let r=n.deserialize(e);return new i(r)}};export{c as a,d as b,u as c,l as d,A as e,y as f};
|
|
2
|
+
//# sourceMappingURL=chunk-GQI3HWOB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as t}from"./chunk-UR5E2UDO.mjs";import{a as o,b as r}from"./chunk-7B3VSBCX.mjs";import{e as u}from"./chunk-VMCFN5CT.mjs";import{a as i}from"./chunk-IU5JZNH4.mjs";var c=class extends i{constructor(e){super();this.accountAddress=t.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new u(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=o.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HQ4DGB7L.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as U,b,c as f,d as u,e as h,f as y}from"./chunk-DNDWTM7A.mjs";import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-NL72WE3E.mjs";import{a as U,b,c as f,d as u,e as h,f as y}from"./chunk-DNDWTM7A.mjs";import{a as s}from"./chunk-ZWH2ESXT.mjs";var B=class{bcsToBytes(){let e=new n;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return c.fromHexInput(e)}},n=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,i){this.ensureBufferWillHandleSize(t);let a=new DataView(this.buffer,this.offset);e.apply(a,[0,i,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){A(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(f),i=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(i))}serializeU128(e){let t=BigInt(e)&u,i=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(i)}serializeU256(e){let t=BigInt(e)&h,i=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(i)}serializeU32AsUleb128(e){let t=e,i=[];for(;t>>>7;)i.push(t&127|128),t>>>=7;i.push(t),this.appendToBuffer(new Uint8Array(i))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}};s([o(0,U)],n.prototype,"serializeU8",1),s([o(0,b)],n.prototype,"serializeU16",1),s([o(0,f)],n.prototype,"serializeU32",1),s([o(BigInt(0),u)],n.prototype,"serializeU64",1),s([o(BigInt(0),h)],n.prototype,"serializeU128",1),s([o(BigInt(0),y)],n.prototype,"serializeU256",1),s([o(0,f)],n.prototype,"serializeU32AsUleb128",1);function A(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var g=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function w(r,e,t){let i=BigInt(r);if(i>BigInt(t)||i<BigInt(e))throw new Error(g(r,e,t))}function o(r,e){return(t,i,a)=>{let p=a.value;return a.value=function(l){return w(l,r,e),p.apply(this,[l])},a}}export{B as a,n as b,A as c,g as d,w as e};
|
|
2
|
+
//# sourceMappingURL=chunk-IU5JZNH4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as o}from"./chunk-5X46HDCI.mjs";async function s(e){let{type:p,originMethod:n,path:i,body:r,acceptType:R,contentType:y,params:u,aptosConfig:t,overrides:m}=e,c=t.getRequestUrl(p);return o({url:c,method:"POST",originMethod:n,path:i,body:r,contentType:y?.valueOf(),acceptType:R?.valueOf(),params:u,overrides:{...t.clientConfig,...m}},t)}async function A(e){return s({...e,type:0})}async function f(e){return s({...e,type:1})}async function x(e){return s({...e,type:2})}export{s as a,A as b,f as c,x as d};
|
|
2
|
+
//# sourceMappingURL=chunk-KR5JAN32.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as i}from"./chunk-RCYWJZR4.mjs";import{c as e}from"./chunk-5HZKDT5C.mjs";import{c as a}from"./chunk-EHJEK7FU.mjs";var s=class t extends a{constructor(r){super();this.signature=r}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(r){if(this.signature instanceof e)r.serializeU32AsUleb128(0),this.signature.serialize(r);else if(this.signature instanceof i)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 t(e.load(r));case 1:return new t(i.load(r));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KVJ2KGMW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{g as e}from"./chunk-X7QBDRQR.mjs";async function m(o){if(o.minimumLedgerVersion!==void 0){let r=[];for(let i of o.processorTypes)r.push(e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:i}));await Promise.all(r)}}export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LBNMY7EM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as V,b as Y,c as Z}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as V,b as Y,c as Z}from"./chunk-4FDIPWVB.mjs";import{q as F,t as M}from"./chunk-7QJYTQSU.mjs";import{a as u}from"./chunk-OXO3Z2MF.mjs";import{a as l,c as g,d as m}from"./chunk-3QS3MFWJ.mjs";import{c as L,d as H,e as X,f as z,g as j,h as J,i as Q}from"./chunk-PANYJULW.mjs";import{a as q}from"./chunk-FGTQT7Q5.mjs";import{b as E,d as _,e as R,f as B}from"./chunk-GQI3HWOB.mjs";import{b as f,d as y,e as O}from"./chunk-6F4ACCCZ.mjs";import{a as k}from"./chunk-Y5RQOXZH.mjs";import{b as v}from"./chunk-X7QBDRQR.mjs";import{a as K}from"./chunk-AH44UPM4.mjs";import{a as h}from"./chunk-KVJ2KGMW.mjs";import{a as x}from"./chunk-OWP2MKTX.mjs";import{a as C,c as N}from"./chunk-RCYWJZR4.mjs";import{a as w,c as T}from"./chunk-5HZKDT5C.mjs";import{b as A}from"./chunk-UR5E2UDO.mjs";import{a as W}from"./chunk-5IVRKK5V.mjs";import{b as $}from"./chunk-NL72WE3E.mjs";import{c as D,d as U,g as G,h as b}from"./chunk-EOC4UI5B.mjs";import{e as I}from"./chunk-LV33NV4J.mjs";import{sha3_256 as an}from"@noble/hashes/sha3";async function Un(n){if(F(n))return nn(n);let{moduleAddress:e,moduleName:t,functionName:o}=M(n.function),r=await K(async()=>Y(e,t,o,n.aptosConfig),`entry-function-${n.aptosConfig.network}-${e}-${t}-${o}`,1e3*60*5)();return on(n,r)}function on(n,e){if(F(n))return nn(n);let{moduleAddress:t,moduleName:o,functionName:r}=M(n.function),a=V(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let i=n.functionArguments.map((s,d)=>Z(n.function,e,s,d,a));if(i.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${o}::${r}', expected ${e.parameters.length} but got ${i.length}`);let c=z.build(`${t}::${o}`,r,a,i);if("multisigAddress"in n){let s=A.from(n.multisigAddress);return new X(new J(s,new Q(c)))}return new H(c)}function nn(n){return new L(new j($.fromHexInput(n.bytecode).toUint8Array(),n.typeArguments??[],n.functionArguments))}async function sn(n){let{aptosConfig:e,sender:t,payload:o,options:r}=n,a=r?.accountSequenceNumber!==void 0?Promise.resolve({sequence_number:r.accountSequenceNumber}):k({aptosConfig:e,accountAddress:t}),i=I[e.network]?Promise.resolve({chain_id:I[e.network]}):W({aptosConfig:e}),c=r?.gasUnitPrice?Promise.resolve({gas_estimate:r.gasUnitPrice}):v({aptosConfig:e}),[{sequence_number:s},{chain_id:d},{gas_estimate:p}]=await Promise.all([a,i,c]),{maxGasAmount:S,gasUnitPrice:en,expireTimestamp:rn}={maxGasAmount:r?.maxGasAmount?BigInt(r.maxGasAmount):BigInt(D),gasUnitPrice:BigInt(p),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+U),...r};return new l(A.from(t),BigInt(s),o,BigInt(S),BigInt(en),BigInt(rn),new q(d))}async function Gn(n){let{aptosConfig:e,sender:t,payload:o,options:r}=n,a=await sn({aptosConfig:e,sender:t,payload:o,options:r});if("secondarySignerAddresses"in n){let i=n.secondarySignerAddresses?.map(c=>A.from(c))??[];return{rawTransaction:a,secondarySignerAddresses:i,feePayerAddress:n.feePayerAddress?A.from(n.feePayerAddress):void 0}}return{rawTransaction:a,feePayerAddress:n.feePayerAddress?A.from(n.feePayerAddress):void 0}}function $n(n){let{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:o,feePayerPublicKey:r}=n,a=P(e);if(t.feePayerAddress){let c=new m(t.rawTransaction,t.secondarySignerAddresses??[],t.feePayerAddress),s=[];o&&(s=o.map(S=>P(S)));let d=P(r),p=new R(a,t.secondarySignerAddresses??[],s,{address:t.feePayerAddress,authenticator:d});return new u(c.raw_txn,p).bcsToBytes()}if(t.secondarySignerAddresses){let c=new g(t.rawTransaction,t.secondarySignerAddresses),s=[];s=o.map(p=>P(p));let d=new _(a,t.secondarySignerAddresses,s);return new u(c.raw_txn,d).bcsToBytes()}let i;if(a instanceof f)i=new E(a.public_key,a.signature);else if(a instanceof y)i=new B(a);else throw new Error("Invalid public key");return new u(t.rawTransaction,i).bcsToBytes()}function P(n){if(n instanceof x){if(n.publicKey instanceof w)return new y(n,new h(new T(new Uint8Array(64))));if(n.publicKey instanceof C)return new y(n,new h(new N(new Uint8Array(64))))}return new f(new w(n.toUint8Array()),new T(new Uint8Array(64)))}function Cn(n){let{signer:e,transaction:t}=n,o=un(t),r=e.sign(o);switch(e.signingScheme){case 0:return new f(new w(e.publicKey.toUint8Array()),new T(r.toUint8Array()));case 2:if(!x.isPublicKey(e.publicKey))throw new Error(`Cannot sign transaction, public key does not match ${e.signingScheme}`);return new y(e.publicKey,new h(r));default:throw new Error(`Cannot sign transaction, signing scheme ${e.signingScheme} not supported`)}}function Nn(n){let{transaction:e,senderAuthenticator:t,feePayerAuthenticator:o,additionalSignersAuthenticators:r}=n,a=tn(e);if((o||r)&&(a instanceof g||a instanceof m))return cn(a,t,o,r);if(t instanceof f&&a instanceof l){let i=new E(t.public_key,t.signature);return new u(a,i).bcsToBytes()}if((t instanceof y||t instanceof O)&&a instanceof l){let i=new B(t);return new u(a,i).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${t} is not a supported account authentication scheme`)}function tn(n){return n.feePayerAddress?new m(n.rawTransaction,n.secondarySignerAddresses??[],n.feePayerAddress):n.secondarySignerAddresses?new g(n.rawTransaction,n.secondarySignerAddresses):n.rawTransaction}function cn(n,e,t,o){if(n instanceof m){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let r=new R(e,n.secondary_signer_addresses,o??[],{address:n.fee_payer_address,authenticator:t});return new u(n.raw_txn,r).bcsToBytes()}if(n instanceof g){if(!o)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let r=new _(e,n.secondary_signer_addresses,o??[]);return new u(n.raw_txn,r).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof n} transaction is not supported`)}function un(n){let e=tn(n),t=an.create();if(e instanceof l)t.update(G);else if(e instanceof g)t.update(b);else if(e instanceof m)t.update(b);else throw new Error(`Unknown transaction type to sign on: ${e}`);let o=t.digest(),r=e.bcsToBytes(),a=new Uint8Array(o.length+r.length);return a.set(o),a.set(r,o.length),a}export{Un as a,on as b,sn as c,Gn as d,$n as e,P as f,Cn as g,Nn as h,tn as i,cn as j,un as k};
|
|
2
|
+
//# sourceMappingURL=chunk-MNFGMNYS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as y}from"./chunk-4K252UDE.mjs";import{a as m}from"./chunk-NMFS5KAE.mjs";import{a as d}from"./chunk-OWP2MKTX.mjs";import{a as l}from"./chunk-5HZKDT5C.mjs";import{b as u}from"./chunk-UR5E2UDO.mjs";import{a as c}from"./chunk-IU5JZNH4.mjs";import{b as s}from"./chunk-NL72WE3E.mjs";import{sha3_256 as b}from"@noble/hashes/sha3";var i=class i extends c{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 o=b.create();o.update(n);let f=o.digest();return new i({data:f})}static fromPublicKey(r){let{publicKey:t}=r,e;if(t instanceof l)e=0 .valueOf();else if(t instanceof y)e=1 .valueOf();else if(t instanceof d)e=2 .valueOf();else if(t instanceof m)e=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return i.fromPublicKeyAndScheme({publicKey:t,scheme:e})}derivedAddress(){return new u(this.data.toUint8Array())}};i.LENGTH=32;var h=i;export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-N25GOEVL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-DYJVDOBH.mjs";import{h as r,i as e,j as i}from"./chunk-7IY2Y73Q.mjs";var c=class{constructor(n){this.config=n}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:o,options:p}=n,a=new s(this.config,t);a.start();for(let u of o)await a.push(u,p)}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:o}=n;return r({aptosConfig:this.config,signer:t,transaction:o})}async publishPackageTransaction(n){return e({aptosConfig:this.config,...n})}async rotateAuthKey(n){return i({aptosConfig:this.config,...n})}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NBSXZKMQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as n}from"./chunk-5X46HDCI.mjs";async function p(e){let{aptosConfig:t,overrides:s,params:r,contentType:o,acceptType:i,path:a,originMethod:u,type:R}=e,d=t.getRequestUrl(R);return n({url:d,method:"GET",originMethod:u,path:a,contentType:o?.valueOf(),acceptType:i?.valueOf(),params:r,overrides:{...t.clientConfig,...s}},t)}async function g(e){return p({...e,type:0})}async function f(e){let t=[],s,r=e.params;for(;;){r.start=s;let o=await p({type:0,aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:r,overrides:e.overrides});if(s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),s==null)break}return t}export{p as a,g as b,f as c};
|
|
2
|
+
//# sourceMappingURL=chunk-NFGAZSSK.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-IU5JZNH4.mjs";var r=class t extends e{constructor(i){super();this.identifier=i}serialize(i){i.serializeStr(this.identifier)}static deserialize(i){let s=i.deserializeStr();return new t(s)}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NLONZHYT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-OWP2MKTX.mjs";import{a as y}from"./chunk-EHJEK7FU.mjs";import{b as l}from"./chunk-NL72WE3E.mjs";var p=class h extends y{constructor(e){super();let{publicKeys:t,signaturesRequired:r}=e;if(r<1)throw new Error("The number of required signatures needs to be greater then 0");if(t.length<r)throw new Error(`Provided ${t.length} public keys is smaller than the ${r} required signatures`);let i=[];t.forEach(s=>{s instanceof o?i.push(s):i.push(new o(s))}),this.publicKeys=i,this.signaturesRequired=r}toUint8Array(){return this.bcsToBytes()}createBitmap(e){let{bits:t}=e,r=128,i=new Uint8Array([0,0,0,0]),s=new Set;return t.forEach((n,u)=>{if(u+1>this.publicKeys.length)throw new Error(`Signature index ${u+1} is out of public keys range, ${this.publicKeys.length}.`);if(s.has(n))throw new Error(`Duplicate bit ${n} detected.`);s.add(n);let a=Math.floor(n/8),c=i[a];c|=r>>n%8,i[a]=c}),i}toString(){return l.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("not implemented")}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let t=e.deserializeVector(o),r=e.deserializeU8();return new h({publicKeys:t,signaturesRequired:r})}};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NMFS5KAE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{g as a}from"./chunk-7IY2Y73Q.mjs";import{a as r}from"./chunk-ZWH2ESXT.mjs";var n=class{constructor(t){this.config=t}async transaction(t){return a({aptosConfig:this.config,...t})}async multiAgentTransaction(t){return a({aptosConfig:this.config,...t})}};r([c],n.prototype,"transaction",1),r([c],n.prototype,"multiAgentTransaction",1);function c(s,t,o){let u=o.value;return o.value=async function(...e){let[i]=e;if(i.transaction.feePayerAddress&&!i.feePayerAuthenticator)throw new Error("You are submitting a Fee Payer transaction but missing the feePayerAuthenticator");return u.apply(this,e)},o}export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NZ36UN4C.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-RCYWJZR4.mjs";import{a as r}from"./chunk-5HZKDT5C.mjs";import{a as s}from"./chunk-EHJEK7FU.mjs";var c=class n extends s{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:i,signature:u}=e;return this.publicKey.verifySignature({message:i,signature:u})}serialize(e){if(this.publicKey instanceof r)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof t)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let i=e.deserializeUleb128AsU32();switch(i){case 0:return new n(r.load(e));case 1:return new n(t.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${i}`)}}static isPublicKey(e){return e instanceof n}isEd25519(){return this.publicKey instanceof r}isSecp256k1PublicKey(){return this.publicKey instanceof t}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OWP2MKTX.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-3QS3MFWJ.mjs";import{a as i}from"./chunk-GQI3HWOB.mjs";import{a as r}from"./chunk-IU5JZNH4.mjs";var n=class o extends r{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=e.deserialize(t),s=i.deserialize(t);return new o(a,s)}};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OXO3Z2MF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-C3Y52GHM.mjs";import{a as p}from"./chunk-PRKZ2KJ4.mjs";import{a as y}from"./chunk-NLONZHYT.mjs";import{b as u}from"./chunk-UR5E2UDO.mjs";import{a as S}from"./chunk-6DYNAFAP.mjs";import{a as M}from"./chunk-7B3VSBCX.mjs";import{a as F,b as d,c as T,d as E,e as _,f as w,g as x}from"./chunk-VMCFN5CT.mjs";import{a as b}from"./chunk-IU5JZNH4.mjs";function D(r){let e=r.deserializeUleb128AsU32();switch(e){case 0:return d.deserialize(r);case 1:return _.deserialize(r);case 2:return w.deserialize(r);case 3:return u.deserialize(r);case 4:return M.deserialize(r,d);case 5:return F.deserialize(r);case 6:return T.deserialize(r);case 7:return E.deserialize(r);case 8:return x.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var a=class extends b{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return m.load(e);case 2:return A.load(e);case 3:return z.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},m=class r extends a{constructor(t){super();this.script=t}serialize(t){t.serializeU32AsUleb128(0),this.script.serialize(t)}static load(t){let i=h.deserialize(t);return new r(i)}},A=class r extends a{constructor(t){super();this.entryFunction=t}serialize(t){t.serializeU32AsUleb128(2),this.entryFunction.serialize(t)}static load(t){let i=l.deserialize(t);return new r(i)}},z=class r extends a{constructor(t){super();this.multiSig=t}serialize(t){t.serializeU32AsUleb128(3),this.multiSig.serialize(t)}static load(t){let i=U.deserialize(t);return new r(i)}},l=class r{constructor(e,t,i,n){this.module_name=e,this.function_name=t,this.type_args=i,this.args=n}static build(e,t,i,n){return new r(p.fromStr(e),new y(t),i,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=p.deserialize(e),i=y.deserialize(e),n=e.deserializeVector(g),o=e.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1){let v=e.deserializeUleb128AsU32(),B=S.deserialize(e,v);s.push(B)}return new r(t,i,n,s)}},h=class r{constructor(e,t,i){this.bytecode=e,this.type_args=t,this.args=i}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(),i=e.deserializeVector(g),n=e.deserializeUleb128AsU32(),o=new Array;for(let s=0;s<n;s+=1){let c=D(e);o.push(c)}return new r(t,i,o)}},U=class r{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=u.deserialize(e),i=e.deserializeBool(),n;return i&&(n=f.deserialize(e)),new r(t,n)}},f=class r{constructor(e){this.transaction_payload=e}serialize(e){e.serializeU32AsUleb128(0),this.transaction_payload.serialize(e)}static deserialize(e){return e.deserializeUleb128AsU32(),new r(l.deserialize(e))}};export{D as a,a as b,m as c,A as d,z as e,l as f,h as g,U as h,f as i};
|
|
2
|
+
//# sourceMappingURL=chunk-PANYJULW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as o}from"./chunk-7IY2Y73Q.mjs";import{a as i}from"./chunk-ZWH2ESXT.mjs";var r=class{constructor(n){this.config=n}async transaction(n){return o({aptosConfig:this.config,...n})}async multiAgentTransaction(n){return o({aptosConfig:this.config,...n})}};i([s],r.prototype,"transaction",1),i([s],r.prototype,"multiAgentTransaction",1);function s(c,n,e){let y=e.value;return e.value=async function(...t){let[a]=t;if(a.transaction.feePayerAddress&&!a.feePayerPublicKey)throw new Error("You are simulating a Fee Payer transaction but missing the feePayerPublicKey");return y.apply(this,t)},e}export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PEBXSNMJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as n,c as t,d as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i,b as n,c as t,d as o}from"./chunk-XKINEFAA.mjs";import{a as s}from"./chunk-LBNMY7EM.mjs";var r=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorTypes:["fungible_asset_processor"]}),i({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorTypes:["fungible_asset_processor"]}),(await i({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorTypes:["fungible_asset_processor"]}),n({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorTypes:["fungible_asset_processor"]}),t({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return o({aptosConfig:this.config,...e})}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PLY7MQKE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-NLONZHYT.mjs";import{b as i}from"./chunk-UR5E2UDO.mjs";import{a as d}from"./chunk-IU5JZNH4.mjs";var o=class t extends d{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 t(i.fromString(r[0]),new s(r[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let r=i.deserialize(e),n=s.deserialize(e);return new t(r,n)}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PRKZ2KJ4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-N25GOEVL.mjs";import{a as K}from"./chunk-4K252UDE.mjs";import{a as n}from"./chunk-OWP2MKTX.mjs";import{a as d,b as y}from"./chunk-RCYWJZR4.mjs";import{a as p,b as o}from"./chunk-5HZKDT5C.mjs";import{b as l}from"./chunk-NL72WE3E.mjs";var g=class a{constructor(t){let{privateKey:e,address:i,legacy:r}=t,c=r??!0;if(this.publicKey=e.publicKey(),this.publicKey instanceof p)c?this.signingScheme=0:(this.publicKey=new n(this.publicKey),this.signingScheme=2);else if(this.publicKey instanceof K)this.signingScheme=1;else if(this.publicKey instanceof d)this.publicKey=new n(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 n(i.publicKey());break;default:i=o.generate(),e===!1?r=new n(i.publicKey()):r=i.publicKey()}let s=u.fromPublicKey({publicKey:r}).derivedAddress();return new a({privateKey:i,address:s,legacy:t?.legacy})}static fromPrivateKey(t){let{privateKey:e,legacy:i}=t,r=i??!0,c;if(e instanceof y)c=new n(e.publicKey());else if(e instanceof o)r?c=e.publicKey():c=new n(e.publicKey());else throw new Error(`Unsupported private key ${e}`);let m=u.fromPublicKey({publicKey:c}).derivedAddress();return new a({privateKey:e,address:m,legacy:r})}static fromPrivateKeyAndAddress(t){let{privateKey:e,address:i,legacy:r}=t;return new a({privateKey:e,address:i,legacy:r})}static fromDerivationPath(t){let{path:e,mnemonic:i,scheme:r,legacy:c}=t,s;switch(r){case 2:s=y.fromDerivationPath(e,i);break;case 0:s=o.fromDerivationPath(e,i);break;default:throw new Error(`Unsupported scheme ${r}`)}return a.fromPrivateKey({privateKey:s,legacy:c})}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{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PZ5JKQSP.mjs.map
|