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

    What deposit_transaction_view joins for one deposit, names excepted.

    type DepositLegInput = {
        bankTransactions: readonly {
            bankId: TransactionLeg["bankId"];
            externalId: NonNullable<TransactionLeg["bankTransactionId"]>;
        }[];
        deposit: Pick<
            SelectDeposit,
            "externalId"
            | "status"
            | "receiptId"
            | "feeSweepTxId",
        > & {
            createdAt: Temporal.Instant;
            customerId: TransactionLeg["customerId"];
            ledgerAccountId: TransactionLeg["ledgerAccountId"];
        };
        depositQuote: Pick<
            SelectDepositQuote,
            "walletAddress"
            | "quote"
            | "deviceLocation",
        > & {
            identityId: TransactionLeg["identityId"];
            organizationId: TransactionLeg["organizationId"];
            productQuoteId: TransactionLeg["productQuoteId"];
            sourcePaymentInstrumentId: TransactionLeg["paymentInstrumentId"];
        };
        feeCollectorCustomerId: TransactionLeg["counterpartyCustomerId"];
        feeSweep: | Omit<OnChain, "preBalance" | "postBalance"> & {
            credits: readonly FeeCredit[];
        }
        | null;
        method: TransactionLeg["method"]
        | null;
        onChain: OnChain | null;
        productQuote: Pick<
            SelectProductQuote,
            | "sourceAmount"
            | "targetAmountAfterFees"
            | "totalFees"
            | "sourceCurrency"
            | "targetCurrency",
        >;
        quoteBankId: TransactionLeg["bankId"];
        statusUpdate: { createdAt: Temporal.Instant; reason: string | null }
        | null;
    }
    Index
    bankTransactions: readonly {
        bankId: TransactionLeg["bankId"];
        externalId: NonNullable<TransactionLeg["bankTransactionId"]>;
    }[]

    Every bank transaction tied to the deposit, each with its bank. A leg holds one: the lowest id, as the backfill keeps (TRANSACTION_TABLE.md §5).

    deposit: Pick<
        SelectDeposit,
        "externalId"
        | "status"
        | "receiptId"
        | "feeSweepTxId",
    > & {
        createdAt: Temporal.Instant;
        customerId: TransactionLeg["customerId"];
        ledgerAccountId: TransactionLeg["ledgerAccountId"];
    }
    depositQuote: Pick<
        SelectDepositQuote,
        "walletAddress"
        | "quote"
        | "deviceLocation",
    > & {
        identityId: TransactionLeg["identityId"];
        organizationId: TransactionLeg["organizationId"];
        productQuoteId: TransactionLeg["productQuoteId"];
        sourcePaymentInstrumentId: TransactionLeg["paymentInstrumentId"];
    }
    feeCollectorCustomerId: TransactionLeg["counterpartyCustomerId"]

    The customer that owns the FEE backoffice wallet; a fee debit's counterparty.

    feeSweep:
        | Omit<OnChain, "preBalance" | "postBalance"> & {
            credits: readonly FeeCredit[];
        }
        | null

    The sweep that carried the deposit's fee, and each FEE address it credited.

    method: TransactionLeg["method"] | null

    product.method; a deposit whose product has none has no legs.

    onChain: OnChain | null
    productQuote: Pick<
        SelectProductQuote,
        | "sourceAmount"
        | "targetAmountAfterFees"
        | "totalFees"
        | "sourceCurrency"
        | "targetCurrency",
    >
    quoteBankId: TransactionLeg["bankId"]

    The bank the quote names, for a deposit no bank transaction is tied to.

    statusUpdate: { createdAt: Temporal.Instant; reason: string | null } | null

    The latest deposit_status_update row for the deposit's current status.