@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
    solanaTokenService: SolanaTokenService

    Methods

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

      Parameters

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

          The country of the entity that may perform the swap

        • customerId: string
        • entityType: "IDENTITY" | "ORGANIZATION"

          The type of the entity that may perform the swap

        • 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