"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.NightBalances = exports.NightBalance = exports.GranteeIdentities = exports.GranteeIdentity = exports.DisclosureGrants = exports.DisclosureGrant = exports.DisclosureRoles = exports.DisclosureRole = exports.PredicateAttestations = exports.PredicateAttestation = exports.Documents = exports.Document = exports.Attestations = exports.Attestation = exports.WalletSyncStates = exports.WalletSyncState = exports.ContractSigningKeys = exports.ContractSigningKey = exports.PrivateStates = exports.PrivateState = exports.BackgroundJobs = exports.BackgroundJob = exports.PendingSubmissions = exports.PendingSubmission = exports.ReorgLog_ = exports.ReorgLog = exports.SyncState_ = exports.SyncState = exports.WalletSessions = exports.WalletSession = exports.DustLedgerEvents = exports.DustLedgerEvent = exports.ZswapLedgerEvents = exports.ZswapLedgerEvent = exports.UnshieldedUtxos = exports.UnshieldedUtxo = exports.ContractBalances = exports.ContractBalance = exports.ContractActions = exports.ContractAction = exports.TransactionFees = exports.TransactionFee = exports.TransactionSegments = exports.TransactionSegment = exports.TransactionResults = exports.TransactionResult = exports.Transactions = exports.Transaction = exports.Blocks = exports.Block = void 0;
exports._BlockAspect = _BlockAspect;
exports._TransactionAspect = _TransactionAspect;
exports._TransactionResultAspect = _TransactionResultAspect;
exports._TransactionSegmentAspect = _TransactionSegmentAspect;
exports._TransactionFeeAspect = _TransactionFeeAspect;
exports._ContractActionAspect = _ContractActionAspect;
exports._ContractBalanceAspect = _ContractBalanceAspect;
exports._UnshieldedUtxoAspect = _UnshieldedUtxoAspect;
exports._ZswapLedgerEventAspect = _ZswapLedgerEventAspect;
exports._DustLedgerEventAspect = _DustLedgerEventAspect;
exports._WalletSessionAspect = _WalletSessionAspect;
exports._SyncStateAspect = _SyncStateAspect;
exports._ReorgLogAspect = _ReorgLogAspect;
exports._PendingSubmissionAspect = _PendingSubmissionAspect;
exports._BackgroundJobAspect = _BackgroundJobAspect;
exports._PrivateStateAspect = _PrivateStateAspect;
exports._ContractSigningKeyAspect = _ContractSigningKeyAspect;
exports._WalletSyncStateAspect = _WalletSyncStateAspect;
exports._AttestationAspect = _AttestationAspect;
exports._DocumentAspect = _DocumentAspect;
exports._PredicateAttestationAspect = _PredicateAttestationAspect;
exports._DisclosureRoleAspect = _DisclosureRoleAspect;
exports._DisclosureGrantAspect = _DisclosureGrantAspect;
exports._GranteeIdentityAspect = _GranteeIdentityAspect;
exports._NightBalanceAspect = _NightBalanceAspect;
// This is an automatically generated file. Please do not change its contents manually!
const _ = __importStar(require("./.."));
const __ = __importStar(require("./../_"));
function _BlockAspect(Base) {
    return class Block extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Represents a block in the Midnight blockchain */
class Block extends _BlockAspect(__.Entity) {
}
exports.Block = Block;
Object.defineProperty(Block, 'name', { value: 'midnight.Blocks' });
Object.defineProperty(Block, 'is_singular', { value: true });
/** Represents a block in the Midnight blockchain */
class Blocks extends Array {
    $count;
}
exports.Blocks = Blocks;
Object.defineProperty(Blocks, 'name', { value: 'midnight.Blocks' });
function _TransactionAspect(Base) {
    return class Transaction extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Represents a transaction in the Midnight blockchain */
class Transaction extends _TransactionAspect(__.Entity) {
}
exports.Transaction = Transaction;
Object.defineProperty(Transaction, 'name', { value: 'midnight.Transactions' });
Object.defineProperty(Transaction, 'is_singular', { value: true });
/** Represents a transaction in the Midnight blockchain */
class Transactions extends Array {
    $count;
}
exports.Transactions = Transactions;
Object.defineProperty(Transactions, 'name', { value: 'midnight.Transactions' });
function _TransactionResultAspect(Base) {
    return class TransactionResult extends _._cuidAspect(Base) {
        static kind = 'entity';
    };
}
/** Transaction execution result */
class TransactionResult extends _TransactionResultAspect(__.Entity) {
}
exports.TransactionResult = TransactionResult;
Object.defineProperty(TransactionResult, 'name', { value: 'midnight.TransactionResults' });
Object.defineProperty(TransactionResult, 'is_singular', { value: true });
/** Transaction execution result */
class TransactionResults extends Array {
    $count;
}
exports.TransactionResults = TransactionResults;
Object.defineProperty(TransactionResults, 'name', { value: 'midnight.TransactionResults' });
function _TransactionSegmentAspect(Base) {
    return class TransactionSegment extends _._cuidAspect(Base) {
        static kind = 'entity';
    };
}
/** Segment of a transaction result (for partial success) */
class TransactionSegment extends _TransactionSegmentAspect(__.Entity) {
}
exports.TransactionSegment = TransactionSegment;
Object.defineProperty(TransactionSegment, 'name', { value: 'midnight.TransactionSegments' });
Object.defineProperty(TransactionSegment, 'is_singular', { value: true });
/** Segment of a transaction result (for partial success) */
class TransactionSegments extends Array {
    $count;
}
exports.TransactionSegments = TransactionSegments;
Object.defineProperty(TransactionSegments, 'name', { value: 'midnight.TransactionSegments' });
function _TransactionFeeAspect(Base) {
    return class TransactionFee extends _._cuidAspect(Base) {
        static kind = 'entity';
    };
}
/** Transaction fee information */
class TransactionFee extends _TransactionFeeAspect(__.Entity) {
}
exports.TransactionFee = TransactionFee;
Object.defineProperty(TransactionFee, 'name', { value: 'midnight.TransactionFees' });
Object.defineProperty(TransactionFee, 'is_singular', { value: true });
/** Transaction fee information */
class TransactionFees extends Array {
    $count;
}
exports.TransactionFees = TransactionFees;
Object.defineProperty(TransactionFees, 'name', { value: 'midnight.TransactionFees' });
function _ContractActionAspect(Base) {
    return class ContractAction extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Contract actions (Deploy, Call, Update) */
class ContractAction extends _ContractActionAspect(__.Entity) {
}
exports.ContractAction = ContractAction;
Object.defineProperty(ContractAction, 'name', { value: 'midnight.ContractActions' });
Object.defineProperty(ContractAction, 'is_singular', { value: true });
/** Contract actions (Deploy, Call, Update) */
class ContractActions extends Array {
    $count;
}
exports.ContractActions = ContractActions;
Object.defineProperty(ContractActions, 'name', { value: 'midnight.ContractActions' });
function _ContractBalanceAspect(Base) {
    return class ContractBalance extends _._cuidAspect(Base) {
        static kind = 'entity';
    };
}
/** Token balances for contracts */
class ContractBalance extends _ContractBalanceAspect(__.Entity) {
}
exports.ContractBalance = ContractBalance;
Object.defineProperty(ContractBalance, 'name', { value: 'midnight.ContractBalances' });
Object.defineProperty(ContractBalance, 'is_singular', { value: true });
/** Token balances for contracts */
class ContractBalances extends Array {
    $count;
}
exports.ContractBalances = ContractBalances;
Object.defineProperty(ContractBalances, 'name', { value: 'midnight.ContractBalances' });
function _UnshieldedUtxoAspect(Base) {
    return class UnshieldedUtxo extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Unshielded Unspent Transaction Outputs */
class UnshieldedUtxo extends _UnshieldedUtxoAspect(__.Entity) {
}
exports.UnshieldedUtxo = UnshieldedUtxo;
Object.defineProperty(UnshieldedUtxo, 'name', { value: 'midnight.UnshieldedUtxos' });
Object.defineProperty(UnshieldedUtxo, 'is_singular', { value: true });
/** Unshielded Unspent Transaction Outputs */
class UnshieldedUtxos extends Array {
    $count;
}
exports.UnshieldedUtxos = UnshieldedUtxos;
Object.defineProperty(UnshieldedUtxos, 'name', { value: 'midnight.UnshieldedUtxos' });
function _ZswapLedgerEventAspect(Base) {
    return class ZswapLedgerEvent extends _._cuidAspect(Base) {
        static kind = 'entity';
    };
}
/** Zswap Ledger Events */
class ZswapLedgerEvent extends _ZswapLedgerEventAspect(__.Entity) {
}
exports.ZswapLedgerEvent = ZswapLedgerEvent;
Object.defineProperty(ZswapLedgerEvent, 'name', { value: 'midnight.ZswapLedgerEvents' });
Object.defineProperty(ZswapLedgerEvent, 'is_singular', { value: true });
/** Zswap Ledger Events */
class ZswapLedgerEvents extends Array {
    $count;
}
exports.ZswapLedgerEvents = ZswapLedgerEvents;
Object.defineProperty(ZswapLedgerEvents, 'name', { value: 'midnight.ZswapLedgerEvents' });
function _DustLedgerEventAspect(Base) {
    return class DustLedgerEvent extends _._cuidAspect(Base) {
        static kind = 'entity';
    };
}
/** DUST Ledger Events */
class DustLedgerEvent extends _DustLedgerEventAspect(__.Entity) {
}
exports.DustLedgerEvent = DustLedgerEvent;
Object.defineProperty(DustLedgerEvent, 'name', { value: 'midnight.DustLedgerEvents' });
Object.defineProperty(DustLedgerEvent, 'is_singular', { value: true });
/** DUST Ledger Events */
class DustLedgerEvents extends Array {
    $count;
}
exports.DustLedgerEvents = DustLedgerEvents;
Object.defineProperty(DustLedgerEvents, 'name', { value: 'midnight.DustLedgerEvents' });
function _WalletSessionAspect(Base) {
    return class WalletSession extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Wallet sessions for authenticated access. */
class WalletSession extends _WalletSessionAspect(__.Entity) {
}
exports.WalletSession = WalletSession;
Object.defineProperty(WalletSession, 'name', { value: 'midnight.WalletSessions' });
Object.defineProperty(WalletSession, 'is_singular', { value: true });
/** Wallet sessions for authenticated access. */
class WalletSessions extends Array {
    $count;
}
exports.WalletSessions = WalletSessions;
Object.defineProperty(WalletSessions, 'name', { value: 'midnight.WalletSessions' });
function _SyncStateAspect(Base) {
    return class SyncState extends Base {
        static kind = 'entity';
    };
}
/** Indexer sync status, singleton table tracking crawler progress */
class SyncState extends _SyncStateAspect(__.Entity) {
}
exports.SyncState = SyncState;
Object.defineProperty(SyncState, 'name', { value: 'midnight.SyncState' });
Object.defineProperty(SyncState, 'is_singular', { value: true });
/** Indexer sync status, singleton table tracking crawler progress */
class SyncState_ extends Array {
    $count;
}
exports.SyncState_ = SyncState_;
Object.defineProperty(SyncState_, 'name', { value: 'midnight.SyncState' });
function _ReorgLogAspect(Base) {
    return class ReorgLog extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Reorg history, tracks blockchain reorganizations detected by the crawler */
class ReorgLog extends _ReorgLogAspect(__.Entity) {
}
exports.ReorgLog = ReorgLog;
Object.defineProperty(ReorgLog, 'name', { value: 'midnight.ReorgLog' });
Object.defineProperty(ReorgLog, 'is_singular', { value: true });
/** Reorg history, tracks blockchain reorganizations detected by the crawler */
class ReorgLog_ extends Array {
    $count;
}
exports.ReorgLog_ = ReorgLog_;
Object.defineProperty(ReorgLog_, 'name', { value: 'midnight.ReorgLog' });
function _PendingSubmissionAspect(Base) {
    return class PendingSubmission extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Tracks transactions submitted through NIGHTGATE's submission path */
class PendingSubmission extends _PendingSubmissionAspect(__.Entity) {
}
exports.PendingSubmission = PendingSubmission;
Object.defineProperty(PendingSubmission, 'name', { value: 'midnight.PendingSubmissions' });
Object.defineProperty(PendingSubmission, 'is_singular', { value: true });
/** Tracks transactions submitted through NIGHTGATE's submission path */
class PendingSubmissions extends Array {
    $count;
}
exports.PendingSubmissions = PendingSubmissions;
Object.defineProperty(PendingSubmissions, 'name', { value: 'midnight.PendingSubmissions' });
function _BackgroundJobAspect(Base) {
    return class BackgroundJob extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Backgroundjobs for diffrent purposes */
class BackgroundJob extends _BackgroundJobAspect(__.Entity) {
}
exports.BackgroundJob = BackgroundJob;
Object.defineProperty(BackgroundJob, 'name', { value: 'midnight.BackgroundJobs' });
Object.defineProperty(BackgroundJob, 'is_singular', { value: true });
/** Backgroundjobs for diffrent purposes */
class BackgroundJobs extends Array {
    $count;
}
exports.BackgroundJobs = BackgroundJobs;
Object.defineProperty(BackgroundJobs, 'name', { value: 'midnight.BackgroundJobs' });
function _PrivateStateAspect(Base) {
    return class PrivateState extends Base {
        static kind = 'entity';
    };
}
/** Encrypted private states held on behalf of authenticated wallet sessions. */
class PrivateState extends _PrivateStateAspect(__.Entity) {
}
exports.PrivateState = PrivateState;
Object.defineProperty(PrivateState, 'name', { value: 'midnight.PrivateStates' });
Object.defineProperty(PrivateState, 'is_singular', { value: true });
/** Encrypted private states held on behalf of authenticated wallet sessions. */
class PrivateStates extends Array {
    $count;
}
exports.PrivateStates = PrivateStates;
Object.defineProperty(PrivateStates, 'name', { value: 'midnight.PrivateStates' });
function _ContractSigningKeyAspect(Base) {
    return class ContractSigningKey extends Base {
        static kind = 'entity';
    };
}
/** Encrypted contract signing keys, scoped per (accountId, contractAddress) */
class ContractSigningKey extends _ContractSigningKeyAspect(__.Entity) {
}
exports.ContractSigningKey = ContractSigningKey;
Object.defineProperty(ContractSigningKey, 'name', { value: 'midnight.ContractSigningKeys' });
Object.defineProperty(ContractSigningKey, 'is_singular', { value: true });
/** Encrypted contract signing keys, scoped per (accountId, contractAddress) */
class ContractSigningKeys extends Array {
    $count;
}
exports.ContractSigningKeys = ContractSigningKeys;
Object.defineProperty(ContractSigningKeys, 'name', { value: 'midnight.ContractSigningKeys' });
function _WalletSyncStateAspect(Base) {
    return class WalletSyncState extends Base {
        static kind = 'entity';
    };
}
/** Persisted wallet sub-state, one row per session (accountId) */
class WalletSyncState extends _WalletSyncStateAspect(__.Entity) {
}
exports.WalletSyncState = WalletSyncState;
Object.defineProperty(WalletSyncState, 'name', { value: 'midnight.WalletSyncStates' });
Object.defineProperty(WalletSyncState, 'is_singular', { value: true });
/** Persisted wallet sub-state, one row per session (accountId) */
class WalletSyncStates extends Array {
    $count;
}
exports.WalletSyncStates = WalletSyncStates;
Object.defineProperty(WalletSyncStates, 'name', { value: 'midnight.WalletSyncStates' });
function _AttestationAspect(Base) {
    return class Attestation extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Attestations recorded on-chain via the AttestationVault Compact contract */
class Attestation extends _AttestationAspect(__.Entity) {
}
exports.Attestation = Attestation;
Object.defineProperty(Attestation, 'name', { value: 'midnight.Attestations' });
Object.defineProperty(Attestation, 'is_singular', { value: true });
/** Attestations recorded on-chain via the AttestationVault Compact contract */
class Attestations extends Array {
    $count;
}
exports.Attestations = Attestations;
Object.defineProperty(Attestations, 'name', { value: 'midnight.Attestations' });
function _DocumentAspect(Base) {
    return class Document extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Document anchoring */
class Document extends _DocumentAspect(__.Entity) {
}
exports.Document = Document;
Object.defineProperty(Document, 'name', { value: 'midnight.Documents' });
Object.defineProperty(Document, 'is_singular', { value: true });
/** Document anchoring */
class Documents extends Array {
    $count;
}
exports.Documents = Documents;
Object.defineProperty(Documents, 'name', { value: 'midnight.Documents' });
function _PredicateAttestationAspect(Base) {
    return class PredicateAttestation extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** ZK predicate attestations */
class PredicateAttestation extends _PredicateAttestationAspect(__.Entity) {
}
exports.PredicateAttestation = PredicateAttestation;
Object.defineProperty(PredicateAttestation, 'name', { value: 'midnight.PredicateAttestations' });
Object.defineProperty(PredicateAttestation, 'is_singular', { value: true });
/** ZK predicate attestations */
class PredicateAttestations extends Array {
    $count;
}
exports.PredicateAttestations = PredicateAttestations;
Object.defineProperty(PredicateAttestations, 'name', { value: 'midnight.PredicateAttestations' });
function _DisclosureRoleAspect(Base) {
    return class DisclosureRole extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/** Disclosure role grants for tiered access */
class DisclosureRole extends _DisclosureRoleAspect(__.Entity) {
}
exports.DisclosureRole = DisclosureRole;
Object.defineProperty(DisclosureRole, 'name', { value: 'midnight.DisclosureRoles' });
Object.defineProperty(DisclosureRole, 'is_singular', { value: true });
/** Disclosure role grants for tiered access */
class DisclosureRoles extends Array {
    $count;
}
exports.DisclosureRoles = DisclosureRoles;
Object.defineProperty(DisclosureRoles, 'name', { value: 'midnight.DisclosureRoles' });
function _DisclosureGrantAspect(Base) {
    return class DisclosureGrant extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/**
* On-chain disclosure grants read off the AttestationVault `disclosures`
* ledger Map. Distinct from DisclosureRoles (off-chain, operator-configured):
* these are CHAIN-DERIVED entitlement records — the contract is the ACL.
*
* Rows are inserted optimistically (active=false) by `grantDisclosure` and
* confirmed/flipped by the chain indexer (Phase 2) once the grant appears in
* ledger state. Logical key for cross-contract reuse:
* (contractAddress, payloadHash, grantee). `level`: 0=public,
* 1=legitimate-interest, 2=authority.
*/
class DisclosureGrant extends _DisclosureGrantAspect(__.Entity) {
}
exports.DisclosureGrant = DisclosureGrant;
Object.defineProperty(DisclosureGrant, 'name', { value: 'midnight.DisclosureGrants' });
Object.defineProperty(DisclosureGrant, 'is_singular', { value: true });
/**
* On-chain disclosure grants read off the AttestationVault `disclosures`
* ledger Map. Distinct from DisclosureRoles (off-chain, operator-configured):
* these are CHAIN-DERIVED entitlement records — the contract is the ACL.
*
* Rows are inserted optimistically (active=false) by `grantDisclosure` and
* confirmed/flipped by the chain indexer (Phase 2) once the grant appears in
* ledger state. Logical key for cross-contract reuse:
* (contractAddress, payloadHash, grantee). `level`: 0=public,
* 1=legitimate-interest, 2=authority.
*/
class DisclosureGrants extends Array {
    $count;
}
exports.DisclosureGrants = DisclosureGrants;
Object.defineProperty(DisclosureGrants, 'name', { value: 'midnight.DisclosureGrants' });
function _GranteeIdentityAspect(Base) {
    return class GranteeIdentity extends _._cuidAspect(_._managedAspect(Base)) {
        static kind = 'entity';
    };
}
/**
* Binds an authenticated principal (req.user.id) to the `Bytes<32>` grantee id
* the AttestationVault circuit checks, so the read gate can resolve
* principal → granteeId and match an on-chain DisclosureGrant (Phase 0 of
* expose-disclosure-grants). `bindingKind` records how the id was derived
* ('wallet' | 'did' | 'custom'); see srv/submission/grantee-identity.ts.
* Resolution mirrors DisclosureRoles scope precedence: a scoped row wins,
* else a global (null/empty scope) row applies.
*/
class GranteeIdentity extends _GranteeIdentityAspect(__.Entity) {
}
exports.GranteeIdentity = GranteeIdentity;
Object.defineProperty(GranteeIdentity, 'name', { value: 'midnight.GranteeIdentities' });
Object.defineProperty(GranteeIdentity, 'is_singular', { value: true });
/**
* Binds an authenticated principal (req.user.id) to the `Bytes<32>` grantee id
* the AttestationVault circuit checks, so the read gate can resolve
* principal → granteeId and match an on-chain DisclosureGrant (Phase 0 of
* expose-disclosure-grants). `bindingKind` records how the id was derived
* ('wallet' | 'did' | 'custom'); see srv/submission/grantee-identity.ts.
* Resolution mirrors DisclosureRoles scope precedence: a scoped row wins,
* else a global (null/empty scope) row applies.
*/
class GranteeIdentities extends Array {
    $count;
}
exports.GranteeIdentities = GranteeIdentities;
Object.defineProperty(GranteeIdentities, 'name', { value: 'midnight.GranteeIdentities' });
function _NightBalanceAspect(Base) {
    return class NightBalance extends Base {
        static kind = 'entity';
    };
}
/** Unshielded NIGHT token balances per address */
class NightBalance extends _NightBalanceAspect(__.Entity) {
}
exports.NightBalance = NightBalance;
Object.defineProperty(NightBalance, 'name', { value: 'midnight.NightBalances' });
Object.defineProperty(NightBalance, 'is_singular', { value: true });
/** Unshielded NIGHT token balances per address */
class NightBalances extends Array {
    $count;
}
exports.NightBalances = NightBalances;
Object.defineProperty(NightBalances, 'name', { value: 'midnight.NightBalances' });
