alpacahq / alpacahq/alpaca-py

[ Feature Request ] Add direct limit/offset support to fetch transfers

Aperta
#608 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
1.5k
Fork
398
Merge medio
1g 16h
PR unite (30g)
6

Descrizione

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe.

No

### Describe the solution you'd like.

The current `get_transfers_for_account` method handles pagination internally and always starts from offset 0, which doesn’t allow fetching a specific page (e.g., offset 20, limit 10) directly.

It would be helpful to have a method like:

```python
def get_transfers_for_account2(
self,
account_id: Union[UUID, str],
transfers_filter: Optional[GetTransfersRequest] = None,
) -> List[Transfer]:
account_id = validate_uuid_id_param(account_id)
request_fields = transfers_filter.to_request_fields()
result = self.get(f"/accounts/{account_id}/transfers", request_fields)
return [Transfer.model_validate(item) for item in result]
```

### Describe an alternate solution.

_No response_

### Anything else? (Additional Context)

_No response_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.