import { Address } from "./address"; import { IPlainTransactionObject } from "./interfaces"; /** * An abstraction for creating and signing transactions. */ export declare class Transaction { /** * The nonce of the transaction (the account sequence number of the sender). */ nonce: bigint; /** * The value to transfer. */ value: bigint; /** * The address of the sender. */ sender: Address; /** * The address of the receiver. */ receiver: Address; /** * The username of the sender. */ senderUsername: string; /** * The username of the receiver. */ receiverUsername: string; /** * The gas price to be used. */ gasPrice: bigint; /** * The maximum amount of gas to be consumed when processing the transaction. */ gasLimit: bigint; /** * The payload of the transaction. */ data: Uint8Array; /** * The chain ID of the Network (e.g. "1" for Mainnet). */ chainID: string; /** * The version, required by the Network in order to correctly interpret the contents of the transaction. */ version: number; /** * The options field, useful for describing different settings available for transactions. */ options: number; /** * The address of the guardian, in bech32 format. */ guardian: Address; /** * The relayer address. * Note: in the next major version, `sender`, `receiver` and `guardian` will also have the type `Address`, instead of `string`. */ relayer: Address; /** * The signature. */ signature: Uint8Array; /** * The signature of the guardian. */ guardianSignature: Uint8Array; /** * The signature of the relayer. */ relayerSignature: Uint8Array; /** * Creates a new Transaction object. */ constructor(options: { nonce?: bigint; value?: bigint; sender: Address; receiver: Address; senderUsername?: string; receiverUsername?: string; gasPrice?: bigint; gasLimit: bigint; data?: Uint8Array; chainID: string; version?: number; options?: number; guardian?: Address; relayer?: Address; signature?: Uint8Array; guardianSignature?: Uint8Array; relayerSignature?: Uint8Array; }); /** * Checks the integrity of the guarded transaction */ isGuardedTransaction(): boolean; /** * Converts the transaction object into a ready-to-serialize, plain JavaScript object. * This function is called internally within the signing procedure. */ toPlainObject(): IPlainTransactionObject; /** * Converts a plain object transaction into a Transaction Object. * * @param plainObjectTransaction Raw data of a transaction, usually obtained by calling toPlainObject() */ static newFromPlainObject(plainObjectTransaction: IPlainTransactionObject): Transaction; /** * Converts a transaction to a ready-to-broadcast object. * Called internally by the network provider. */ toSendable(): any; private toBase64OrUndefined; private toHexOrUndefined; }