UNPKG

@aptos-labs/ts-sdk

Version:
73 lines (70 loc) 3.07 kB
import { AnyRawTransaction, AnyRawTransactionInstance } from '../types.mjs'; import { Serializable } from '../../bcs/serializer.mjs'; import '../../api/aptosConfig.mjs'; import '../../types/index.mjs'; import '../../utils/apiEndpoints.mjs'; import '../../types/indexer.mjs'; import '../../types/generated/operations.mjs'; import '../../types/generated/types.mjs'; import '../../utils/const.mjs'; import '../../bcs/serializable/moveStructs.mjs'; import '../../bcs/serializable/movePrimitives.mjs'; import '../../bcs/deserializer.mjs'; import '../instances/transactionArgument.mjs'; import '../../core/hex.mjs'; import '../../core/common.mjs'; import '../../bcs/serializable/fixedBytes.mjs'; import '../../core/accountAddress.mjs'; import '../../publicKey-B3XRNhHO.mjs'; import '../../core/crypto/signature.mjs'; import '../instances/rawTransaction.mjs'; import '../instances/chainId.mjs'; import '../instances/transactionPayload.mjs'; import '../instances/identifier.mjs'; import '../instances/moduleId.mjs'; import '../typeTag/index.mjs'; import '../authenticator/account.mjs'; import '../../core/crypto/ed25519.mjs'; import '../../core/crypto/privateKey.mjs'; import '../../core/crypto/multiEd25519.mjs'; import '../../core/crypto/multiKey.mjs'; import '../../core/crypto/singleKey.mjs'; import '../instances/simpleTransaction.mjs'; import '../instances/multiAgentTransaction.mjs'; /** * Derive the raw transaction type - FeePayerRawTransaction or MultiAgentRawTransaction or RawTransaction * * @param transaction A aptos transaction type * * @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction */ declare function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance; /** * Generates the 'signing message' form of a message to be signed. * * @param bytes The byte representation of the message to be signed and sent to the chain * @param domainSeparator A domain separator that starts with 'APTOS::' * * @returns The Uint8Array of the signing message */ declare function generateSigningMessage(bytes: Uint8Array, domainSeparator: string): Uint8Array; /** * Generates the 'signing message' form of a serilizable value. It bcs serializes the value and uses the name of * its constructor as the domain separator. * * @param serializable An object that has a bcs serialized form * * @returns The Uint8Array of the signing message */ declare function generateSigningMessageForSerializable(serializable: Serializable): Uint8Array; /** * Generates the 'signing message' form of a transaction. It derives the type of transaction and * applies the appropriate domain separator based on if there is extra data such as a fee payer or * secondary signers. * * @param transaction A transaction that is to be signed * * @returns The Uint8Array of the signing message */ declare function generateSigningMessageForTransaction(transaction: AnyRawTransaction): Uint8Array; export { deriveTransactionType, generateSigningMessage, generateSigningMessageForSerializable, generateSigningMessageForTransaction };