Petersoj / alpaca-java

A Java API for Alpaca, the commission free, algo friendly, stock trading broker. https://alpaca.markets
https://petersoj.github.io/alpaca-java/
MIT License
203 stars 83 forks source link

Update enum value for FTX in Exchange #124

Closed TonyMaganga closed 2 years ago

TonyMaganga commented 2 years ago

The enum value for FTX in net.jacobpeterson.alpaca.model.endpoint.marketdata.crypto.common.enums.Exchange should be changed to "FXTU" to match the Crypto Pricing API .

`package net.jacobpeterson.alpaca.model.endpoint.marketdata.crypto.common.enums;

import com.google.gson.annotations.SerializedName; import java.util.HashMap; import java.util.Map;

public enum Exchange { @SerializedName("ERSX") ERISX("ERSX"), @SerializedName("FTX") FTX("FTX"),`

Currently an exception is thrown when getting trades

net.jacobpeterson.alpaca.rest.AlpacaClientException: Status Code: 422, Status Message: "Unprocessable Entity", API Response Code: 42210000, API Response Message: "invalid exchange: FTX" at net.jacobpeterson.alpaca.rest.AlpacaClient.request(AlpacaClient.java:207) at net.jacobpeterson.alpaca.rest.AlpacaClient.requestJSON(AlpacaClient.java:162) at net.jacobpeterson.alpaca.rest.AlpacaClient.requestObject(AlpacaClient.java:140) at net.jacobpeterson.alpaca.rest.AlpacaClient.requestObject(AlpacaClient.java:122) at net.jacobpeterson.alpaca.rest.endpoint.marketdata.crypto.CryptoMarketDataEndpoint.getLatestTrade(CryptoMarketDataEndpoint.java:122)

Petersoj commented 2 years ago

@TonyMaganga thanks for reporting this. I'll fix this in a release sometime next week.

TonyMaganga commented 2 years ago

@Petersoj just want to remind you of this bug. Please look into it

Petersoj commented 2 years ago

@TonyMaganga thanks for the follow up! I'll issue a patch release later today.

Petersoj commented 2 years ago

Fixed in 9.1.2.

TonyMaganga commented 2 years ago

Thanks. I have tested it and works fine