Skip to content
HAT Data Exchange client wrapper for Scala/Play
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Scala API wrappers for the HAT DEX

Current Version: 2.4.1

This repository provides convenience wrappers around HAT DEX HTTP APIs and contains the most up-to-date set of typesafe DEX Data Models and Play-JSON based serializers and deserializers for them.

It relies on Play-WS for an asynchronous HTTP client.


The library artifacts are hosted on AWS S3:

resolvers += "HAT Library Artifacts Releases" at ""
// Or for SNAPSHOTS:
// "HAT Library Artifacts Snapshots" at ""
libraryDependencies ++= "org.hatdex" %% "dex-client-scala-play" % 2.4.1

To use the client, it is sufficient to create a new one with minimal configuration:

new DexClient(wsClient, dexAddress, schema)


  • wsClient is an instance of the WS Client, ideally dependency-injected in most cases - check Play documentation for details
  • dexAddress is the fully-qualified domain name of the DEX - should never be different than except for when in testing
  • schema is the schema of the address, should never be anything else than "https://" (default if left out) except when in testing

The client is non-blocking and is built around standard Scala Futures. For example, to receive a list of Offer Claims for an offer you have put in you would run:

val dex = new DexClient(wsClient, dexAddress, schema)
for {
  claims <- dex.offerClaims(accessToken, offerId)
} yield claims

Here accessToken is an access token you have received from DEX for your account and the offerId is the UUID of the offer you have put in and that has been satisfied

You can’t perform that action at this time.