/// <reference types="node" />
import { AddressOrPair, SubmittableExtrinsic } from '@polkadot/api/types';
import { DispatchError } from '@polkadot/types/interfaces';
import { ISubmittableResult } from '@polkadot/types/types';
import BigNumber from 'bignumber.js';
import { EventEmitter } from 'events';
import { TxTag } from "../polkadot/types";
import { Account, Context, Identity, PolymeshError } from "../internal";
import { Fees, TransactionStatus } from "../types";
import { BaseTransactionSpec, PolymeshTx, PostTransactionValueArray } from "../types/internal";
/**
 * Wrapper class for a Polymesh Transaction
 */
export declare abstract class PolymeshTransactionBase<Args extends unknown[], Values extends unknown[] = unknown[]> {
    /**
     * current status of the transaction
     */
    status: TransactionStatus;
    /**
     * stores errors thrown while running the transaction (status: `Failed`, `Aborted`)
     */
    error?: PolymeshError;
    /**
     * stores the transaction receipt (if successful)
     */
    receipt?: ISubmittableResult;
    /**
     * transaction hash (status: `Running`, `Succeeded`, `Failed`)
     */
    txHash?: string;
    /**
     * hash of the block where this transaction resides (status: `Succeeded`, `Failed`)
     */
    blockHash?: string;
    /**
     * whether this transaction failing makes the entire transaction queue fail or not
     */
    isCritical: boolean;
    /**
     * type of transaction represented by this instance (mostly for display purposes)
     */
    tag: TxTag;
    /**
     * @hidden
     *
     * Identity that will pay for this transaction's fees. This value overrides any subsidy,
     *   and is seen as having infinite allowance (but still constrained by its current balance)
     */
    protected paidForBy?: Identity;
    /**
     * @hidden
     *
     * underlying transaction to be executed
     */
    protected tx: PolymeshTx<Args>;
    /**
     * @hidden
     *
     * number of elements in the batch (only applicable to batch transactions)
     */
    protected batchSize: number | null;
    /**
     * @hidden
     *
     * wrappers for values that will exist after this transaction has executed
     */
    protected postValues: PostTransactionValueArray<Values>;
    /**
     * @hidden
     *
     * internal event emitter to handle status changes
     */
    protected emitter: EventEmitter;
    /**
     * @hidden
     *
     * account that will sign the transaction
     */
    protected signer: AddressOrPair;
    /**
     * @hidden
     *
     * used by procedures to set the fee manually in case the protocol op can't be
     *   dynamically generated from the transaction name
     */
    protected protocolFee: BigNumber | null;
    protected context: Context;
    /**
     * @hidden
     */
    constructor(transactionSpec: BaseTransactionSpec<Args, Values>, context: Context);
    /**
     * Run the transaction and update its status
     */
    run(): Promise<void>;
    /**
     * @hidden
     *
     * Execute the underlying transaction, updating the status where applicable and
     *   throwing any pertinent errors
     */
    private internalRun;
    /**
     * Subscribe to status changes
     *
     * @param listener - callback function that will be called whenever the status changes
     *
     * @returns unsubscribe function
     */
    onStatusChange(listener: (transaction: this) => void): () => void;
    /**
     * Retrieve the Account that would pay for the transaction fees if it was run at this moment, as well as the maximum amount that can be
     *   charged to it. A null allowance means that there is no limit to that amount
     *
     * A null return value signifies that the current Account will pay for the fees
     *
     * @note this value might change if, before running the transaction, the current Account enters (or leaves)
     *   a subsidizer relationship
     */
    getPayingAccount(): Promise<{
        account: Account;
        allowance: BigNumber | null;
    } | null>;
    /**
     * Get all (protocol and gas) fees associated with this transaction. Returns null
     * if the transaction is not ready yet (this can happen if it depends on the execution of a
     * previous transaction in the queue)
     *
     * @note this value might change if the transaction is run at a later time. This can be due to a governance vote
     */
    getFees(): Promise<Fees | null>;
    /**
     * @hidden
     */
    protected updateStatus(status: TransactionStatus): void;
    /**
     * @hidden
     *
     * Compose a Transaction Object with arguments that can be signed
     */
    protected abstract composeTx(): SubmittableExtrinsic<'promise', ISubmittableResult>;
    /**
     * @hidden
     */
    protected handleExtrinsicFailure(_resolve: (value: ISubmittableResult | PromiseLike<ISubmittableResult>) => void, reject: (reason?: unknown) => void, error: DispatchError, data?: Record<string, unknown>): void;
    /**
     * @hidden
     */
    protected handleExtrinsicSuccess(resolve: (value: ISubmittableResult | PromiseLike<ISubmittableResult>) => void, _reject: (reason?: unknown) => void, receipt: ISubmittableResult): void;
}
//# sourceMappingURL=PolymeshTransactionBase.d.ts.map