import { Argument } from "..";
import { IIdentity } from "../../darc";
import Darc from "../../darc/darc";
import Signer from "../../darc/signer";
import ByzCoinRPC from "../byzcoin-rpc";
import Instance, { InstanceID } from "../instance";
export default class DarcInstance extends Instance {
    private rpc;
    static readonly contractID = "darc";
    static readonly commandEvolve = "evolve";
    static readonly commandEvolveUnrestricted = "evolve_unrestricted";
    static readonly argumentDarc = "darc";
    static readonly ruleEvolve: string;
    static readonly ruleEvolveUnrestricted: string;
    /**
     * Initializes using an existing coinInstance from ByzCoin
     *
     * @param bc a working ByzCoin instance
     * @param iid the instance id of the darc-instance
     * @param waitMatch how many times to wait for a match - useful if its called just after an addTransactionAndWait.
     * @param interval how long to wait between two attempts in waitMatch.
     * @returns a promise that resolves with the darc instance
     */
    static fromByzcoin(bc: ByzCoinRPC, iid: InstanceID, waitMatch?: number, interval?: number): Promise<DarcInstance>;
    /**
     * spawn creates a new darc, given a darcID.
     *
     * @param rpc a working ByzCoin instance
     * @param darcID a darc that has the right to spawn new darcs
     * @param signers fulfilling the `spawn:darc` rule of the darc pointed to by darcID
     * @param newD the new darc to spawn
     */
    static spawn(rpc: ByzCoinRPC, darcID: InstanceID, signers: Signer[], newD: Darc): Promise<DarcInstance>;
    /**
     * create returns a DarcInstance, given a ByzCoin and a darc. The instance must already exist on
     * ByzCoin. This method does not verify if it does or not.
     *
     * @param rpc a working ByzCoin instance
     * @param d the darc
     */
    static create(rpc: ByzCoinRPC, d: Darc): DarcInstance;
    private _darc;
    /**
     * Returns a copy of the darc.
     */
    readonly darc: Darc;
    constructor(rpc: ByzCoinRPC, inst: Instance);
    /**
     * Update the data of this instance
     *
     * @return a promise that resolves once the data is up-to-date
     */
    update(): Promise<DarcInstance>;
    /**
     * Searches for the rule that corresponds to the Darc.ruleSign action. If that rule
     * does not exist, it returns an error.
     */
    getSignerIdentities(): string[];
    /**
     * Returns all darcs that are stored in the signer expression. It leaves out any
     * other element of the expression.
     */
    getSignerDarcIDs(): InstanceID[];
    /**
     * Request to evolve the existing darc using the new darc and wait for
     * the block inclusion
     *
     * @param newDarc The new darc
     * @param signers Signers for the counters
     * @param wait Number of blocks to wait for
     * @returns a promise that resolves with the new darc instance
     */
    evolveDarcAndWait(newDarc: Darc, signers: Signer[], wait: number, unrestricted?: boolean): Promise<DarcInstance>;
    /**
     * Request to spawn an instance and wait for the inclusion
     *
     * @param d             The darc to spawn
     * @param signers       Signers for the counters
     * @param wait          Number of blocks to wait for
     * @returns a promise that resolves with the new darc instance
     */
    spawnDarcAndWait(d: Darc, signers: Signer[], wait?: number): Promise<DarcInstance>;
    /**
     * Request to spawn an instance of any contract and wait
     *
     * @param contractID    Contract name of the new instance
     * @param signers       Signers for the counters
     * @param wait          Number of blocks to wait for
     * @returns a promise that resolves with the instanceID of the new instance, which is only valid if the
     *          contract.spawn uses DeriveID.
     */
    spawnInstanceAndWait(contractID: string, args: Argument[], signers: Signer[], wait?: number): Promise<InstanceID>;
    /**
     * Checks whether the given rule can be matched by a multi-signature created by all
     * signers. If the rule doesn't exist, this method silently returns 'false'.
     * Currently only Rule.OR are supported. A Rule.AND or "(" will return an error.
     * Currently only 1 signer is supported.
     *
     * @param action the action to match
     * @param signers all supposed signers for this action.
     */
    ruleMatch(action: string, signers: IIdentity[]): Promise<boolean>;
}
