/// <reference types="node" />
import { Message, Properties } from "protobufjs/light";
import { LongTermSecret } from "../calypso";
import ByzCoinRPC from "../byzcoin/byzcoin-rpc";
import CoinInstance, { Coin } from "../byzcoin/contracts/coin-instance";
import Instance, { InstanceID } from "../byzcoin/instance";
import Signer from "../darc/signer";
export default class RoPaSciInstance extends Instance {
    private rpc;
    readonly stake: Coin;
    readonly playerChoice: number;
    /**
     * Getter for the second player ID
     * @returns id as a buffer
     */
    readonly adversaryID: Buffer;
    /**
     * Getter for the second player choice
     * @returns the choice as a number
     */
    readonly adversaryChoice: number;
    static readonly contractID = "ropasci";
    static fromObject(rpc: ByzCoinRPC, obj: any): RoPaSciInstance;
    /**
     * Fetch the proof for the given instance and create a
     * RoPaSciInstance from it
     *
     * @param bc    The ByzCoinRPC to use
     * @param iid   The instance ID
     * @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 the new instance
     */
    static fromByzcoin(bc: ByzCoinRPC, iid: InstanceID, waitMatch?: number, interval?: number): Promise<RoPaSciInstance>;
    struct: RoPaSciStruct;
    private fillUp;
    private firstMove;
    constructor(rpc: ByzCoinRPC, inst: Instance);
    /**
     * Update the instance data
     *
     * @param choice The choice of the first player
     * @param fillup The fillup of the first player
     */
    setChoice(choice: number, fillup: Buffer): void;
    /**
     * Returns the firstMove and the fillUp values.
     */
    getChoice(): [number, Buffer | undefined];
    /**
     * Check if both players have played their moves
     *
     * @returns true when both have played, false otherwise
     */
    isDone(): boolean;
    /**
     * returns true if there is a CalypsoWrite instance stored.
     */
    isCalypso(): boolean;
    /**
     * ourGame returns if this game belongs to the given coin.
     * @param coinID
     */
    ourGame(coinID: InstanceID): boolean;
    /**
     * Play the adversary move
     *
     * @param coin      The CoinInstance of the second player
     * @param signer    Signer for the transaction
     * @param choice    The choice of the second player
     * @returns a promise that resolves on success, or rejects with the error
     */
    second(coin: CoinInstance, signer: Signer, choice: number, lts?: LongTermSecret): Promise<void>;
    /**
     * Reveal the move of the first player
     *
     * @param coin The CoinInstance of the first player
     * @returns a promise that resolves on success, or rejects
     * with the error
     */
    confirm(coin: CoinInstance): Promise<void>;
    /**
     * Update the state of the instance
     *
     * @returns a promise that resolves with the updated instance,
     * or rejects with the error
     */
    update(): Promise<RoPaSciInstance>;
    toObject(): any;
}
/**
 * Data hold by a rock-paper-scissors instance
 */
export declare class RoPaSciStruct extends Message<RoPaSciStruct> {
    /**
     * @see README#Message classes
     */
    static register(): void;
    readonly description: string;
    readonly stake: Coin;
    readonly firstPlayerHash: Buffer;
    readonly firstPlayer: number;
    readonly secondPlayer: number;
    readonly secondPlayerAccount: Buffer;
    readonly firstPlayerAccount: Buffer | undefined;
    readonly calypsoWrite: Buffer;
    readonly calypsoRead: Buffer;
    constructor(props?: Properties<RoPaSciStruct>);
    /**
     * Helper to encode the struct using protobuf
     *
     * @returns the data as a buffer
     */
    toBytes(): Buffer;
}
