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

    Implements read only methods for swap quotes

    The operations in this class assume that the Customer is already validated (both AuthN and AuthZ).

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    jupiterClient: JupiterSwapClient
    productQuoteService: ProductQuoteService
    solanaTokenMintAddressService: SolanaTokenMintAddressService
    solanaTokenService: SolanaTokenService

    Methods

    • Ephemeral (and entity-agnostic) quote of target amount and fees

      Parameters

      • __namedParameters: {
            customerId: string;
            entityId: string;
            sourceAmount: number;
            sourceCurrency: "MOVEUSD" | "USDC" | "SOL" | "WETH" | "WBTC" | "REWARD";
            targetCurrency: "MOVEUSD" | "USDC" | "SOL" | "WETH" | "WBTC" | "REWARD";
        }

      Returns Promise<
          | { ok: true; value: SwapEstimate }
          | {
              error:
                  | ServiceError<"INVALID_AMOUNT" | "INVALID_INPUT">
                  | ServiceError<
                      "INVALID_AMOUNT_AFTER_FEES",
                      {
                          fees: Fees;
                          sourceAmount: number;
                          sourceAmountAfterFees: number;
                          sourceCurrency: "MOVEUSD"
                          | "USDC"
                          | "SOL"
                          | "WETH"
                          | "WBTC"
                          | "REWARD";
                          totalFees: BigNumber;
                      },
                  >;
              ok: false;
          },
      >

      invalidAmount