import { AccountId, AccountTiming } from './account.js'; import { AccountUpdateAuthorization, AccountUpdateAuthorizationEnvironment, AccountUpdateAuthorizationKind, AccountUpdateAuthorizationKindIdentifier, AccountUpdateAuthorizationKindWithZkappContext } from './authorization.js'; import { Update, ZkappUri } from './core.js'; import { Permissions, PermissionsDescription } from './permissions.js'; import { Preconditions, PreconditionsDescription } from './preconditions.js'; import { StateDefinition, StateLayout, StateUpdates } from './state.js'; import { Bool } from '../../provable/bool.js'; import { Field } from '../../provable/field.js'; import { Int64 } from '../../provable/int.js'; import { Proof } from '../../proof-system/zkprogram.js'; import { TokenSymbol } from '../../provable/crypto/poseidon.js'; import { PublicKey } from '../../provable/crypto/signature.js'; import { HashInput } from '../../provable/types/provable-derivers.js'; import { Provable } from '../../provable/types/provable-intf.js'; import * as Bindings from '../../../bindings/mina-transaction/v2/index.js'; import { NetworkId } from '../../../mina-signer/src/types.js'; import { VerificationKey } from '../../../lib/proof-system/verification-key.js'; export { AccountUpdate, Authorized, GenericData, AccountUpdateTree, AccountUpdateTreeDescription, ContextFreeAccountUpdateDescription, ContextFreeAccountUpdate, DynamicProvable, AccountUpdateCommitment, CommittedList, EventsHashConfig, ActionsHashConfig, }; declare const AccountUpdateCommitment_base: (new (value: { accountUpdateCommitment: Field; }) => { accountUpdateCommitment: Field; }) & { _isStruct: true; } & Omit, "fromFields"> & { fromFields: (fields: Field[]) => { accountUpdateCommitment: Field; }; } & { fromValue: (value: { accountUpdateCommitment: string | number | bigint | Field; }) => { accountUpdateCommitment: Field; }; toInput: (x: { accountUpdateCommitment: Field; }) => { fields?: Field[] | undefined; packed?: [Field, number][] | undefined; }; toJSON: (x: { accountUpdateCommitment: Field; }) => { accountUpdateCommitment: string; }; fromJSON: (x: { accountUpdateCommitment: string; }) => { accountUpdateCommitment: Field; }; empty: () => { accountUpdateCommitment: Field; }; }; declare class AccountUpdateCommitment extends AccountUpdateCommitment_base { constructor(accountUpdateCommitment: Field); } type DynamicProvable = Provable | { toFields(x: T): Field[]; toAuxiliary(x: T): any[]; fromFieldsDynamic(fields: Field[], aux: any[]): { value: T; fieldsConsumed: number; }; }; declare const GenericData: DynamicProvable; interface HashableDataConfig { readonly emptyPrefix: string; readonly consPrefix: string; hash(item: Item): Field; } declare function EventsHashConfig(T: DynamicProvable): HashableDataConfig; declare function ActionsHashConfig(T: DynamicProvable): HashableDataConfig; declare class CommittedList { readonly Item: DynamicProvable; readonly data: Item[]; readonly hash: Field; constructor({ Item, data, hash }: { Item: DynamicProvable; data: Item[]; hash: Field; }); toInternalRepr(): { data: Field[][]; hash: Field; }; mapUnsafe(NewItem: DynamicProvable, f: (a: Item) => B): CommittedList; static hashList(config: HashableDataConfig, items: Item[]): Field; static from(Item: DynamicProvable, config: HashableDataConfig, value: undefined | Item[] | CommittedList | Bindings.Leaves.CommittedList): CommittedList; } interface MayUseToken { parentsOwnToken: Bool; inheritFromParent: Bool; } type AccountUpdateTreeDescription = RootDescription & { children?: AccountUpdateTree[]; }; declare class AccountUpdateTree { rootAccountUpdate: Root; children: AccountUpdateTree[]; constructor(rootAccountUpdate: Root, children: AccountUpdateTree[]); static forEachNode(tree: AccountUpdateTree, depth: number, f: (accountUpdate: T, depth: number) => void): void; static forEachNodeInverted(tree: AccountUpdateTree, depth: number, f: (accountUpdate: T, depth: number) => void): void; static reduce(tree: AccountUpdateTree, f: (accountUpdate: T, childValues: R[]) => R): R; static mapRoot(tree: AccountUpdateTree, f: (accountUpdate: RootIn) => RootOut): AccountUpdateTree; static map(tree: AccountUpdateTree, f: (accountUpdate: A) => Promise): Promise>; static mapForest(forest: AccountUpdateTree[], f: (a: A) => Promise): Promise[]>; static hash(tree: AccountUpdateTree, networkId: NetworkId): bigint; static hashForest(networkId: NetworkId, forest: AccountUpdateTree[]): bigint; static unrollForest(forest: AccountUpdateTree[], f: (accountUpdate: AccountUpdateType, depth: number) => Return): Return[]; static sizeInFields(): number; static toFields(x: AccountUpdateTree): Field[]; static toAuxiliary(x?: AccountUpdateTree): any[]; static fromFields(fields: Field[], aux: any[]): AccountUpdateTree; static toValue(x: AccountUpdateTree): AccountUpdateTree; static fromValue(x: AccountUpdateTree): AccountUpdateTree; static check(_x: AccountUpdateTree): void; static from(descr: AccountUpdateTreeDescription, createAccountUpdate: (descr: RootDescription) => Root): AccountUpdateTree; } interface ContextFreeAccountUpdateDescription { authorizationKind: AccountUpdateAuthorizationKindIdentifier | AccountUpdateAuthorizationKind; preconditions?: PreconditionsDescription | Preconditions; balanceChange?: Int64; incrementNonce?: Bool; useFullCommitment?: Bool; implicitAccountCreationFee?: Bool; mayUseToken?: MayUseToken; pushEvents?: Event[] | CommittedList; pushActions?: Action[] | CommittedList; setState?: StateUpdates; setPermissions?: PermissionsDescription | Permissions | Update; setDelegate?: PublicKey | Update; setVerificationKey?: VerificationKey | Update; setZkappUri?: string | ZkappUri | Update; setTokenSymbol?: string | TokenSymbol | Update; setTiming?: AccountTiming | Update; setVotingFor?: Field | Update; } declare class ContextFreeAccountUpdate { readonly State: StateDefinition; authorizationKind: AccountUpdateAuthorizationKind; preconditions: Preconditions; balanceChange: Int64; incrementNonce: Bool; useFullCommitment: Bool; implicitAccountCreationFee: Bool; mayUseToken: MayUseToken; pushEvents: CommittedList; pushActions: CommittedList; stateUpdates: StateUpdates; permissionsUpdate: Update; delegateUpdate: Update; verificationKeyUpdate: Update; zkappUriUpdate: Update; tokenSymbolUpdate: Update; timingUpdate: Update; votingForUpdate: Update; constructor(State: StateDefinition, Event: DynamicProvable, Action: DynamicProvable, descr: ContextFreeAccountUpdateDescription | ContextFreeAccountUpdate); toGeneric(): ContextFreeAccountUpdate; static fromGeneric(x: ContextFreeAccountUpdate, State: StateDefinition, Event: DynamicProvable, Action: DynamicProvable): ContextFreeAccountUpdate; static generic(descr: ContextFreeAccountUpdateDescription): ContextFreeAccountUpdate; static emptyPoly(State: StateDefinition, Event: DynamicProvable, Action: DynamicProvable): ContextFreeAccountUpdate; static empty(): ContextFreeAccountUpdate; static from(State: StateDefinition, Event: DynamicProvable, Action: DynamicProvable, x: ContextFreeAccountUpdateDescription | ContextFreeAccountUpdate | undefined): ContextFreeAccountUpdate; } type AccountUpdateDescription = ({ update: ContextFreeAccountUpdate; proof?: Proof; } | ContextFreeAccountUpdateDescription) & { accountId: AccountId; verificationKeyHash?: Field; callData?: Field; }; declare class AccountUpdate extends ContextFreeAccountUpdate { accountId: AccountId; verificationKeyHash: Field; callData: Field; proof: 'NoProofRequired' | 'ProofPending' | Proof; constructor(State: StateDefinition, Event: DynamicProvable, Action: DynamicProvable, descr: AccountUpdateDescription); get authorizationKindWithZkappContext(): AccountUpdateAuthorizationKindWithZkappContext; toInternalRepr(callDepth: number): Bindings.Layout.AccountUpdateBody; toInput(): HashInput; commit(networkId: NetworkId): AccountUpdateCommitment; toGeneric(): AccountUpdate; static fromGeneric(x: AccountUpdate, State: StateDefinition, Event: DynamicProvable, Action: DynamicProvable): AccountUpdate; authorize(authEnv: AccountUpdateAuthorizationEnvironment): Promise>; static create(x: AccountUpdateDescription<'GenericState', Field[], Field[]>): AccountUpdate; static fromInternalRepr(x: Bindings.Layout.AccountUpdateBody): AccountUpdate; static sizeInFields(): number; static toFields(x: AccountUpdate): Field[]; static toAuxiliary(x?: AccountUpdate, callDepth?: number): any[]; static fromFields(fields: Field[], aux: any[]): AccountUpdate; static toValue(x: AccountUpdate): AccountUpdate; static fromValue(x: AccountUpdate): AccountUpdate; static check(_x: AccountUpdate): void; static empty(): AccountUpdate; } declare class Authorized { authorization: AccountUpdateAuthorization; private update; constructor(authorization: AccountUpdateAuthorization, update: AccountUpdate); toAccountUpdate(): AccountUpdate; get State(): StateDefinition; get authorizationKind(): AccountUpdateAuthorizationKind; get accountId(): AccountId; get verificationKeyHash(): Field; get callData(): Field; get preconditions(): Preconditions; get balanceChange(): Int64; get incrementNonce(): Bool; get useFullCommitment(): Bool; get implicitAccountCreationFee(): Bool; get mayUseToken(): MayUseToken; get pushEvents(): CommittedList; get pushActions(): CommittedList; get stateUpdates(): StateUpdates; get permissionsUpdate(): Update; get delegateUpdate(): Update; get verificationKeyUpdate(): Update; get zkappUriUpdate(): Update; get tokenSymbolUpdate(): Update; get timingUpdate(): Update; get votingForUpdate(): Update; get authorizationKindWithZkappContext(): AccountUpdateAuthorizationKindWithZkappContext; hash(netId: NetworkId): Field; toInternalRepr(callDepth: number): Bindings.Layout.ZkappAccountUpdate; static fromInternalRepr(x: Bindings.Layout.ZkappAccountUpdate): Authorized; toJSON(callDepth: number): any; toInput(): HashInput; toFields(): Field[]; static empty(): Authorized; static sizeInFields(): number; static toJSON(x: Authorized, callDepth: number): any; static toInput(x: Authorized): HashInput; static toFields(x: Authorized): Field[]; static toAuxiliary(x?: Authorized, callDepth?: number): any[]; static fromFields(fields: Field[], aux: any[]): Authorized; static toValue(x: Authorized): Authorized; static fromValue(x: Authorized): Authorized; static check(_x: Authorized): void; }