import { Buffer } from 'buffer/index.js'; import { AccountTransaction, AccountTransactionHeader, AccountTransactionSignature, AccountTransactionType, CredentialDeploymentDetails, CredentialDeploymentInfo, UnsignedCredentialDeploymentInformation } from './types.js'; import * as AccountAddress from './types/AccountAddress.js'; import * as Energy from './types/Energy.js'; export declare function serializeAccountTransactionType(type: AccountTransactionType): Buffer; /** * Serialization of an account transaction header. The payload size is a part of the header, * but is factored out of the type as it always has to be derived from the serialized * transaction payload, which cannot happen until the payload has been constructed. * @param header the account transaction header with metadata about the transaction * @param payloadSize the byte size of the serialized payload * @param energyAmount dedicated amount of energy for this transaction, if it is insufficient, the transaction will fail * @returns the serialized account transaction header */ export declare function serializeAccountTransactionHeader(header: AccountTransactionHeader, payloadSize: number, energyAmount: Energy.Type): Buffer; /** * Serializes a map of account transaction signatures. If no signatures are provided, * then an error is thrown. */ export declare function serializeAccountTransactionSignature(signatures: AccountTransactionSignature): Buffer; /** * Serializes a transaction and its signatures. This serialization when sha256 hashed * is considered as the transaction hash, and is used to look up the status of a * submitted transaction. * @param accountTransaction the transaction to serialize * @param signatures signatures on the signed digest of the transaction * @returns the serialization of the account transaction, which is used to calculate the transaction hash */ export declare function serializeAccountTransaction(accountTransaction: AccountTransaction, signatures: AccountTransactionSignature): Buffer; /** * Serializes a transaction payload. * @param accountTransaction the transaction which payload is to be serialized * @returns the account transaction payload serialized as a buffer. */ export declare function serializeAccountTransactionPayload(accountTransaction: Omit): Buffer; /** * Gets the transaction hash that is used to look up the status of a transaction. * @param accountTransaction the transaction to hash * @param signatures the signatures that will also be part of the hash * @returns the sha256 hash of the serialized block item kind, signatures, header, type and payload */ export declare function getAccountTransactionHash(accountTransaction: AccountTransaction, signatures: AccountTransactionSignature): string; /** * Returns the digest of the transaction that has to be signed. * @param accountTransaction the transaction to hash * @param signatureCount number of expected signatures * @returns the sha256 hash on the serialized header, type and payload */ export declare function getAccountTransactionSignDigest(accountTransaction: AccountTransaction, signatureCount?: bigint): Buffer; /** * @deprecated describes an unused serialization format - use {@linkcode serializeAccountTransaction} instead. * * Serializes an account transaction so that it is ready for being submitted * to the node. This consists of the standard serialization of an account transaction * prefixed by a version byte. * * @param accountTransaction the transaction to serialize * @param signatures the signatures on the hash of the account transaction * * @returns the serialization of the account transaction ready for being submitted to a node */ export declare function serializeAccountTransactionForSubmission(accountTransaction: AccountTransaction, signatures: AccountTransactionSignature): Buffer; /** * Serializes a signed credential used as part of an update credentials account * transaction. * @param credential the already signed credential deployment information * @returns the serialization of the signed credential */ export declare function serializeCredentialDeploymentInfo(credential: CredentialDeploymentInfo): Buffer; /** * Returns the digest to be signed for a credential that has been generated for * deployment to an existing account. * @param unsignedCredentialDeploymentInfo the credential information to be deployed to an existing account * @returns the sha256 of the serialization of the unsigned credential */ export declare function getCredentialForExistingAccountSignDigest(unsignedCredentialDeploymentInfo: UnsignedCredentialDeploymentInformation, address: AccountAddress.Type): Buffer; /** * Returns the digest of the credential deployment transaction that has to be signed. * @param credentialDeployment the credential deployment transaction * @returns the sha256 of the serialized unsigned credential deployment information */ export declare function getCredentialDeploymentSignDigest(credentialDeployment: CredentialDeploymentDetails): Buffer;