@cfxlabsinc/b2b-services
    Preparing search index...

    Class UtilaAccountBalanceQueryService

    Reads a Utila balance as sum(amount) over the wallet's series in chain order — the § 3.8 read, mirroring SolanaAccountBalanceQueryService column-for-column. The feed reaches account open (§ 8.2), so every series starts at zero and the running sum IS the balance; storing one instead would make it a function of ingest order.

    Index
    • A correlated scalar subquery resolving the balance for vault/wallet columns on the outer query, scoped to one asset — the same shape as SolanaAccountBalanceQueryService.balanceColumn(), usable directly as an outer SELECT column or inside an aggregate.

      Parameters

      • args: {
            assetId: number;
            atTime?: Date;
            vaultIdColumn: SQLWrapper;
            walletIdColumn: SQLWrapper;
        }
        • assetId: number
        • OptionalatTime?: Date

          Balance at this point in time; otherwise the latest known.

        • vaultIdColumn: SQLWrapper
        • walletIdColumn: SQLWrapper

      Returns SQL<BigNumber>

    • The balance for one (vault, wallet, asset) series, coalesce'd to 0 — a wallet that never held the asset holds 0 of it.

      Parameters

      • args: { assetId: number; atTime?: Date; vaultId: string; walletId: string }
        • assetId: number
        • OptionalatTime?: Date

          Balance at this point in time; otherwise the latest known.

        • vaultId: string
        • walletId: string

      Returns Promise<{ ok: true; value: BigNumber }>