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

enhanced readibility, fixed spelling mistakes and normalized code structuring #6

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

amstrdm
Copy link

@amstrdm amstrdm commented Nov 14, 2024

Ended up adding all new endpoints to the client. See commits for details but the two main endpoint sections I added are

  • Pie Endpoints
  • History Exports Endpoints

Specifically:

Pie Endpoints:

  1. Get All Pies:

    • Endpoint: GET https://live.trading212.com/api/v0/equity/pies
    • Description: Retrieves a list of all pies in your account.
  2. Create a New Pie:

    • Endpoint: POST https://live.trading212.com/api/v0/equity/pies
    • Description: Creates a new pie with specified instruments and allocations.
  3. Delete a Pie:

    • Endpoint: DELETE https://live.trading212.com/api/v0/equity/pies/{id}
    • Description: Deletes a pie by its ID.
  4. Get a Specific Pie:

    • Endpoint: GET https://live.trading212.com/api/v0/equity/pies/{id}
    • Description: Retrieves details of a specific pie by its ID.
  5. Update a Pie:

    • Endpoint: POST https://live.trading212.com/api/v0/equity/pies/{id}
    • Description: Updates an existing pie with new allocations or instruments.

History Exports Endpoints:

  1. Get Exported History Files:

    • Endpoint: GET https://live.trading212.com/api/v0/history/exports
    • Description: Retrieves a list of all previously exported history files.
  2. Request a New History Export:

    • Endpoint: POST https://live.trading212.com/api/v0/history/exports
    • Description: Initiates a new export of your transaction history.

Copy link
Owner

@ms32035 ms32035 left a comment

Choose a reason for hiding this comment

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

@amstrdm first of all thank you for the contribution. In order for me to accept it, you'd need to make a few changes:

  1. please remove the validation functions. Validations should be left to the API and the package currently correctly raises errors from the API. In particular, hard-coding a long list of strings that's likely to change like the icons isn't the best practice.
  2. Your code is failing pre-commit hooks. For your convenience I've updated these to the latest versions in main so you can rebase.

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.

2 participants