Class TbdexHttpServer

  • All Implemented Interfaces:

    
    public final class TbdexHttpServer
    
                        

    TBDex HTTP server responsible for handling RFQs, orders, and other interactions.

    • Method Detail

      • configure

         final Unit configure(Application app)

        Configures the Ktor application with necessary settings, including content negotiation.

        Parameters:
        app - The Ktor application to be configured.
      • onGetOfferings

         final Unit onGetOfferings(SuspendFunction1<ApplicationCall, Object> callback)

        Adds a GetOfferingsCallback for handling requests for offerings.

        Parameters:
        callback - GetOfferingsCallback function to be registered
      • onGetExchange

         final Unit onGetExchange(SuspendFunction1<ApplicationCall, Object> callback)

        Adds a GetExchangeCallback for handling requests for an exchange with a specific exchangeId.

        Parameters:
        callback - GetExchangeCallback function to be registered
      • onCreateExchange

         final Unit onCreateExchange(SuspendFunction4<ApplicationCall, Rfq, Offering, String, Unit> callback)

        Adds a CreateExchangeCallback for handling requests to create an exchange.

        Parameters:
        callback - CreateExchangeCallback function to be registered
      • onSubmitOrder

         final Unit onSubmitOrder(SuspendFunction2<ApplicationCall, Order, Unit> callback)

        Adds a SubmitOrderCallback for handling requests to submit an order.

        Parameters:
        callback - SubmitOrderCallback function to be registered
      • onSubmitClose

         final Unit onSubmitClose(SuspendFunction2<ApplicationCall, Close, Unit> callback)

        Adds a SubmitOrderCallback for handling requests to submit an order.

        Parameters:
        callback - SubmitOrderCallback function to be registered
      • start

         final Unit start()

        Starts the embedded Netty server.

      • stop

         final Unit stop()

        Stops the embedded Netty server.