Skip to content
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 proxy support for futures and spot clients (async and sync) #257

Merged
merged 4 commits into from
Jul 31, 2024

Conversation

Graeme22
Copy link
Contributor

@Graeme22 Graeme22 commented Jul 24, 2024

Summary

For context see: #256
This PR adds support for HTTP proxies to use with spot and futures REST clients, both sync and async.
For now websockets are omitted as the websockets library does not support proxies. The motivation is to allow for privacy/unblocking or other security-related concerns.

Changes / Features

A single argument, proxy, has been added to the constructors for all REST clients. This proxy is used for all requests placed with those clients. Tests have also been added for all four variations: SpotClient, SpotAsyncClient, FuturesClient, and FuturesAsyncClient. The most relevant changes are included in the kraken/base_api/__init__.py file and in the new tests.

Closes: #256

@btschwertfeger btschwertfeger self-requested a review July 27, 2024 07:00
@btschwertfeger btschwertfeger added this to the Upcoming Release milestone Jul 27, 2024
@btschwertfeger btschwertfeger added enhancement New feature or request Futures Topic related to Futures trading Spot Topic related to Spot trading NFT NFT related labels Jul 27, 2024
Copy link
Owner

@btschwertfeger btschwertfeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Graeme22, after applying the suggested changes, I'm happy with the proposed change.

I see that the CI jobs didn't start, have you activated those on your feature branch? Locally they just ran through, but having those demonstrated here as well would be preferable.

kraken/spot/user.py Outdated Show resolved Hide resolved
tests/futures/test_futures_base_api.py Show resolved Hide resolved
tests/futures/test_futures_base_api.py Show resolved Hide resolved
tests/futures/test_futures_base_api.py Show resolved Hide resolved
tests/futures/test_futures_base_api.py Show resolved Hide resolved
tests/spot/test_spot_base_api.py Show resolved Hide resolved
tests/spot/test_spot_base_api.py Show resolved Hide resolved
Co-authored-by: Benjamin T. Schwertfeger <development@b-schwertfeger.de>
@Graeme22
Copy link
Contributor Author

Hey @Graeme22, after applying the suggested changes, I'm happy with the proposed change.

Great!

I see that the CI jobs didn't start, have you activated those on your feature branch? Locally they just ran through, but having those demonstrated here as well would be preferable.

I just activated them, looks like you need to approve the changes for them to run.

@btschwertfeger
Copy link
Owner

I just activated them, looks like you need to approve the changes for them to run.

I can't see anything to approve for the actions. I'll check that behavior using another account tomorrow.

@btschwertfeger btschwertfeger enabled auto-merge (squash) July 31, 2024 14:11
@btschwertfeger btschwertfeger disabled auto-merge July 31, 2024 14:16
@btschwertfeger
Copy link
Owner

Merging by hand now - with failing tests - since they're just failing due to wrong setup which is not that important for this change. (Some environment variables are not set in the author's repository.)

@btschwertfeger btschwertfeger merged commit 23ebb6a into btschwertfeger:master Jul 31, 2024
28 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Futures Topic related to Futures trading NFT NFT related Spot Topic related to Spot trading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature proposal: Add proxy support
2 participants