import { Bool, Field } from '../snarky.js'; import { AccountUpdate, Preconditions } from './account_update.js'; import { UInt32, UInt64 } from './int.js'; import { PublicKey } from './signature.js'; export { preconditions, Account, Network, assertPreconditionInvariants, cleanPreconditionsCache, AccountValue, NetworkValue, getAccountPreconditions, }; declare function preconditions(accountUpdate: AccountUpdate, isSelf: boolean): { account: PreconditionClassType; network: PreconditionClassType<{ snarkedLedgerHash: { isSome: Bool; value: Field; }; timestamp: { isSome: Bool; value: { lower: UInt64; upper: UInt64; }; }; blockchainLength: { isSome: Bool; value: { lower: UInt32; upper: UInt32; }; }; minWindowDensity: { isSome: Bool; value: { lower: UInt32; upper: UInt32; }; }; totalCurrency: { isSome: Bool; value: { lower: UInt64; upper: UInt64; }; }; globalSlotSinceHardFork: { isSome: Bool; value: { lower: UInt32; upper: UInt32; }; }; globalSlotSinceGenesis: { isSome: Bool; value: { lower: UInt32; upper: UInt32; }; }; stakingEpochData: { ledger: { hash: { isSome: Bool; value: Field; }; totalCurrency: { isSome: Bool; value: { lower: UInt64; upper: UInt64; }; }; }; seed: { isSome: Bool; value: Field; }; startCheckpoint: { isSome: Bool; value: Field; }; lockCheckpoint: { isSome: Bool; value: Field; }; epochLength: { isSome: Bool; value: { lower: UInt32; upper: UInt32; }; }; }; nextEpochData: { ledger: { hash: { isSome: Bool; value: Field; }; totalCurrency: { isSome: Bool; value: { lower: UInt64; upper: UInt64; }; }; }; seed: { isSome: Bool; value: Field; }; startCheckpoint: { isSome: Bool; value: Field; }; lockCheckpoint: { isSome: Bool; value: Field; }; epochLength: { isSome: Bool; value: { lower: UInt32; upper: UInt32; }; }; }; }>; }; declare function Network(accountUpdate: AccountUpdate): Network; declare function Account(accountUpdate: AccountUpdate): Account; declare function getAccountPreconditions(body: { publicKey: PublicKey; tokenId?: Field; }): AccountValue; declare function cleanPreconditionsCache(accountUpdate: AccountUpdate): void; declare function assertPreconditionInvariants(accountUpdate: AccountUpdate): void; declare type NetworkPrecondition = Preconditions['network']; declare type NetworkValue = PreconditionBaseTypes; declare type Network = PreconditionClassType; declare type AccountPrecondition = Omit; declare type AccountValue = PreconditionBaseTypes; declare type Account = PreconditionClassType; declare type PreconditionBaseTypes = { [K in keyof T]: T[K] extends RangeCondition ? U : T[K] extends FlaggedOptionCondition ? U : T[K] extends Field ? Field : PreconditionBaseTypes; }; declare type PreconditionSubclassType = { get(): U; assertEquals(value: U): void; assertNothing(): void; }; declare type PreconditionClassType = { [K in keyof T]: T[K] extends RangeCondition ? PreconditionSubclassType & { assertBetween(lower: U, upper: U): void; } : T[K] extends FlaggedOptionCondition ? PreconditionSubclassType : T[K] extends Field ? PreconditionSubclassType : PreconditionClassType; }; declare type RangeCondition = { isSome: Bool; value: { lower: T; upper: T; }; }; declare type FlaggedOptionCondition = { isSome: Bool; value: T; };