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

    Read-only query services to fetch normalized transactions across all products

    If you need more info about a transaction, fetch it using its specific service. Transaction Service will remain generic and high-level.

    Index

    Constructors

    Methods

    • Aggregate transaction totals grouped by (method, type, status).

      Single GROUP BY query against the same UNION used by search, but skips the outer entity / ledger / solana enrichment — aggregation only needs (method, type, status, amount). Use this instead of paging through search when you only need bucketed sums (e.g. the home-page money- movement widget).

      Parameters

      • __namedParameters: {
            createdAt?: DbTimestampCriteria;
            customerId: string;
            methods?: (
                | "REDEMPTION"
                | "SWAP"
                | "VIRTUAL_CARD"
                | "PHYSICAL_CARD"
                | "DEPOSIT_US_CASH"
                | "DEPOSIT_US_BANK_ACH"
                | "DEPOSIT_ACH_CREDIT"
                | "DEPOSIT_RTP"
                | "DEPOSIT_US_WIRE"
                | "DEPOSIT_SWIFT_WIRE"
                | "TRANSFER_NETWORK"
                | "TRANSFER"
                | "WITHDRAW_AF_BANK"
                | "WITHDRAW_AF_MOMO"
                | "WITHDRAW_MX_SPEI"
                | "WITHDRAW_SWIFT_WIRE"
                | "WITHDRAW_BLOCKCHAIN"
                | "WITHDRAW_US_BANK_ACH"
                | "WITHDRAW_US_INSTANT"
                | "WITHDRAW_ACH_PULL"
                | "WITHDRAW_US_WIRE_DRAWDOWN"
                | "WITHDRAW_US_WIRE"
                | "DEPOSIT_BLOCKCHAIN"
                | "DEPOSIT_DIRECT"
                | "FEE_TRANSFER"
            )[];
            statuses?: ("PROCESSING" | "COMPLETED" | "FAILED" | "RETURNED")[];
            subtypes?: ("FEE" | "RETURN" | undefined)[] | null;
            token?: Token;
        }
        • OptionalcreatedAt?: DbTimestampCriteria
        • customerId: string
        • Optionalmethods?: (
              | "REDEMPTION"
              | "SWAP"
              | "VIRTUAL_CARD"
              | "PHYSICAL_CARD"
              | "DEPOSIT_US_CASH"
              | "DEPOSIT_US_BANK_ACH"
              | "DEPOSIT_ACH_CREDIT"
              | "DEPOSIT_RTP"
              | "DEPOSIT_US_WIRE"
              | "DEPOSIT_SWIFT_WIRE"
              | "TRANSFER_NETWORK"
              | "TRANSFER"
              | "WITHDRAW_AF_BANK"
              | "WITHDRAW_AF_MOMO"
              | "WITHDRAW_MX_SPEI"
              | "WITHDRAW_SWIFT_WIRE"
              | "WITHDRAW_BLOCKCHAIN"
              | "WITHDRAW_US_BANK_ACH"
              | "WITHDRAW_US_INSTANT"
              | "WITHDRAW_ACH_PULL"
              | "WITHDRAW_US_WIRE_DRAWDOWN"
              | "WITHDRAW_US_WIRE"
              | "DEPOSIT_BLOCKCHAIN"
              | "DEPOSIT_DIRECT"
              | "FEE_TRANSFER"
          )[]
        • Optionalstatuses?: ("PROCESSING" | "COMPLETED" | "FAILED" | "RETURNED")[]
        • Optionalsubtypes?: ("FEE" | "RETURN" | undefined)[] | null

          Pass values to include only those subtypes; pass null to exclude transactions with a subtype

        • Optionaltoken?: Token

      Returns Promise<
          {
              ok: true;
              value: {
                  items: {
                      method: | "REDEMPTION"
                      | "SWAP"
                      | "VIRTUAL_CARD"
                      | "PHYSICAL_CARD"
                      | "DEPOSIT_US_CASH"
                      | "DEPOSIT_US_BANK_ACH"
                      | "DEPOSIT_ACH_CREDIT"
                      | "DEPOSIT_RTP"
                      | "DEPOSIT_US_WIRE"
                      | "DEPOSIT_SWIFT_WIRE"
                      | "TRANSFER_NETWORK"
                      | "TRANSFER"
                      | "WITHDRAW_AF_BANK"
                      | "WITHDRAW_AF_MOMO"
                      | "WITHDRAW_MX_SPEI"
                      | "WITHDRAW_SWIFT_WIRE"
                      | "WITHDRAW_BLOCKCHAIN"
                      | "WITHDRAW_US_BANK_ACH"
                      | "WITHDRAW_US_INSTANT"
                      | "WITHDRAW_ACH_PULL"
                      | "WITHDRAW_US_WIRE_DRAWDOWN"
                      | "WITHDRAW_US_WIRE"
                      | "DEPOSIT_BLOCKCHAIN"
                      | "DEPOSIT_DIRECT"
                      | "FEE_TRANSFER";
                      status: "PROCESSING"
                      | "COMPLETED"
                      | "FAILED"
                      | "RETURNED";
                      total: BigNumber;
                      type: "CREDIT" | "DEBIT";
                  }[];
              };
          },
      >

    • Returns the base UNION query (all selects enabled, scoped to the given customer) as an inlined SQL string. Useful for debugging prod issues against a specific customer.

      Parameters

      • __namedParameters: { customerId: string; token?: Token }

      Returns { params: unknown[]; sql: string }

    • Parameters

      • __namedParameters: {
            amount?: { operator: "EQ" | "LTE" | "GTE"; value: BigNumber };
            bankIds?: ("greendot" | "dart" | "burling" | "jiko" | "fib" | undefined)[];
            bankTransactionIds?: (string | undefined)[];
            cardIds?: string[];
            createdAt?: DbTimestampCriteria;
            customerId: string;
            entityIds?: string[];
            entityTypes?: NonNullable<"IDENTITY" | "ORGANIZATION" | null>[];
            ids?: string[];
            methods?: (
                | "REDEMPTION"
                | "SWAP"
                | "VIRTUAL_CARD"
                | "PHYSICAL_CARD"
                | "DEPOSIT_US_CASH"
                | "DEPOSIT_US_BANK_ACH"
                | "DEPOSIT_ACH_CREDIT"
                | "DEPOSIT_RTP"
                | "DEPOSIT_US_WIRE"
                | "DEPOSIT_SWIFT_WIRE"
                | "TRANSFER_NETWORK"
                | "TRANSFER"
                | "WITHDRAW_AF_BANK"
                | "WITHDRAW_AF_MOMO"
                | "WITHDRAW_MX_SPEI"
                | "WITHDRAW_SWIFT_WIRE"
                | "WITHDRAW_BLOCKCHAIN"
                | "WITHDRAW_US_BANK_ACH"
                | "WITHDRAW_US_INSTANT"
                | "WITHDRAW_ACH_PULL"
                | "WITHDRAW_US_WIRE_DRAWDOWN"
                | "WITHDRAW_US_WIRE"
                | "DEPOSIT_BLOCKCHAIN"
                | "DEPOSIT_DIRECT"
                | "FEE_TRANSFER"
            )[];
            orderBy?: { direction: "ASC"
            | "DESC"; field: "createdAt" | "updatedAt" }[];
            page?: number;
            pageSize?: number;
            paymentInstrumentIds?: (string | undefined)[];
            signatures?: string[];
            statuses?: ("PROCESSING" | "COMPLETED" | "FAILED" | "RETURNED")[];
            subtypes?: ("FEE" | "RETURN" | undefined)[] | null;
            token?: Token;
            types?: ("CREDIT" | "DEBIT")[];
            updatedAt?: DbTimestampCriteria;
            walletAddresses?: Address[];
        }
        • Optionalamount?: { operator: "EQ" | "LTE" | "GTE"; value: BigNumber }
        • OptionalbankIds?: ("greendot" | "dart" | "burling" | "jiko" | "fib" | undefined)[]
        • OptionalbankTransactionIds?: (string | undefined)[]
        • OptionalcardIds?: string[]
        • OptionalcreatedAt?: DbTimestampCriteria
        • customerId: string
        • OptionalentityIds?: string[]
        • OptionalentityTypes?: NonNullable<"IDENTITY" | "ORGANIZATION" | null>[]
        • Optionalids?: string[]
        • Optionalmethods?: (
              | "REDEMPTION"
              | "SWAP"
              | "VIRTUAL_CARD"
              | "PHYSICAL_CARD"
              | "DEPOSIT_US_CASH"
              | "DEPOSIT_US_BANK_ACH"
              | "DEPOSIT_ACH_CREDIT"
              | "DEPOSIT_RTP"
              | "DEPOSIT_US_WIRE"
              | "DEPOSIT_SWIFT_WIRE"
              | "TRANSFER_NETWORK"
              | "TRANSFER"
              | "WITHDRAW_AF_BANK"
              | "WITHDRAW_AF_MOMO"
              | "WITHDRAW_MX_SPEI"
              | "WITHDRAW_SWIFT_WIRE"
              | "WITHDRAW_BLOCKCHAIN"
              | "WITHDRAW_US_BANK_ACH"
              | "WITHDRAW_US_INSTANT"
              | "WITHDRAW_ACH_PULL"
              | "WITHDRAW_US_WIRE_DRAWDOWN"
              | "WITHDRAW_US_WIRE"
              | "DEPOSIT_BLOCKCHAIN"
              | "DEPOSIT_DIRECT"
              | "FEE_TRANSFER"
          )[]
        • OptionalorderBy?: { direction: "ASC" | "DESC"; field: "createdAt" | "updatedAt" }[]

          Defaults to createdAt DESC

        • Optionalpage?: number

          Defaults to 1

        • OptionalpageSize?: number

          Defaults to 10

        • OptionalpaymentInstrumentIds?: (string | undefined)[]
        • Optionalsignatures?: string[]
        • Optionalstatuses?: ("PROCESSING" | "COMPLETED" | "FAILED" | "RETURNED")[]
        • Optionalsubtypes?: ("FEE" | "RETURN" | undefined)[] | null

          Pass values to include only those subtypes; pass null to exclude transactions with a subtype

        • Optionaltoken?: Token

          Token name to resolve to a mint address. Defaults to MOVEUSD

        • Optionaltypes?: ("CREDIT" | "DEBIT")[]
        • OptionalupdatedAt?: DbTimestampCriteria
        • OptionalwalletAddresses?: Address[]

      Returns Promise<{ ok: true; value: { hasNext: boolean; items: Transaction[] } }>