-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add switch to support FTX.us #2
Comments
If the endpoints and methods are the same (except for the ones missing on the US exchange), you could try to just override the base URL. There's a third parameter to the RestClient where you can pass client-specific configuration options. Something like this should work, assuming everything else about ftx.us is consistent: const restClientOptions = {
baseUrl: 'https://ftx.us/api'
};
const client = new RestClient(key, secret, restClientOptions); The websocket client has the same configurability, although the constructor is slightly different. The time sync also uses the rest client, so it's important to also include the restClientOptions as well as the custom ws URL. Pseudo example: const restClientOptions = {
baseUrl: 'https://ftx.us/api'
};
const wsConfig = {
key: 'apikeyhere',
secret: 'apisecrethere',
// subAccountName: 'sub1',
wsUrl: 'wss://ftx.us/ws/',
restOptions: restClientOptions
};
const ws = new WebsocketClient(wsConfig); Let me know if this works. Would be good to add a sample to the examples folder. |
Thanks for the fast response! I am using rest only, but the headers are changed too for key, subaccount, secret. In the documentation, they use ftxus-key instead of key I believe. It's a pretty straightforward change I think. If you push something, I can test since I am a US user. |
I've whipped up an implementation to deal with it, can you try it out? Websocket too please 😄 Changes can be seen here: It's available on npm via the beta tag: Usage example: |
We tested Rest API and can confirm it works! Thank you so much for this! Unfortunately we don't have web socket enabled on our system, so I can't confirm. |
Thanks for confirming! I've published the same version as the latest release on this package (ftx-api@1.0.2). It should be available shortly if you install |
Hi there,
Is there a way to pass in FTX.us through this API?
The text was updated successfully, but these errors were encountered: