/// <reference types="node" />
import Long from "long";
import { Message, Properties } from "protobufjs/light";
import Signer from "../../darc/signer";
import ByzCoinRPC from "../byzcoin-rpc";
import Instance, { InstanceID } from "../instance";
export default class CoinInstance extends Instance {
    private rpc;
    static readonly contractID = "coin";
    static readonly commandMint = "mint";
    static readonly commandFetch = "fetch";
    static readonly commandTransfer = "transfer";
    static readonly commandStore = "store";
    static readonly argumentCoinID = "coinID";
    static readonly argumentDarcID = "darcID";
    static readonly argumentType = "type";
    static readonly argumentCoins = "coins";
    static readonly argumentDestination = "destination";
    /**
     * Generate the coin instance ID for a given darc ID
     *
     * @param buf Any buffer that is known to the caller
     * @returns the id as a buffer
     */
    static coinIID(buf: Buffer): InstanceID;
    /**
     * Spawn a coin instance from a darc id
     *
     * @param bc        The RPC to use
     * @param darcID    The darc instance ID
     * @param signers   The list of signers for the transaction
     * @param type      The coin instance type
     * @param preID     If given, the InstanceID of the coin will be sha256("coin" | preID)
     * @returns a promise that resolves with the new instance
     */
    static spawn(bc: ByzCoinRPC, darcID: InstanceID, signers: Signer[], type: Buffer, preID?: Buffer): Promise<CoinInstance>;
    /**
     * Create returns a CoinInstance from the given parameters.
     * @param bc
     * @param coinID
     * @param darcID
     * @param coin
     */
    static create(bc: ByzCoinRPC, coinID: InstanceID, darcID: InstanceID, coin: Coin): CoinInstance;
    /**
     * Initializes using an existing coinInstance from ByzCoin
     * @param bc    The RPC 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 a promise that resolves with the coin instance
     */
    static fromByzcoin(bc: ByzCoinRPC, iid: InstanceID, waitMatch?: number, interval?: number): Promise<CoinInstance>;
    _coin: Coin;
    /**
     * @return value of the coin.
     */
    readonly value: Long;
    /**
     * @return the name of the coin, which is a 32-byte Buffer.
     */
    readonly name: Buffer;
    /**
     * Constructs a new CoinInstance. If the instance is not of type CoinInstance,
     * an error will be thrown.
     *
     * @param rpc a working RPC instance
     * @param inst an instance representing a CoinInstance
     */
    constructor(rpc: ByzCoinRPC, inst: Instance);
    /**
     * Transfer a certain amount of coin to another account.
     *
     * @param coins     the amount
     * @param to        the destination account (must be a coin contract instance id)
     * @param signers   the signers (of the giver account)
     */
    transfer(coins: Long, to: Buffer, signers: Signer[]): Promise<void>;
    /**
     * Mine a given amount of coins
     *
     * @param signers   The list of signers for the transaction
     * @param amount    The amount to add to the coin instance
     * @param wait      Number of blocks to wait for inclusion
     */
    mint(signers: Signer[], amount: Long, wait?: number): Promise<void>;
    /**
     * Update the data of this instance
     *
     * @returns the updated instance
     */
    update(): Promise<CoinInstance>;
}
export declare class Coin extends Message<Coin> {
    /**
     * @see README#Message classes
     */
    static register(): void;
    name: Buffer;
    value: Long;
    constructor(props?: Properties<Coin>);
    toBytes(): Buffer;
}
