Package tbdex.sdk.httpserver.handlers
Class CreateExchangeKt
-
- All Implemented Interfaces:
public final class CreateExchangeKt
-
-
Method Summary
Modifier and Type Method Description final static UnitcreateExchange(ApplicationCall call, OfferingsApi offeringsApi, ExchangesApi exchangesApi, SuspendFunction4<ApplicationCall, Rfq, Offering, String, Unit> callback)Handles the submission of a Request for Quote (RFQ) through the TBDex API. final static BooleanisValidUrl(String replyToUrl)Checks if a string is a valid URL. -
-
Method Detail
-
createExchange
final static Unit createExchange(ApplicationCall call, OfferingsApi offeringsApi, ExchangesApi exchangesApi, SuspendFunction4<ApplicationCall, Rfq, Offering, String, Unit> callback)
Handles the submission of a Request for Quote (RFQ) through the TBDex API.
This function parses an RFQ message, performs necessary validations, and invokes the callback if provided. It responds with appropriate HTTP status codes for success or failure scenarios.
- Parameters:
call- The Ktor application call object representing the incoming HTTP request.offeringsApi- An instance of OfferingsApi for interacting with offerings data.exchangesApi- An instance of ExchangesApi for interacting with exchanges data.callback- An optional callback function to be invoked after processing the RFQ.
-
isValidUrl
final static Boolean isValidUrl(String replyToUrl)
Checks if a string is a valid URL.
- Parameters:
replyToUrl- The string to be checked.- Returns:
boolean indicating whether the string is a valid URL.
-
-
-
-