Rest API

Introduction

HXRO Network provides a self hosted REST API as a Docker container for those who wish to continue running their trading bots or build on top of the parimutuel protocol without having to rewrite to a web3 interface.

How to get it

The image is available on our public registry public.ecr.aws/n7a0e3o7/parimutuelapi:latest. This remains in preview mode and is generally automatically updated by our CI/CD pipelines subject to our tests passing. While the endpoints are now mostly stable, minor changes might still occur, we will aim to announce those on our Discord.

Configuration

Configuration of the API server is done via passing environment variables in the usual way when creating a container. The following parameters are supported:
  • VALIDATOR_URL: A URL to a public or private validator (for Devnet)
  • PROGRAM_ID: The current program id on devnet is 3kjK4HA6A4K86NgNB93gGhSt257wtN4QAqXMNPQ4fVTm
  • PRIVATE_KEY: The private key for the owner of the system account that will be used to pay for transactions and which owns the ATAs holding the settlement token (USDC) and any HXRO tokens. Note you can get an airdrop for both using our devnet UI, see How to Trade Parimutuels (Devnet Version) for more information.
  • CORS: Set to true to allow cross origin requests.

Endpoints

The REST API attempts to replicate the existing hxro.trade API described here at https://hxroapi.readme.io/docs/getting-started. Currently the following endpoints are supported:
  • GET /api/contestseries/running
  • GET /api/contests/by-series/<id>
  • GET /api/contests/<id>
  • POST /api/ContestEntry/add-contest-entry
  • GET /api/ContestEntry/by-user-entry/<user_id>/<entry_id>
  • GET /api/ContestEntry/by-user/<user_id>

Comments, Feedback, Suggestions

Please find us on the #dev-chat channel on Discord at https://discord.com/channels/740983228134981793/980287738819538974