import { bsv, SigHashPreimage, Bytes, Sig, Ripemd160 } from "scryptlib";
import { hash } from "./sha";
import { oracleDetail } from "./oracle";
import { balance } from "./lmsr";
import { AbstractContract } from "scryptlib/dist/contract";
import { FunctionCall } from "scryptlib/dist/abi";
import { marketVersion } from "./contracts";
interface PM extends AbstractContract {
    updateMarket(preimage: SigHashPreimage, action: number, payoutAddress: Ripemd160, changeSats: number, publicKey: Bytes, newLiquidity: number, newEntryShares: Bytes, lastEntry: Bytes, lastMerklePath: Bytes, prevLiquidity: number, prevShares: Bytes, prevAccLiquidityFeePoolState: number, prevLiquidityPoints: number, redeemLiquidity: boolean, signature: Sig, merklePath: Bytes, oraclePos: number, oracleSig: BigInt, paddingCount: number, oracleDecision: number, dustLimit: number): FunctionCall;
}
export declare type option = {
    name: string;
    details?: string;
};
export declare type marketDetails = {
    resolve: string;
    details: string;
    options: option[];
};
export declare type marketStatus = {
    decided: boolean;
    decision: number;
    votes: number[];
    liquidityFeePool: number;
    accLiquidityFeePool: number;
    liquidityPoints: number;
};
export declare type entry = {
    balance: balance;
    publicKey: bsv.PublicKey;
    globalLiqidityFeePoolSave: number;
    liquidityPoints: number;
};
export declare type creatorInfo = {
    pubKey: bsv.PublicKey;
    payoutAddress: bsv.Address;
};
export declare type marketInfo = {
    version: string;
    status: marketStatus;
    details: marketDetails;
    balance: balance;
    balanceMerkleRoot: hash;
    oracles: oracleDetail[];
    creator: creatorInfo;
    creatorFee: number;
    requiredVotes: number;
    liquidityFee: number;
    settingsHash?: string;
};
export declare const balanceTableByteLength = 32;
export declare const voteCountByteLen = 2;
export declare const marketStatusHexLength = 4;
export declare const entryLiqudityPos = 33;
export declare const entrySharePos = 34;
export declare const sharesByteLength = 4;
export declare const liquidityByteLength = 4;
export declare function getMarketVersion(identifier: string): marketVersion;
export declare function getNewMarket(details: marketDetails, oracles: oracleDetail[], creator: creatorInfo, creatorFee: number, liquidityFee: number, requiredVotes: number, version?: marketVersion): marketInfo;
export declare function getOpReturnData(market: marketInfo): string;
export declare function getScryptTokenParams(market: marketInfo): (string | number)[];
export declare function getToken(market: marketInfo): PM;
export declare function getNewIndexScript(): bsv.Script;
export declare function getVotesHex(votes: number[]): string;
export declare function getEntryHex(entry: entry, version: marketVersion): string;
export declare function getEntryFromHex(bytes: string, version: marketVersion): entry;
export declare function getBalanceHex(balance: balance, version: marketVersion): string;
export declare function getBalanceFromHex(bytes: string, version: marketVersion): balance;
export declare function getSharesHex(shares: number[], version: marketVersion): string;
export declare function getSharesFromHex(bytes: string, version: marketVersion): number[];
export declare function getBalanceHexLength(version: marketVersion, script: bsv.Script): number;
export declare function getMarketBalance(entries: entry[], optionCount: number): balance;
export declare function getBalanceMerkleRoot(entries: entry[], version: marketVersion): hash;
export declare function getMerklePath(entries: entry[], position: number, version: marketVersion): string;
export declare function getMarketBalanceHex(entries: entry[], optionCount: number, version: marketVersion): string;
export declare function getMarketStatusHex(status: marketStatus): string;
export declare function getMarketStatusfromHex(decisionHex: string, votesHex: string, liquidityFeePoolHex: string, accLiquidityFeePoolHex: string, liquidityPointsHex: string): marketStatus;
export declare function getMarketDetailsHex(marketDetails: marketDetails): string;
export declare function getMarketDetailsFromHex(hex: string): marketDetails;
export declare function isValidMarketStatus(status: marketStatus, optionCount: number): status is marketStatus;
export declare function isValidMarketDetails(details: marketDetails): details is marketDetails;
export declare function isValidMarketBalance(balance: balance): balance is balance;
export declare function isValidMarketInfo(market: marketInfo): boolean;
export declare function validateEntries(market: marketInfo, entries: entry[]): boolean;
export declare function getMinMarketSatBalance(market: marketInfo, entries: entry[]): number;
export declare function isValidMarketInit(market: marketInfo): boolean;
export declare function isValidMarketInitEntry(entry: entry): boolean;
export declare function market2JSON(market: marketInfo): string;
export declare function getSettingsFromScript(inputScript: bsv.Script): any;
/**
 * Returns number of satoshis that can be extracted when redeeming liquidity
 */
export declare function getLiquiditySatBalance(marketBalance: balance, marketStatus: marketStatus, contractSats: number, liquidity: number, marketVersion: marketVersion): number;
export {};
