import { Bool, Field } from './core.js'; import { AccountUpdate, Preconditions } from './account_update.js'; import { UInt32, UInt64 } from './int.js'; import { PublicKey } from './signature.js'; export { preconditions, Account, Network, CurrentSlot, assertPreconditionInvariants, cleanPreconditionsCache, AccountValue, NetworkValue, getAccountPreconditions, }; declare function preconditions(accountUpdate: AccountUpdate, isSelf: boolean): { account: Account; network: Network; currentSlot: CurrentSlot; }; declare function Network(accountUpdate: AccountUpdate): Network; declare function Account(accountUpdate: AccountUpdate): Account; declare function CurrentSlot(accountUpdate: AccountUpdate): CurrentSlot; declare function getAccountPreconditions(body: { publicKey: PublicKey; tokenId?: Field; }): AccountValue; declare function cleanPreconditionsCache(accountUpdate: AccountUpdate): void; declare function assertPreconditionInvariants(accountUpdate: AccountUpdate): void; type NetworkPrecondition = Preconditions['network']; type NetworkValue = PreconditionBaseTypes; type RawNetwork = PreconditionClassType; type Network = RawNetwork & { timestamp: PreconditionSubclassRangeType; }; type AccountPrecondition = Omit; type AccountValue = PreconditionBaseTypes; type Account = PreconditionClassType & Update; type CurrentSlot = { assertBetween(lower: UInt32, upper: UInt32): void; }; type PreconditionBaseTypes = { [K in keyof T]: T[K] extends RangeCondition ? U : T[K] extends FlaggedOptionCondition ? U : T[K] extends Field ? Field : PreconditionBaseTypes; }; type PreconditionSubclassType = { get(): U; getAndAssertEquals(): U; assertEquals(value: U): void; assertNothing(): void; }; type PreconditionSubclassRangeType = PreconditionSubclassType & { assertBetween(lower: U, upper: U): void; }; type PreconditionClassType = { [K in keyof T]: T[K] extends RangeCondition ? PreconditionSubclassRangeType : T[K] extends FlaggedOptionCondition ? PreconditionSubclassType : T[K] extends Field ? PreconditionSubclassType : PreconditionClassType; }; type Update_ = Omit; type Update = { [K in keyof Update_]: { set(value: UpdateValue[K]): void; }; }; type UpdateValue = { [K in keyof Update_]: K extends 'zkappUri' | 'tokenSymbol' ? string : Update_[K]['value']; }; type RangeCondition = { isSome: Bool; value: { lower: T; upper: T; }; }; type FlaggedOptionCondition = { isSome: Bool; value: T; };