TBDex HTTP Server powered by Express

Constructors

Properties

api: Express

Express server instance

balancesApi?: BalancesApi

PFI Balances API

callbacks: CallbackMap

Map of callbacks handlers for the available requests

exchangesApi: ExchangesApi

PFI Exchanges API

offeringsApi: OfferingsApi

PFI Offerings API

pfiDid: string

PFI DID

Methods

  • Setup the PFI routes and start a express server to listen for incoming requests

    Parameters

    • port: string | number

      server port number

    • Optional callback: (() => void)

      to be called when the server is ready

        • (): void
        • Returns void

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Set up a callback or overwrite the existing callback for the SubmitRfq endpoint

    Parameters

    • callback: CreateExchangeCallback

      A callback to be invoked when a valid Rfq is sent to the CreateExchange endpoint.

    Returns void

  • Set up a callback or overwrite the existing callback for the GetBalances endpoint

    Parameters

    • callback: GetBalancesCallback

      A callback to be invoked when a valid request is sent to the GetBalances endpoint.

    Returns void

  • Set up a callback or overwrite the existing callback for the GetExchange endpoint

    Parameters

    • callback: GetExchangeCallback

      A callback to be invoked when a valid request is sent to the GetExchange endpoint.

    Returns void

  • Set up a callback or overwrite the existing callback for the GetExchanges endpoint

    Parameters

    • callback: GetExchangesCallback

      A callback to be invoked when a valid request is sent to the GetExchanges endpoint.

    Returns void

  • Set up a callback or overwrite the existing callback for the GetOfferings endpoint

    Parameters

    • callback: GetOfferingsCallback

      A callback to be invoked when a valid request is sent to the GetOfferings endpoint.

    Returns void

  • Set up a callback or overwrite the existing callback for the for the SubmitMessage endpoint

    Parameters

    • callback: SubmitCloseCallback

      A callback to be invoked when a valid Close is sent to the SubmitMessage endpoint.

    Returns void

  • Set up a callback or overwrite the existing callback for the for the SubmitMessage endpoint

    Parameters

    • callback: SubmitOrderCallback

      A callback to be invoked when a valid Order is sent to the SubmitMessage endpoint.

    Returns void