FTX Exchange, Unable to perform authed requests
See original GitHub issueHello there,
Looks like there is something wrong with the FTX Exchange signature generation (FTX-SIGN header), I’m trying to perform authed requests with my (US) api key and secret but I always get the next message: Not logged in (HTTP status code: 401) (HTTP status code: 0)
Although if I replicate the request with postman (using the generated params (headers) from the lib) I get the next message: { "success": false, "error": "Not logged in: Invalid signature" }
I’m using the next code to connect to the US FTX Exchange:
val authenticatedClient = ExchangeFactory.INSTANCE.createExchangeWithoutSpecification(FtxExchange::class.java).also {
val exchangeSpecification = FtxExchange().defaultExchangeSpecification.apply {
apiKey = "API_KEY"
secretKey = "API_SECRET"
sslUri = "https://ftx.us"
host = "ftx.us"
}
it.applySpecification(exchangeSpecification)
}
EDIT: Looks like the request headers are sent as FTX-KEY, FTX-TS, FTX-SIGN etc, but at the US exchange the headers should be FTXUS-KEY, FTXUS-TS, FTXUS-SIGN, etx, would be good if that can be configured through the exchange specification
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
@mystarrocks That could work.
Sadly we ended by dropping XChange from our project and we made our own exchange implementation from the scratch.
Hope someone finds this helpful.
With no easy way to configure the header names for the US version (host and URI can be customized on the
ExchangeSpecification
), I used a ResCU interceptor to get around. Here’s some sample code from my working setup:Custom interceptor
Interceptor service registration (
src/main/resources/META-INF/services
)API path resource class
Just copy/paste
FtxAuthenticated
, rename headers, and add a header parameter annotation forFTX-TS
.