/// <reference types="node" resolution-mode="require"/>
import { AliasHash } from '@polyaztec/barretenberg/account_id';
import { GrumpkinAddress } from '@polyaztec/barretenberg/address';
import { MutexDatabase } from '@polyaztec/barretenberg/mutex';
import { TxId } from '@polyaztec/barretenberg/tx_id';
import { CoreAccountTx, CoreDefiTx, CorePaymentTx, CoreUserTx } from '../core_tx/index.js';
import { Note } from '../note/index.js';
import { UserData } from '../user/index.js';
export declare class SpendingKey {
    userId: GrumpkinAddress;
    key: Buffer;
    treeIndex: number;
    hashPath: Buffer;
    constructor(userId: GrumpkinAddress, key: Buffer, // only contains x coordinate of a grumpkin address.
    treeIndex: number, hashPath: Buffer);
}
export declare class Alias {
    accountPublicKey: GrumpkinAddress;
    aliasHash: AliasHash;
    index: number;
    noteCommitment1?: Buffer | undefined;
    spendingPublicKeyX?: Buffer | undefined;
    constructor(accountPublicKey: GrumpkinAddress, aliasHash: AliasHash, index: number, noteCommitment1?: Buffer | undefined, spendingPublicKeyX?: Buffer | undefined);
}
export declare class BulkUserStateUpdateData {
    updateUserArgs: Parameters<Database['updateUser']>[];
    addSpendingKeyArgs: Parameters<Database['addSpendingKey']>[];
    upsertAccountTxArgs: Parameters<Database['upsertAccountTx']>[];
    upsertPaymentTxArgs: Parameters<Database['upsertPaymentTx']>[];
    upsertDefiTxArgs: Parameters<Database['upsertDefiTx']>[];
    addNoteArgs: Parameters<Database['addNote']>[];
    nullifyNoteArgs: Parameters<Database['nullifyNote']>[];
    constructor(updateUserArgs?: Parameters<Database['updateUser']>[], addSpendingKeyArgs?: Parameters<Database['addSpendingKey']>[], upsertAccountTxArgs?: Parameters<Database['upsertAccountTx']>[], upsertPaymentTxArgs?: Parameters<Database['upsertPaymentTx']>[], upsertDefiTxArgs?: Parameters<Database['upsertDefiTx']>[], addNoteArgs?: Parameters<Database['addNote']>[], nullifyNoteArgs?: Parameters<Database['nullifyNote']>[]);
}
export interface Database extends MutexDatabase {
    close(): Promise<void>;
    clear(): Promise<void>;
    addNote(note: Note): Promise<void>;
    getNote(commitment: Buffer): Promise<Note | undefined>;
    getNoteByNullifier(nullifier: Buffer): Promise<Note | undefined>;
    nullifyNote(nullifier: Buffer): Promise<void>;
    getNotes(userId: GrumpkinAddress): Promise<Note[]>;
    getPendingNotes(userId: GrumpkinAddress): Promise<Note[]>;
    removeNote(nullifier: Buffer): Promise<void>;
    getUser(accountPublicKey: GrumpkinAddress): Promise<UserData | undefined>;
    getUsers(): Promise<UserData[]>;
    addUser(user: UserData): Promise<void>;
    updateUser(user: UserData): Promise<void>;
    removeUser(accountPublicKey: GrumpkinAddress): Promise<void>;
    resetUsers(): Promise<void>;
    upsertPaymentTx(tx: CorePaymentTx): Promise<void>;
    getPaymentTx(userId: GrumpkinAddress, txId: TxId): Promise<CorePaymentTx | undefined>;
    getPaymentTxs(userId: GrumpkinAddress): Promise<CorePaymentTx[]>;
    upsertAccountTx(tx: CoreAccountTx): Promise<void>;
    getAccountTx(txId: TxId): Promise<CoreAccountTx | undefined>;
    getAccountTxs(userId: GrumpkinAddress): Promise<CoreAccountTx[]>;
    upsertDefiTx(tx: CoreDefiTx): Promise<void>;
    getUnclaimedDefiTxs(userId: GrumpkinAddress): Promise<CoreDefiTx[]>;
    getDefiTx(txId: TxId): Promise<CoreDefiTx | undefined>;
    getDefiTxs(userId: GrumpkinAddress): Promise<CoreDefiTx[]>;
    getUserTxs(userId: GrumpkinAddress): Promise<CoreUserTx[]>;
    isUserTxSettled(txId: TxId): Promise<boolean>;
    getPendingUserTxs(userId: GrumpkinAddress): Promise<CoreUserTx[]>;
    removeUserTx(userId: GrumpkinAddress, txId: TxId): Promise<void>;
    addSpendingKey(spendingKey: SpendingKey): Promise<void>;
    addSpendingKeys(spendingKeys: SpendingKey[]): Promise<void>;
    getSpendingKey(userId: GrumpkinAddress, spendingKey: GrumpkinAddress): Promise<SpendingKey | undefined>;
    getSpendingKeys(userId: GrumpkinAddress): Promise<SpendingKey[]>;
    removeSpendingKeys(userId: GrumpkinAddress): Promise<void>;
    addAlias(alias: Alias): Promise<void>;
    addAliases(alias: Alias[]): Promise<void>;
    getAlias(accountPublicKey: GrumpkinAddress): Promise<Alias | undefined>;
    getAliasByAliasHash(aliasHash: AliasHash): Promise<Alias | undefined>;
    addKey(name: string, value: Buffer): Promise<void>;
    getKey(name: string): Promise<Buffer | undefined>;
    deleteKey(name: string): Promise<void>;
    bulkUserStateUpdate(data: BulkUserStateUpdateData): Promise<void>;
}
//# sourceMappingURL=database.d.ts.map