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

    Only exposes what consumers have access to.

    Within the domain, we use SwapAdminService for service-to-service interactions.

    Index
    db: B2bDatabase
    instance: (...args: []) => SwapQueryService = ...

    The process service, on the shared database.

    • The customer's swap. sources narrows it as search does: the swap API passes ["ACCOUNT"], since a DEPOSIT swap reaches a customer through the transaction list and the webhook only.

      Parameters

      • __namedParameters: { customerId: string; id: string; sources?: ("DEPOSIT" | "ACCOUNT")[] }

      Returns Promise<
          {
              ok: true;
              value: | {
                  amount: BigNumber
                  | null;
                  createdAt: Date;
                  depositAddressId: string | null;
                  filledAt: Date | null;
                  id: string;
                  ledgerAccountId: string | null;
                  quote: SwapQuote | null;
                  receipt?: (
                      | {
                          id: string;
                          leg?: SwapReceiptLeg;
                          type: "SOLANA_TRANSACTION_SIGNATURE";
                      }
                      | {
                          chain: string;
                          id: string;
                          leg?: SwapReceiptLeg;
                          logIndex: number;
                          type: "EVM_TRANSACTION_SIGNATURE";
                      }
                      | {
                          id: string;
                          leg?: SwapReceiptLeg;
                          type: "TRON_TRANSACTION_SIGNATURE";
                      }
                  )[];
                  source: "DEPOSIT"
                  | "ACCOUNT";
                  sourceDescription: string;
                  status: "PENDING" | "FAILED" | "PROCESSING" | "COMPLETED";
                  statusDescription: string;
                  token: { id: string; symbol: string } | null;
                  updatedAt: Date;
              } & { entityId: string }
              | null;
          },
      >

    • Parameters

      • __namedParameters: SwapSearchFilters & { customerId: string }

      Returns Promise<
          {
              ok: true;
              value: {
                  hasNext: boolean;
                  items: (
                      {
                          amount: BigNumber
                          | null;
                          createdAt: Date;
                          depositAddressId: string | null;
                          filledAt: Date | null;
                          id: string;
                          ledgerAccountId: string | null;
                          quote: SwapQuote | null;
                          receipt?: (
                              | {
                                  id: string;
                                  leg?: (...)
                                  | (...);
                                  type: "SOLANA_TRANSACTION_SIGNATURE";
                              }
                              | {
                                  chain: string;
                                  id: string;
                                  leg?: (...)
                                  | (...);
                                  logIndex: number;
                                  type: "EVM_TRANSACTION_SIGNATURE";
                              }
                              | {
                                  id: string;
                                  leg?: (...)
                                  | (...);
                                  type: "TRON_TRANSACTION_SIGNATURE";
                              }
                          )[];
                          source: "DEPOSIT"
                          | "ACCOUNT";
                          sourceDescription: string;
                          status: "PENDING" | "FAILED" | "PROCESSING" | "COMPLETED";
                          statusDescription: string;
                          token: { id: string; symbol: string } | null;
                          updatedAt: Date;
                      } & { entityId: string }
                  )[];
                  total: number;
              };
          },
      >