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 transaction history pagination support #56

Closed
wants to merge 1 commit into from

Conversation

mattypiper
Copy link

@mattypiper mattypiper commented Jan 31, 2021

Problem addressed

Some of the tastyworks endpoints need to be paginated. this PR adds pagination for the transactions (history) endpoint.

I refactored tastyworks/models/trading_account.py to save the session into the account object. It seemed cleaner to me. If you don't like it, I understand rejecting the PR. But feel free to use what I learned about history pagination in your own way.

Solution

Use HTTP GET request arguments "start-at", "end-at", "per-page", "page-offset"
Use HTTP GET response parameters "pagination" and "total-pages"

Checklist

@mattypiper
Copy link
Author

I modified example.py a little bit too to print out (test) the transaction history. I'm sure order history (and other endpoints) can support the same style of pagination using the API params, but I haven't played with that yet.

extended the dates beyond 30 days and demonstrated how to adjust the
dates requested
@mattypiper
Copy link
Author

closing in favor of #64

@mattypiper mattypiper closed this Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant