/// <reference types="node" />
import { InstanceID } from "../../../byzcoin";
import { Darc } from "../../../darc";
import { TransactionBuilder } from "../transactionBuilder";
import { IDarcAttr } from "./darcInsts";
/**
 * DarcContract represents a darc taken from an instance. It has all necessary constants to interact with a darc
 * contract on byzcoin.
 */
export declare const contractID = "darc";
export declare const commandEvolve = "evolve";
export declare const commandEvolveUnrestricted = "evolve_unrestricted";
export declare const argumentDarc = "darc";
export declare const ruleSign = "_sign";
export declare const ruleEvolve: string;
export declare const ruleEvolveUnrestricted: string;
/**
 * Creates an instruction in the transaction with either an update of the description and/or an update
 * of the rules.
 *
 * @param tx where the instruction will be appended to
 * @param oldDarc that needs to be evolved
 * @param updates contains a description update and/or rules to be merged
 * @param unrestricted if true, will create an unrestricted evolve that allows to create new rules
 * @return the new DARC as it will appear on ByzCoin if the transaction is accepted
 */
export declare function evolve(tx: TransactionBuilder, oldDarc: Darc, updates: IDarcAttr, unrestricted?: boolean): Darc;
/**
 * Creates the instruction necessary to spawn a new coin using this darc.
 *
 * @param tx where the instruction will be appended to
 * @param did baseID of the darc that can spawn coins
 * @param name of the coin
 * @param preHash used to calculate the ID of the coin, if given
 */
export declare function spawnCoin(tx: TransactionBuilder, did: InstanceID, name: Buffer, preHash?: Buffer): InstanceID;
/**
 * Spawns a new darc. The darc given by did must have a `spawn:darc` rule.
 *
 * @param tx where the instruction will be appended to
 * @param did baseID of the darc that can spawn other darcs
 * @param newDarc to be spawned
 */
export declare function spawnDarc(tx: TransactionBuilder, did: InstanceID, newDarc: Darc): void;
