@aptos-labs/ts-sdk 5.1.2 → 5.1.4
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/dist/common/{account-147vfOGb.d.ts → account-DefhsHe3.d.ts} +325 -1
- package/dist/common/chunk-HO5ESTN4.js +4 -0
- package/dist/common/chunk-HO5ESTN4.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +2 -2
- package/dist/common/index.js +34 -34
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-CPwej6wB.d.mts → Ed25519Account-CVg5T_jc.d.mts} +1 -1
- package/dist/esm/account/AbstractKeylessAccount.d.mts +3 -3
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/AbstractedAccount.d.mts +2 -2
- package/dist/esm/account/AbstractedAccount.mjs +1 -1
- package/dist/esm/account/Account.d.mts +2 -2
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/AccountUtils.d.mts +3 -3
- package/dist/esm/account/AccountUtils.mjs +1 -1
- package/dist/esm/account/DerivableAbstractedAccount.d.mts +2 -2
- package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +2 -2
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +1 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +3 -3
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiEd25519Account.d.mts +2 -2
- package/dist/esm/account/MultiEd25519Account.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +3 -3
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +3 -3
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/utils.d.mts +1 -1
- package/dist/esm/account/utils.mjs +1 -1
- package/dist/esm/{account-BortO8g2.d.mts → account-DOs8SpoQ.d.mts} +325 -1
- package/dist/esm/api/account/abstraction.d.mts +1 -1
- package/dist/esm/api/account/abstraction.mjs +1 -1
- package/dist/esm/api/account.d.mts +2 -2
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +2 -2
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +3 -3
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +1 -1
- package/dist/esm/api/coin.d.mts +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +2 -2
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +2 -2
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +3 -3
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +3 -3
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +1 -1
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +2 -2
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/helpers.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.d.mts +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.d.mts +14 -2
- package/dist/esm/bcs/consts.mjs +1 -1
- package/dist/esm/bcs/deserializer.d.mts +1 -1
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.d.mts +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +1 -1
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/chunk-3JDGB4IL.mjs +2 -0
- package/dist/esm/chunk-3JDGB4IL.mjs.map +1 -0
- package/dist/esm/{chunk-N6YTF76Q.mjs → chunk-3P474TWM.mjs} +2 -2
- package/dist/esm/{chunk-TOBQ5UE6.mjs → chunk-43LWUUXS.mjs} +2 -2
- package/dist/esm/chunk-5ABS6RDR.mjs +2 -0
- package/dist/esm/chunk-5ABS6RDR.mjs.map +1 -0
- package/dist/esm/{chunk-WSR5EBJM.mjs → chunk-5FNZUL2Y.mjs} +2 -2
- package/dist/esm/{chunk-XKUIMGKU.mjs → chunk-6IWGTO2J.mjs} +2 -2
- package/dist/esm/{chunk-2OPKZKOB.mjs → chunk-7WIDI4FZ.mjs} +2 -2
- package/dist/esm/{chunk-626KB2UQ.mjs → chunk-AVOTC5EI.mjs} +2 -2
- package/dist/esm/{chunk-Q4W3WJ2U.mjs → chunk-BIQOJ3OK.mjs} +2 -2
- package/dist/esm/{chunk-ZYE7UTJZ.mjs → chunk-C5UZZHA4.mjs} +2 -2
- package/dist/esm/{chunk-MT2RJ7H3.mjs → chunk-DIFSO4N6.mjs} +2 -2
- package/dist/esm/{chunk-YZHAI55C.mjs → chunk-G3HAIETV.mjs} +2 -2
- package/dist/esm/{chunk-RQX6JOEN.mjs → chunk-GRF3NBRO.mjs} +2 -2
- package/dist/esm/{chunk-R7FWJP3N.mjs → chunk-GTRHYHQK.mjs} +2 -2
- package/dist/esm/chunk-I42Z32Q2.mjs +2 -0
- package/dist/esm/chunk-I42Z32Q2.mjs.map +1 -0
- package/dist/esm/{chunk-V74WPKSY.mjs → chunk-IKTH33UN.mjs} +2 -2
- package/dist/esm/chunk-IQPLJ32K.mjs +4 -0
- package/dist/esm/chunk-IQPLJ32K.mjs.map +1 -0
- package/dist/esm/{chunk-LAPXUUHK.mjs → chunk-IXRGCQQU.mjs} +2 -2
- package/dist/esm/{chunk-E2U27PNC.mjs → chunk-JYDVO4K3.mjs} +2 -2
- package/dist/esm/chunk-KUF4DKN5.mjs +2 -0
- package/dist/esm/chunk-LD3I4CYO.mjs +2 -0
- package/dist/esm/{chunk-RGKRCZ36.mjs → chunk-MEG27LEV.mjs} +2 -2
- package/dist/esm/{chunk-LA56UDUK.mjs → chunk-PYVKCTUN.mjs} +2 -2
- package/dist/esm/{chunk-WCMW2L3P.mjs → chunk-QDJDZ3ON.mjs} +2 -2
- package/dist/esm/{chunk-FGFLPH5K.mjs → chunk-RYOICF37.mjs} +2 -2
- package/dist/esm/{chunk-AQW4BUKF.mjs → chunk-SGZPRMLE.mjs} +2 -2
- package/dist/esm/{chunk-QNARIAVM.mjs → chunk-VO3JD6U6.mjs} +2 -2
- package/dist/esm/{chunk-GQ3UIDPQ.mjs → chunk-VS5NYRHW.mjs} +2 -2
- package/dist/esm/{chunk-FC72YL4B.mjs → chunk-VV6OTOMS.mjs} +2 -2
- package/dist/esm/chunk-WGRSKMNQ.mjs +2 -0
- package/dist/esm/{chunk-H3EP5CGP.mjs.map → chunk-WGRSKMNQ.mjs.map} +1 -1
- package/dist/esm/{chunk-PSSIJHHC.mjs → chunk-WOEH45Q2.mjs} +2 -2
- package/dist/esm/chunk-X2TPNKLV.mjs +2 -0
- package/dist/esm/chunk-X2TPNKLV.mjs.map +1 -0
- package/dist/esm/{chunk-YS5IUILF.mjs → chunk-X5BUBEJH.mjs} +2 -2
- package/dist/esm/{chunk-FLZPUYXQ.mjs → chunk-Y426VCPM.mjs} +2 -2
- package/dist/esm/{chunk-FLZPUYXQ.mjs.map → chunk-Y426VCPM.mjs.map} +1 -1
- package/dist/esm/cli/index.d.mts +1 -1
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.d.mts +1 -1
- package/dist/esm/client/core.d.mts +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.d.mts +1 -1
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.d.mts +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.d.mts +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.d.mts +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/abstraction.d.mts +1 -1
- package/dist/esm/core/crypto/abstraction.mjs +1 -1
- package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
- package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +2 -2
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +2 -2
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +1 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.d.mts +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/secp256r1.d.mts +1 -1
- package/dist/esm/core/crypto/secp256r1.mjs +1 -1
- package/dist/esm/core/crypto/signature.d.mts +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/types.d.mts +1 -1
- package/dist/esm/core/crypto/utils.d.mts +1 -1
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.d.mts +1 -1
- package/dist/esm/core/index.d.mts +2 -2
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.d.mts +1 -1
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/{federatedKeyless-CTzDAQTu.d.mts → federatedKeyless-CxdU4W95.d.mts} +1 -1
- package/dist/esm/index.d.mts +3 -3
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/abstraction.d.mts +1 -1
- package/dist/esm/internal/abstraction.mjs +1 -1
- package/dist/esm/internal/account.d.mts +2 -2
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +2 -2
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +2 -2
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +2 -2
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +3 -3
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.d.mts +1 -1
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +2 -2
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/utils/index.d.mts +1 -1
- package/dist/esm/internal/utils/index.mjs +1 -1
- package/dist/esm/internal/utils/utils.d.mts +1 -1
- package/dist/esm/internal/utils/utils.mjs +1 -1
- package/dist/esm/internal/view.d.mts +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.d.mts +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +2 -2
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.d.mts +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +1 -1
- package/dist/esm/types/index.d.mts +1 -1
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/types.d.mts +1 -1
- package/dist/esm/types/types.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +1 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.d.mts +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +19 -18
- package/src/bcs/consts.ts +15 -1
- package/src/bcs/deserializer.ts +105 -0
- package/src/bcs/serializable/movePrimitives.ts +237 -1
- package/src/bcs/serializer.ts +111 -0
- package/src/transactions/typeTag/index.ts +173 -1
- package/src/transactions/typeTag/parser.ts +24 -0
- package/src/types/types.ts +36 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-347THBDE.js +0 -4
- package/dist/common/chunk-347THBDE.js.map +0 -1
- package/dist/esm/chunk-56CNRT2K.mjs +0 -2
- package/dist/esm/chunk-56CNRT2K.mjs.map +0 -1
- package/dist/esm/chunk-CW35YAMN.mjs +0 -2
- package/dist/esm/chunk-EBMEXURY.mjs +0 -2
- package/dist/esm/chunk-EBMEXURY.mjs.map +0 -1
- package/dist/esm/chunk-H3EP5CGP.mjs +0 -2
- package/dist/esm/chunk-MCFQE4GC.mjs +0 -2
- package/dist/esm/chunk-MCFQE4GC.mjs.map +0 -1
- package/dist/esm/chunk-ORMOQWWH.mjs +0 -2
- package/dist/esm/chunk-ORMOQWWH.mjs.map +0 -1
- package/dist/esm/chunk-PJTG745G.mjs +0 -4
- package/dist/esm/chunk-PJTG745G.mjs.map +0 -1
- package/dist/esm/chunk-XJJVJOX5.mjs +0 -2
- /package/dist/esm/{chunk-N6YTF76Q.mjs.map → chunk-3P474TWM.mjs.map} +0 -0
- /package/dist/esm/{chunk-TOBQ5UE6.mjs.map → chunk-43LWUUXS.mjs.map} +0 -0
- /package/dist/esm/{chunk-WSR5EBJM.mjs.map → chunk-5FNZUL2Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-XKUIMGKU.mjs.map → chunk-6IWGTO2J.mjs.map} +0 -0
- /package/dist/esm/{chunk-2OPKZKOB.mjs.map → chunk-7WIDI4FZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-626KB2UQ.mjs.map → chunk-AVOTC5EI.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q4W3WJ2U.mjs.map → chunk-BIQOJ3OK.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZYE7UTJZ.mjs.map → chunk-C5UZZHA4.mjs.map} +0 -0
- /package/dist/esm/{chunk-MT2RJ7H3.mjs.map → chunk-DIFSO4N6.mjs.map} +0 -0
- /package/dist/esm/{chunk-YZHAI55C.mjs.map → chunk-G3HAIETV.mjs.map} +0 -0
- /package/dist/esm/{chunk-RQX6JOEN.mjs.map → chunk-GRF3NBRO.mjs.map} +0 -0
- /package/dist/esm/{chunk-R7FWJP3N.mjs.map → chunk-GTRHYHQK.mjs.map} +0 -0
- /package/dist/esm/{chunk-V74WPKSY.mjs.map → chunk-IKTH33UN.mjs.map} +0 -0
- /package/dist/esm/{chunk-LAPXUUHK.mjs.map → chunk-IXRGCQQU.mjs.map} +0 -0
- /package/dist/esm/{chunk-E2U27PNC.mjs.map → chunk-JYDVO4K3.mjs.map} +0 -0
- /package/dist/esm/{chunk-XJJVJOX5.mjs.map → chunk-KUF4DKN5.mjs.map} +0 -0
- /package/dist/esm/{chunk-CW35YAMN.mjs.map → chunk-LD3I4CYO.mjs.map} +0 -0
- /package/dist/esm/{chunk-RGKRCZ36.mjs.map → chunk-MEG27LEV.mjs.map} +0 -0
- /package/dist/esm/{chunk-LA56UDUK.mjs.map → chunk-PYVKCTUN.mjs.map} +0 -0
- /package/dist/esm/{chunk-WCMW2L3P.mjs.map → chunk-QDJDZ3ON.mjs.map} +0 -0
- /package/dist/esm/{chunk-FGFLPH5K.mjs.map → chunk-RYOICF37.mjs.map} +0 -0
- /package/dist/esm/{chunk-AQW4BUKF.mjs.map → chunk-SGZPRMLE.mjs.map} +0 -0
- /package/dist/esm/{chunk-QNARIAVM.mjs.map → chunk-VO3JD6U6.mjs.map} +0 -0
- /package/dist/esm/{chunk-GQ3UIDPQ.mjs.map → chunk-VS5NYRHW.mjs.map} +0 -0
- /package/dist/esm/{chunk-FC72YL4B.mjs.map → chunk-VV6OTOMS.mjs.map} +0 -0
- /package/dist/esm/{chunk-PSSIJHHC.mjs.map → chunk-WOEH45Q2.mjs.map} +0 -0
- /package/dist/esm/{chunk-YS5IUILF.mjs.map → chunk-X5BUBEJH.mjs.map} +0 -0
|
@@ -8,11 +8,23 @@ import {
|
|
|
8
8
|
MAX_U64_BIG_INT,
|
|
9
9
|
MAX_U8_NUMBER,
|
|
10
10
|
MAX_U256_BIG_INT,
|
|
11
|
+
MIN_I8_NUMBER,
|
|
12
|
+
MAX_I8_NUMBER,
|
|
13
|
+
MIN_I16_NUMBER,
|
|
14
|
+
MAX_I16_NUMBER,
|
|
15
|
+
MIN_I32_NUMBER,
|
|
16
|
+
MAX_I32_NUMBER,
|
|
17
|
+
MIN_I64_BIG_INT,
|
|
18
|
+
MAX_I64_BIG_INT,
|
|
19
|
+
MIN_I128_BIG_INT,
|
|
20
|
+
MAX_I128_BIG_INT,
|
|
21
|
+
MIN_I256_BIG_INT,
|
|
22
|
+
MAX_I256_BIG_INT,
|
|
11
23
|
} from "../consts";
|
|
12
24
|
import { Deserializer } from "../deserializer";
|
|
13
25
|
import { Serializable, Serializer, ensureBoolean, validateNumberInRange } from "../serializer";
|
|
14
26
|
import { TransactionArgument } from "../../transactions/instances/transactionArgument";
|
|
15
|
-
import { AnyNumber, Uint16, Uint32, Uint8, ScriptTransactionArgumentVariants } from "../../types";
|
|
27
|
+
import { AnyNumber, Uint16, Uint32, Uint8, Int8, Int16, Int32, ScriptTransactionArgumentVariants } from "../../types";
|
|
16
28
|
|
|
17
29
|
/**
|
|
18
30
|
* Represents a boolean value that can be serialized and deserialized.
|
|
@@ -326,3 +338,227 @@ export class U256 extends Serializable implements TransactionArgument {
|
|
|
326
338
|
return new U256(deserializer.deserializeU256());
|
|
327
339
|
}
|
|
328
340
|
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Represents an 8-bit signed integer (I8) value.
|
|
344
|
+
* This class extends the Serializable class and provides methods for serialization and deserialization of I8 values.
|
|
345
|
+
*
|
|
346
|
+
* @extends Serializable
|
|
347
|
+
* @group Implementation
|
|
348
|
+
* @category BCS
|
|
349
|
+
*/
|
|
350
|
+
export class I8 extends Serializable implements TransactionArgument {
|
|
351
|
+
public readonly value: Int8;
|
|
352
|
+
|
|
353
|
+
constructor(value: Int8) {
|
|
354
|
+
super();
|
|
355
|
+
validateNumberInRange(value, MIN_I8_NUMBER, MAX_I8_NUMBER);
|
|
356
|
+
this.value = value;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
serialize(serializer: Serializer): void {
|
|
360
|
+
serializer.serializeI8(this.value);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
serializeForEntryFunction(serializer: Serializer): void {
|
|
364
|
+
const bcsBytes = this.bcsToBytes();
|
|
365
|
+
serializer.serializeBytes(bcsBytes);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
serializeForScriptFunction(serializer: Serializer): void {
|
|
369
|
+
// Note: Script functions don't have variants for signed integers yet
|
|
370
|
+
// This will serialize as bytes
|
|
371
|
+
const bcsBytes = this.bcsToBytes();
|
|
372
|
+
serializer.serializeBytes(bcsBytes);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
static deserialize(deserializer: Deserializer): I8 {
|
|
376
|
+
return new I8(deserializer.deserializeI8());
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Represents a 16-bit signed integer (I16) value.
|
|
382
|
+
* This class extends the Serializable class and provides methods for serialization
|
|
383
|
+
* and deserialization of the I16 value.
|
|
384
|
+
*
|
|
385
|
+
* @extends Serializable
|
|
386
|
+
* @group Implementation
|
|
387
|
+
* @category BCS
|
|
388
|
+
*/
|
|
389
|
+
export class I16 extends Serializable implements TransactionArgument {
|
|
390
|
+
public readonly value: Int16;
|
|
391
|
+
|
|
392
|
+
constructor(value: Int16) {
|
|
393
|
+
super();
|
|
394
|
+
validateNumberInRange(value, MIN_I16_NUMBER, MAX_I16_NUMBER);
|
|
395
|
+
this.value = value;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
serialize(serializer: Serializer): void {
|
|
399
|
+
serializer.serializeI16(this.value);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
serializeForEntryFunction(serializer: Serializer): void {
|
|
403
|
+
const bcsBytes = this.bcsToBytes();
|
|
404
|
+
serializer.serializeBytes(bcsBytes);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
serializeForScriptFunction(serializer: Serializer): void {
|
|
408
|
+
const bcsBytes = this.bcsToBytes();
|
|
409
|
+
serializer.serializeBytes(bcsBytes);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
static deserialize(deserializer: Deserializer): I16 {
|
|
413
|
+
return new I16(deserializer.deserializeI16());
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Represents a 32-bit signed integer (I32) that can be serialized and deserialized.
|
|
419
|
+
* This class ensures that the value is within the valid range for an I32.
|
|
420
|
+
*
|
|
421
|
+
* @extends Serializable
|
|
422
|
+
* @group Implementation
|
|
423
|
+
* @category BCS
|
|
424
|
+
*/
|
|
425
|
+
export class I32 extends Serializable implements TransactionArgument {
|
|
426
|
+
public readonly value: Int32;
|
|
427
|
+
|
|
428
|
+
constructor(value: Int32) {
|
|
429
|
+
super();
|
|
430
|
+
validateNumberInRange(value, MIN_I32_NUMBER, MAX_I32_NUMBER);
|
|
431
|
+
this.value = value;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
serialize(serializer: Serializer): void {
|
|
435
|
+
serializer.serializeI32(this.value);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
serializeForEntryFunction(serializer: Serializer): void {
|
|
439
|
+
const bcsBytes = this.bcsToBytes();
|
|
440
|
+
serializer.serializeBytes(bcsBytes);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
serializeForScriptFunction(serializer: Serializer): void {
|
|
444
|
+
const bcsBytes = this.bcsToBytes();
|
|
445
|
+
serializer.serializeBytes(bcsBytes);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
static deserialize(deserializer: Deserializer): I32 {
|
|
449
|
+
return new I32(deserializer.deserializeI32());
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Represents a 64-bit signed integer (I64) and provides methods for serialization.
|
|
455
|
+
*
|
|
456
|
+
* This class ensures that the value is within the valid range for an I64 and provides
|
|
457
|
+
* functionality to serialize the value for various use cases, including entry functions
|
|
458
|
+
* and script functions.
|
|
459
|
+
*
|
|
460
|
+
* @extends Serializable
|
|
461
|
+
* @group Implementation
|
|
462
|
+
* @category BCS
|
|
463
|
+
*/
|
|
464
|
+
export class I64 extends Serializable implements TransactionArgument {
|
|
465
|
+
public readonly value: bigint;
|
|
466
|
+
|
|
467
|
+
constructor(value: AnyNumber) {
|
|
468
|
+
super();
|
|
469
|
+
validateNumberInRange(value, MIN_I64_BIG_INT, MAX_I64_BIG_INT);
|
|
470
|
+
this.value = BigInt(value);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
serialize(serializer: Serializer): void {
|
|
474
|
+
serializer.serializeI64(this.value);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
serializeForEntryFunction(serializer: Serializer): void {
|
|
478
|
+
const bcsBytes = this.bcsToBytes();
|
|
479
|
+
serializer.serializeBytes(bcsBytes);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
serializeForScriptFunction(serializer: Serializer): void {
|
|
483
|
+
const bcsBytes = this.bcsToBytes();
|
|
484
|
+
serializer.serializeBytes(bcsBytes);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
static deserialize(deserializer: Deserializer): I64 {
|
|
488
|
+
return new I64(deserializer.deserializeI64());
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Represents a 128-bit signed integer value.
|
|
494
|
+
* This class provides methods for serialization and deserialization
|
|
495
|
+
* of I128 values, ensuring that the values are within the valid range.
|
|
496
|
+
*
|
|
497
|
+
* @extends Serializable
|
|
498
|
+
* @group Implementation
|
|
499
|
+
* @category BCS
|
|
500
|
+
*/
|
|
501
|
+
export class I128 extends Serializable implements TransactionArgument {
|
|
502
|
+
public readonly value: bigint;
|
|
503
|
+
|
|
504
|
+
constructor(value: AnyNumber) {
|
|
505
|
+
super();
|
|
506
|
+
validateNumberInRange(value, MIN_I128_BIG_INT, MAX_I128_BIG_INT);
|
|
507
|
+
this.value = BigInt(value);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
serialize(serializer: Serializer): void {
|
|
511
|
+
serializer.serializeI128(this.value);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
serializeForEntryFunction(serializer: Serializer): void {
|
|
515
|
+
const bcsBytes = this.bcsToBytes();
|
|
516
|
+
serializer.serializeBytes(bcsBytes);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
serializeForScriptFunction(serializer: Serializer): void {
|
|
520
|
+
const bcsBytes = this.bcsToBytes();
|
|
521
|
+
serializer.serializeBytes(bcsBytes);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
static deserialize(deserializer: Deserializer): I128 {
|
|
525
|
+
return new I128(deserializer.deserializeI128());
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Represents a 256-bit signed integer (I256) that extends the Serializable class.
|
|
531
|
+
* This class provides methods for serialization and deserialization of I256 values,
|
|
532
|
+
* ensuring that the values are within the valid range.
|
|
533
|
+
*
|
|
534
|
+
* @extends Serializable
|
|
535
|
+
* @group Implementation
|
|
536
|
+
* @category BCS
|
|
537
|
+
*/
|
|
538
|
+
export class I256 extends Serializable implements TransactionArgument {
|
|
539
|
+
public readonly value: bigint;
|
|
540
|
+
|
|
541
|
+
constructor(value: AnyNumber) {
|
|
542
|
+
super();
|
|
543
|
+
validateNumberInRange(value, MIN_I256_BIG_INT, MAX_I256_BIG_INT);
|
|
544
|
+
this.value = BigInt(value);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
serialize(serializer: Serializer): void {
|
|
548
|
+
serializer.serializeI256(this.value);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
serializeForEntryFunction(serializer: Serializer): void {
|
|
552
|
+
const bcsBytes = this.bcsToBytes();
|
|
553
|
+
serializer.serializeBytes(bcsBytes);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
serializeForScriptFunction(serializer: Serializer): void {
|
|
557
|
+
const bcsBytes = this.bcsToBytes();
|
|
558
|
+
serializer.serializeBytes(bcsBytes);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
static deserialize(deserializer: Deserializer): I256 {
|
|
562
|
+
return new I256(deserializer.deserializeI256());
|
|
563
|
+
}
|
|
564
|
+
}
|
package/src/bcs/serializer.ts
CHANGED
|
@@ -9,6 +9,18 @@ import {
|
|
|
9
9
|
MAX_U64_BIG_INT,
|
|
10
10
|
MAX_U8_NUMBER,
|
|
11
11
|
MAX_U256_BIG_INT,
|
|
12
|
+
MIN_I8_NUMBER,
|
|
13
|
+
MAX_I8_NUMBER,
|
|
14
|
+
MIN_I16_NUMBER,
|
|
15
|
+
MAX_I16_NUMBER,
|
|
16
|
+
MIN_I32_NUMBER,
|
|
17
|
+
MAX_I32_NUMBER,
|
|
18
|
+
MIN_I64_BIG_INT,
|
|
19
|
+
MAX_I64_BIG_INT,
|
|
20
|
+
MIN_I128_BIG_INT,
|
|
21
|
+
MAX_I128_BIG_INT,
|
|
22
|
+
MIN_I256_BIG_INT,
|
|
23
|
+
MAX_I256_BIG_INT,
|
|
12
24
|
} from "./consts";
|
|
13
25
|
import { Hex } from "../core/hex";
|
|
14
26
|
import { AnyNumber, Uint16, Uint32, Uint8 } from "../types";
|
|
@@ -338,6 +350,105 @@ export class Serializer {
|
|
|
338
350
|
this.serializeU128(high);
|
|
339
351
|
}
|
|
340
352
|
|
|
353
|
+
/**
|
|
354
|
+
* Serializes an 8-bit signed integer value.
|
|
355
|
+
* BCS layout for "int8": One byte. Binary format in little-endian representation.
|
|
356
|
+
*
|
|
357
|
+
* @param value - The 8-bit signed integer value to serialize.
|
|
358
|
+
* @group Implementation
|
|
359
|
+
* @category BCS
|
|
360
|
+
*/
|
|
361
|
+
@checkNumberRange(MIN_I8_NUMBER, MAX_I8_NUMBER)
|
|
362
|
+
serializeI8(value: number) {
|
|
363
|
+
this.serializeWithFunction(DataView.prototype.setInt8, 1, value);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Serializes a 16-bit signed integer value into a binary format.
|
|
368
|
+
* BCS layout for "int16": Two bytes. Binary format in little-endian representation.
|
|
369
|
+
*
|
|
370
|
+
* @param value - The 16-bit signed integer value to serialize.
|
|
371
|
+
* @group Implementation
|
|
372
|
+
* @category BCS
|
|
373
|
+
*/
|
|
374
|
+
@checkNumberRange(MIN_I16_NUMBER, MAX_I16_NUMBER)
|
|
375
|
+
serializeI16(value: number) {
|
|
376
|
+
this.serializeWithFunction(DataView.prototype.setInt16, 2, value);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Serializes a 32-bit signed integer value into a binary format.
|
|
381
|
+
*
|
|
382
|
+
* @param value - The 32-bit signed integer value to serialize.
|
|
383
|
+
* @group Implementation
|
|
384
|
+
* @category BCS
|
|
385
|
+
*/
|
|
386
|
+
@checkNumberRange(MIN_I32_NUMBER, MAX_I32_NUMBER)
|
|
387
|
+
serializeI32(value: number) {
|
|
388
|
+
this.serializeWithFunction(DataView.prototype.setInt32, 4, value);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Serializes a 64-bit signed integer into a format suitable for storage or transmission.
|
|
393
|
+
* This function uses two's complement representation for negative values.
|
|
394
|
+
*
|
|
395
|
+
* @param value - The 64-bit signed integer to serialize.
|
|
396
|
+
* @group Implementation
|
|
397
|
+
* @category BCS
|
|
398
|
+
*/
|
|
399
|
+
@checkNumberRange(MIN_I64_BIG_INT, MAX_I64_BIG_INT)
|
|
400
|
+
serializeI64(value: AnyNumber) {
|
|
401
|
+
const val = BigInt(value);
|
|
402
|
+
// Convert to unsigned representation using two's complement
|
|
403
|
+
const unsigned = val < 0 ? (BigInt(1) << BigInt(64)) + val : val;
|
|
404
|
+
const low = unsigned & BigInt(MAX_U32_NUMBER);
|
|
405
|
+
const high = unsigned >> BigInt(32);
|
|
406
|
+
|
|
407
|
+
// write little endian number
|
|
408
|
+
this.serializeU32(Number(low));
|
|
409
|
+
this.serializeU32(Number(high));
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Serializes a 128-bit signed integer value.
|
|
414
|
+
*
|
|
415
|
+
* @param value - The 128-bit signed integer value to serialize.
|
|
416
|
+
* @group Implementation
|
|
417
|
+
* @category BCS
|
|
418
|
+
*/
|
|
419
|
+
@checkNumberRange(MIN_I128_BIG_INT, MAX_I128_BIG_INT)
|
|
420
|
+
serializeI128(value: AnyNumber) {
|
|
421
|
+
const val = BigInt(value);
|
|
422
|
+
// Convert to unsigned representation using two's complement
|
|
423
|
+
const unsigned = val < 0 ? (BigInt(1) << BigInt(128)) + val : val;
|
|
424
|
+
const low = unsigned & MAX_U64_BIG_INT;
|
|
425
|
+
const high = unsigned >> BigInt(64);
|
|
426
|
+
|
|
427
|
+
// write little endian number
|
|
428
|
+
this.serializeU64(low);
|
|
429
|
+
this.serializeU64(high);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Serializes a 256-bit signed integer value.
|
|
434
|
+
*
|
|
435
|
+
* @param value - The 256-bit signed integer value to serialize.
|
|
436
|
+
* @group Implementation
|
|
437
|
+
* @category BCS
|
|
438
|
+
*/
|
|
439
|
+
@checkNumberRange(MIN_I256_BIG_INT, MAX_I256_BIG_INT)
|
|
440
|
+
serializeI256(value: AnyNumber) {
|
|
441
|
+
const val = BigInt(value);
|
|
442
|
+
// Convert to unsigned representation using two's complement
|
|
443
|
+
const unsigned = val < 0 ? (BigInt(1) << BigInt(256)) + val : val;
|
|
444
|
+
const low = unsigned & MAX_U128_BIG_INT;
|
|
445
|
+
const high = unsigned >> BigInt(128);
|
|
446
|
+
|
|
447
|
+
// write little endian number
|
|
448
|
+
this.serializeU128(low);
|
|
449
|
+
this.serializeU128(high);
|
|
450
|
+
}
|
|
451
|
+
|
|
341
452
|
/**
|
|
342
453
|
* Serializes a 32-bit unsigned integer as a variable-length ULEB128 encoded byte array.
|
|
343
454
|
* BCS uses uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values
|
|
@@ -63,6 +63,18 @@ export abstract class TypeTag extends Serializable {
|
|
|
63
63
|
return TypeTagU32.load(deserializer);
|
|
64
64
|
case TypeTagVariants.U256:
|
|
65
65
|
return TypeTagU256.load(deserializer);
|
|
66
|
+
case TypeTagVariants.I8:
|
|
67
|
+
return TypeTagI8.load(deserializer);
|
|
68
|
+
case TypeTagVariants.I16:
|
|
69
|
+
return TypeTagI16.load(deserializer);
|
|
70
|
+
case TypeTagVariants.I32:
|
|
71
|
+
return TypeTagI32.load(deserializer);
|
|
72
|
+
case TypeTagVariants.I64:
|
|
73
|
+
return TypeTagI64.load(deserializer);
|
|
74
|
+
case TypeTagVariants.I128:
|
|
75
|
+
return TypeTagI128.load(deserializer);
|
|
76
|
+
case TypeTagVariants.I256:
|
|
77
|
+
return TypeTagI256.load(deserializer);
|
|
66
78
|
case TypeTagVariants.Generic:
|
|
67
79
|
// This is only used for ABI representation, and cannot actually be used as a type.
|
|
68
80
|
return TypeTagGeneric.load(deserializer);
|
|
@@ -206,6 +218,26 @@ export abstract class TypeTag extends Serializable {
|
|
|
206
218
|
return this instanceof TypeTagU256;
|
|
207
219
|
}
|
|
208
220
|
|
|
221
|
+
/** Signed integer helpers */
|
|
222
|
+
isI8(): this is TypeTagI8 {
|
|
223
|
+
return this instanceof TypeTagI8;
|
|
224
|
+
}
|
|
225
|
+
isI16(): this is TypeTagI16 {
|
|
226
|
+
return this instanceof TypeTagI16;
|
|
227
|
+
}
|
|
228
|
+
isI32(): this is TypeTagI32 {
|
|
229
|
+
return this instanceof TypeTagI32;
|
|
230
|
+
}
|
|
231
|
+
isI64(): this is TypeTagI64 {
|
|
232
|
+
return this instanceof TypeTagI64;
|
|
233
|
+
}
|
|
234
|
+
isI128(): this is TypeTagI128 {
|
|
235
|
+
return this instanceof TypeTagI128;
|
|
236
|
+
}
|
|
237
|
+
isI256(): this is TypeTagI256 {
|
|
238
|
+
return this instanceof TypeTagI256;
|
|
239
|
+
}
|
|
240
|
+
|
|
209
241
|
isPrimitive(): boolean {
|
|
210
242
|
return (
|
|
211
243
|
this instanceof TypeTagSigner ||
|
|
@@ -216,7 +248,13 @@ export abstract class TypeTag extends Serializable {
|
|
|
216
248
|
this instanceof TypeTagU32 ||
|
|
217
249
|
this instanceof TypeTagU64 ||
|
|
218
250
|
this instanceof TypeTagU128 ||
|
|
219
|
-
this instanceof TypeTagU256
|
|
251
|
+
this instanceof TypeTagU256 ||
|
|
252
|
+
this instanceof TypeTagI8 ||
|
|
253
|
+
this instanceof TypeTagI16 ||
|
|
254
|
+
this instanceof TypeTagI32 ||
|
|
255
|
+
this instanceof TypeTagI64 ||
|
|
256
|
+
this instanceof TypeTagI128 ||
|
|
257
|
+
this instanceof TypeTagI256
|
|
220
258
|
);
|
|
221
259
|
}
|
|
222
260
|
}
|
|
@@ -290,6 +328,29 @@ export class TypeTagU8 extends TypeTag {
|
|
|
290
328
|
}
|
|
291
329
|
}
|
|
292
330
|
|
|
331
|
+
/**
|
|
332
|
+
* Represents a type tag for an 8-bit signed integer (i8).
|
|
333
|
+
* This class extends the base TypeTag class and provides methods
|
|
334
|
+
* for serialization and deserialization specific to the i8 type.
|
|
335
|
+
*
|
|
336
|
+
* @extends TypeTag
|
|
337
|
+
* @group Implementation
|
|
338
|
+
* @category Transactions
|
|
339
|
+
*/
|
|
340
|
+
export class TypeTagI8 extends TypeTag {
|
|
341
|
+
toString(): string {
|
|
342
|
+
return "i8";
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
serialize(serializer: Serializer): void {
|
|
346
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I8);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
static load(_deserializer: Deserializer): TypeTagI8 {
|
|
350
|
+
return new TypeTagI8();
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
293
354
|
/**
|
|
294
355
|
* Represents a type tag for unsigned 16-bit integers (u16).
|
|
295
356
|
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
@@ -312,6 +373,28 @@ export class TypeTagU16 extends TypeTag {
|
|
|
312
373
|
}
|
|
313
374
|
}
|
|
314
375
|
|
|
376
|
+
/**
|
|
377
|
+
* Represents a type tag for signed 16-bit integers (i16).
|
|
378
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
379
|
+
*
|
|
380
|
+
* @extends TypeTag
|
|
381
|
+
* @group Implementation
|
|
382
|
+
* @category Transactions
|
|
383
|
+
*/
|
|
384
|
+
export class TypeTagI16 extends TypeTag {
|
|
385
|
+
toString(): string {
|
|
386
|
+
return "i16";
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
serialize(serializer: Serializer): void {
|
|
390
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I16);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
static load(_deserializer: Deserializer): TypeTagI16 {
|
|
394
|
+
return new TypeTagI16();
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
315
398
|
/**
|
|
316
399
|
* Represents a type tag for a 32-bit unsigned integer (u32).
|
|
317
400
|
* This class extends the base TypeTag class and provides methods for serialization
|
|
@@ -335,6 +418,29 @@ export class TypeTagU32 extends TypeTag {
|
|
|
335
418
|
}
|
|
336
419
|
}
|
|
337
420
|
|
|
421
|
+
/**
|
|
422
|
+
* Represents a type tag for a 32-bit signed integer (i32).
|
|
423
|
+
* This class extends the base TypeTag class and provides methods for serialization
|
|
424
|
+
* and deserialization specific to the i32 type.
|
|
425
|
+
*
|
|
426
|
+
* @extends TypeTag
|
|
427
|
+
* @group Implementation
|
|
428
|
+
* @category Transactions
|
|
429
|
+
*/
|
|
430
|
+
export class TypeTagI32 extends TypeTag {
|
|
431
|
+
toString(): string {
|
|
432
|
+
return "i32";
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
serialize(serializer: Serializer): void {
|
|
436
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I32);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
static load(_deserializer: Deserializer): TypeTagI32 {
|
|
440
|
+
return new TypeTagI32();
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
338
444
|
/**
|
|
339
445
|
* Represents a type tag for 64-bit unsigned integers (u64).
|
|
340
446
|
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
@@ -357,6 +463,28 @@ export class TypeTagU64 extends TypeTag {
|
|
|
357
463
|
}
|
|
358
464
|
}
|
|
359
465
|
|
|
466
|
+
/**
|
|
467
|
+
* Represents a type tag for 64-bit signed integers (i64).
|
|
468
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
469
|
+
*
|
|
470
|
+
* @extends TypeTag
|
|
471
|
+
* @group Implementation
|
|
472
|
+
* @category Transactions
|
|
473
|
+
*/
|
|
474
|
+
export class TypeTagI64 extends TypeTag {
|
|
475
|
+
toString(): string {
|
|
476
|
+
return "i64";
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
serialize(serializer: Serializer): void {
|
|
480
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I64);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
static load(_deserializer: Deserializer): TypeTagI64 {
|
|
484
|
+
return new TypeTagI64();
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
360
488
|
/**
|
|
361
489
|
* Represents a type tag for the u128 data type.
|
|
362
490
|
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
@@ -379,6 +507,28 @@ export class TypeTagU128 extends TypeTag {
|
|
|
379
507
|
}
|
|
380
508
|
}
|
|
381
509
|
|
|
510
|
+
/**
|
|
511
|
+
* Represents a type tag for the i128 data type.
|
|
512
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
513
|
+
*
|
|
514
|
+
* @extends TypeTag
|
|
515
|
+
* @group Implementation
|
|
516
|
+
* @category Transactions
|
|
517
|
+
*/
|
|
518
|
+
export class TypeTagI128 extends TypeTag {
|
|
519
|
+
toString(): string {
|
|
520
|
+
return "i128";
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
serialize(serializer: Serializer): void {
|
|
524
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I128);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
static load(_deserializer: Deserializer): TypeTagI128 {
|
|
528
|
+
return new TypeTagI128();
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
382
532
|
/**
|
|
383
533
|
* Represents a type tag for the U256 data type.
|
|
384
534
|
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
@@ -401,6 +551,28 @@ export class TypeTagU256 extends TypeTag {
|
|
|
401
551
|
}
|
|
402
552
|
}
|
|
403
553
|
|
|
554
|
+
/**
|
|
555
|
+
* Represents a type tag for the I256 data type.
|
|
556
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
557
|
+
*
|
|
558
|
+
* @extends TypeTag
|
|
559
|
+
* @group Implementation
|
|
560
|
+
* @category Transactions
|
|
561
|
+
*/
|
|
562
|
+
export class TypeTagI256 extends TypeTag {
|
|
563
|
+
toString(): string {
|
|
564
|
+
return "i256";
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
serialize(serializer: Serializer): void {
|
|
568
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I256);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
static load(_deserializer: Deserializer): TypeTagI256 {
|
|
572
|
+
return new TypeTagI256();
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
404
576
|
/**
|
|
405
577
|
* Represents a type tag for an address in the system.
|
|
406
578
|
* This class extends the TypeTag class and provides functionality
|
|
@@ -16,6 +16,12 @@ import {
|
|
|
16
16
|
TypeTagU32,
|
|
17
17
|
TypeTagU64,
|
|
18
18
|
TypeTagU8,
|
|
19
|
+
TypeTagI8,
|
|
20
|
+
TypeTagI16,
|
|
21
|
+
TypeTagI32,
|
|
22
|
+
TypeTagI64,
|
|
23
|
+
TypeTagI128,
|
|
24
|
+
TypeTagI256,
|
|
19
25
|
TypeTagVector,
|
|
20
26
|
} from ".";
|
|
21
27
|
import { AccountAddress } from "../../core";
|
|
@@ -79,6 +85,12 @@ function isPrimitive(str: string) {
|
|
|
79
85
|
case "u64":
|
|
80
86
|
case "u128":
|
|
81
87
|
case "u256":
|
|
88
|
+
case "i8":
|
|
89
|
+
case "i16":
|
|
90
|
+
case "i32":
|
|
91
|
+
case "i64":
|
|
92
|
+
case "i128":
|
|
93
|
+
case "i256":
|
|
82
94
|
return true;
|
|
83
95
|
default:
|
|
84
96
|
return false;
|
|
@@ -354,6 +366,18 @@ function parseTypeTagInner(str: string, types: Array<TypeTag>, allowGenerics: bo
|
|
|
354
366
|
return new TypeTagU128();
|
|
355
367
|
case "u256":
|
|
356
368
|
return new TypeTagU256();
|
|
369
|
+
case "i8":
|
|
370
|
+
return new TypeTagI8();
|
|
371
|
+
case "i16":
|
|
372
|
+
return new TypeTagI16();
|
|
373
|
+
case "i32":
|
|
374
|
+
return new TypeTagI32();
|
|
375
|
+
case "i64":
|
|
376
|
+
return new TypeTagI64();
|
|
377
|
+
case "i128":
|
|
378
|
+
return new TypeTagI128();
|
|
379
|
+
case "i256":
|
|
380
|
+
return new TypeTagI256();
|
|
357
381
|
case "vector":
|
|
358
382
|
if (types.length !== 1) {
|
|
359
383
|
throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedVectorTypeArgumentCount);
|
package/src/types/types.ts
CHANGED
|
@@ -46,6 +46,12 @@ export enum TypeTagVariants {
|
|
|
46
46
|
U16 = 8,
|
|
47
47
|
U32 = 9,
|
|
48
48
|
U256 = 10,
|
|
49
|
+
I8 = 11,
|
|
50
|
+
I16 = 12,
|
|
51
|
+
I32 = 13,
|
|
52
|
+
I64 = 14,
|
|
53
|
+
I128 = 15,
|
|
54
|
+
I256 = 16,
|
|
49
55
|
Reference = 254, // This is specifically a placeholder and does not represent a real type
|
|
50
56
|
Generic = 255, // This is specifically a placeholder and does not represent a real type
|
|
51
57
|
}
|
|
@@ -246,6 +252,36 @@ export type Uint128 = bigint;
|
|
|
246
252
|
*/
|
|
247
253
|
export type Uint256 = bigint;
|
|
248
254
|
|
|
255
|
+
/**
|
|
256
|
+
* A signed 8-bit integer.
|
|
257
|
+
*/
|
|
258
|
+
export type Int8 = number;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* A signed 16-bit integer.
|
|
262
|
+
*/
|
|
263
|
+
export type Int16 = number;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* A signed 32-bit integer.
|
|
267
|
+
*/
|
|
268
|
+
export type Int32 = number;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* A signed 64-bit integer.
|
|
272
|
+
*/
|
|
273
|
+
export type Int64 = bigint;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* A signed 128-bit integer.
|
|
277
|
+
*/
|
|
278
|
+
export type Int128 = bigint;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* A signed 256-bit integer.
|
|
282
|
+
*/
|
|
283
|
+
export type Int256 = bigint;
|
|
284
|
+
|
|
249
285
|
/**
|
|
250
286
|
* A number or a bigint value.
|
|
251
287
|
*/
|
package/src/version.ts
CHANGED