import { TransactionReceiptTruffle } from "./contractWrapperBase";
import { EventService, IEventSubscription } from "./eventService";
/**
 * Enables you to track the completion of transactions triggered by Arc.js functions.
 * You can subscribe to events that tell you how many transactions are anticipated when
 * the transactions have completed.  For more information, see [subscribe](TransactionService#subscribe).
 */
export declare class TransactionService extends EventService {
    /**
     * Generate a new invocation key for the given topic and function.
     * Topic should look like "[classname][functionname]".
     * @param topic
     */
    static generateInvocationKey(topic: string): symbol;
    /**
     * Publish the kick-off event and return the payload that should be used for the ensuing
     * events that will carry an actual tx in the payload for the invoked function.
     * `invocationKey` is a unique key for the returned payload that can be used for scoping
     * the events.
     * @param topic
     * @param options
     * @param txCount
     * @param suppressKickOff
     */
    static publishKickoffEvent(topic: string, options: any, txCount: number, suppressKickOff?: boolean): TransactionReceiptsEventInfo;
    /**
     * Send the given payload to subscribers of the given topic.
     *
     * @param topic See [subscribe](EventService#subscribe)
     * @param payload Sent in the subscription callback.
     * @param tx the transaction.  Don't supply for kick-off event.
     * @returns True if there are any subscribers
     */
    static publishTxEvent(topic: string, payload: TransactionReceiptsEventInfo, tx?: TransactionReceiptTruffle): boolean;
    /**
     * Subscribe to all given topics and resend as the given supertopic with superPayload.
     * @param topics topics or topic
     * @param superTopic topic to resend as
     * @param superPayload payload to send
     * @returns An interface with `.unsubscribe()`.  Be sure to call it!
     */
    static resendTxEvents(topics: Array<string> | string, superTopic: string, superPayload: TransactionReceiptsEventInfo): IEventSubscription;
}
/**
 * Information supplied to the event callback when the event is published.
 */
export interface TransactionReceiptsEventInfo {
    /**
     * A value that is unique to the invocation of the function that is publishing the event.
     * This is useful for grouping events by a single function invocation.
     */
    invocationKey: symbol;
    /**
     * The options that were passed to the function that is publishing the event, if any.
     * This will have default values filled in.
     */
    options?: any;
    /**
     * The receipt for the transaction that has completed.  Note that the tx may not necessarily have
     * completed successfully in the case of errors or rejection.
     *
     * If null then this is a "kick-off" event that announces to the subscriber that more events
     * are to follow for the given invocationKey.  Every function will publish a kick-off event before
     * firing events with a tx.
     */
    tx: TransactionReceiptTruffle | null;
    /**
     * The total expected number of transactions.
     */
    txCount: number;
}
