Skip to content

adrianbumbas/stockfighter-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

Java 8 API for the StockFighter Game

It includes both the documented API and the game master API. All the REST calls are wrapped into a CompletableFuture and the Websocket calls in a RxJava Observable.

Installation

Fetch and install into your local Maven repository

git clone https://github.com/adrianbumbas/stockfighter-api
cd stockfighter-api
mvn install

Then add it to your pom.xml

  <dependency>
    <groupId>com.amonsoftware.stockfighter</groupId>
    <artifactId>stockfighter-api</artifactId>
    <version>1.0-SNAPSHOT</version>
  </dependency>

Usage

In order to create a new Stockfighter API object do

StockfighterAPI stockfighterAPI = new StockfighterAPI("your api key");

Example code to get the heartbeat (blocking)...

stockfighterAPI.getHeartbeat().get();

...and nonblocking

stockfighterAPI.getHeartbeat().thenAccept(heartbeat -> //consume the response);

Create a new game master API

GameMasterAPI gameMasterAPI = new GameMasterAPI("your api key");

Usage of the Ticker Tape Websocket API

StockfighterWSApi stockfighterWSApi = new StockfighterWSApi();
stockfighterWSApi.getQuoteSubscription("YOUR_VENUE", "YOUR_ACCOUNT").subscribe(quoteSubscription -> {
            //quoteSubscription contains the quote information
        });

About

Java 8 API for Stockfighter game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages