/// <reference types="node" />
import { Argument, ByzCoinRPC, ClientTransaction, InstanceID, Instruction } from "../../byzcoin";
import { AddTxResponse } from "../../byzcoin/proto/requests";
import ISigner from "../../darc/signer";
/**
 * TransactionBuilder handles collecting multiple instructions and signing them all
 * together before sending the transaction to the chain.
 * There are convenience methods to create spawn, invoke, or delete instructions.
 * Once all instructions are added, the send method will contact one or more nodes
 * to submit the transaction.
 * After a call to the send method, the transaction is ready for new instructions.
 *
 * If any of the instructions in this transaction fails, all other instructions will
 * fail, too.
 */
export declare class TransactionBuilder {
    protected bc: ByzCoinRPC;
    private instructions;
    constructor(bc: ByzCoinRPC);
    /**
     * Signs all instructions and sends them to the nodes.
     * The `instructions` field is only emptied if the transaction has been accepted successfully.
     * If the transaction fails, it can be retried.
     *
     * @param signers one set of signers per instruction. If there is only one set for multiple
     * instructions, always the same set of signers will be used.
     * @param wait if 0, doesn't wait for inclusion. If > 0, waits for inclusion for this many blockIntervals.
     */
    send(signers: ISigner[][], wait?: number): Promise<[ClientTransaction, AddTxResponse]>;
    /**
     * @return true if one or more instructions are available.
     */
    hasInstructions(): boolean;
    /**
     * Appends a new instruction.
     *
     * @param inst the new instruction to append
     * @return the appended instruction
     */
    append(inst: Instruction): Instruction;
    /**
     * Prepends a new instruction
     *
     * @param inst the instruction to prepend
     * @return the prepended instruction
     */
    prepend(inst: Instruction): Instruction;
    /**
     * Appends a spawn instruction.
     *
     * @param iid the instance ID where the instruction is sent to
     * @param contractID the contractID to spawn
     * @param args arguments of the contract
     * @return new instruction - can be used for deriveID
     */
    spawn(iid: Buffer, contractID: string, args: Argument[]): Instruction;
    /**
     * Appends an invoke instruction.
     *
     * @param iid the instance ID where the instruction is sent to
     * @param contractID the contractID to invoke
     * @param command to be invoked on the contract
     * @param args arguments of the command
     * @return new instruction - can be used for deriveID
     */
    invoke(iid: Buffer, contractID: string, command: string, args: Argument[]): Instruction;
    /**
     * Appends a delete instruction.
     *
     * @param iid the instance ID where the instruction is sent to
     * @param contractID to be deleted - must match the actual contract
     * @return new instruction - can be used for deriveID
     */
    delete(iid: Buffer, contractID: string): Instruction;
    /**
     * Returns the ID that will be produced by the given instruction
     *
     * @param index of the instruction
     * @param name if given, will be passed to deriveID
     */
    deriveID(index: number, name?: string): InstanceID;
    /**
     * returns a useful and readable representation of all instructions in this transaction.
     */
    toString(): string;
}
