import { Operation } from './model/transaction'; import { ProposalCreateParameters } from './model/proposal'; import { KeyPrivate } from './model/utils'; export declare enum TransactionBuilderError { invalid_parameters = "invalid_parameters", failed_to_sign_transaction = "failed_to_sign_transaction", } /** * Class contains available transaction operation names constants */ export declare class TransactionBuilder { /** * dcore_js.lib/lib - TransactionBuilder */ private _transaction; private _operations; constructor(); /** * List of operations added to transaction * @return {Operation[]} */ readonly operations: Operation[]; /** * Get dcorejs-lib format transaction. * * @returns {any} dcorejs-lib transaction object. */ readonly transaction: any; /** * Append new operation to transaction object. * * @param {Operation} operation Operation to append to transaction. * @return {boolean} Successful operation add value. */ addOperation(operation: Operation): void; /** * Transform transaction into proposal type transaction. * * @param {IProposalCreateParameters} proposalParameters Proposal transaction parameters. */ propose(proposalParameters: ProposalCreateParameters): void; /** * Broadcast transaction to DCore blockchain. * * @param {string} privateKey Private key to sign transaction in WIF(hex)(Wallet Import Format) format . * @param sign If value is 'true' transaction will be singed, in 'false' transaction will not be signed. * Default 'true' * @return {Promise} Void. */ broadcast(privateKey: string, sign?: boolean): Promise; /** * Set transaction fee required for transaction operation * * @return {Promise} Void. */ setTransactionFees(): Promise; /** * Sign transaction with given private/public key pair. * * @param {KeyPrivate} privateKey Private key to sign transaction. */ signTransaction(privateKey: KeyPrivate): void; /** * Replace operation on operationIndex with newOperation * * @param {number} operationIndex Index of operation to replace. Must be greater than 0 and smaller than * length of operations. * @param {Operation} newOperation Operation to be placed to index. * @returns {boolean} Returns true if replaced, false otherwise. */ replaceOperation(operationIndex: number, newOperation: Operation): boolean; /** * Displays current transaction * @returns {any} dcorejs-lib format transaction object. */ previewTransaction(): any; }