Skip to content

feat(python-client): add status, nfts, and webhooks endpoints (#312) - #349

Open
phatloi0010 wants to merge 1 commit into
Miracle656:mainfrom
phatloi0010:feat/python-client-status-nfts-webhooks-312
Open

phatloi0010 wants to merge 1 commit into
Miracle656:mainfrom
phatloi0010:feat/python-client-status-nfts-webhooks-312

Conversation

@phatloi0010

Copy link
Copy Markdown

Summary

Brings the Python client (clients/python) to endpoint parity with the Go client (clients/go) by adding typed models and client methods for /status, /nfts/*, and /webhooks/*.

Closes #312

Changes

  1. clients/python/wraith/models.py & clients/python/wraith/__init__.py:
    • Added Status (ok, last_indexed_ledger, latest_ledger, lag_ledgers, started_at, uptime_seconds, total_indexed, status, network).
    • Added NftTransfer (NFTTransfer), NftTransferPage (NFTTransferPage), NftOwner (NFTOwner), and NftMetadata (NFTMetadata).
    • Added WebhookSubscription, WebhookSubscriptionList, WebhookDelivery, and WebhookDeliveryList (WebhookDeliveryPage).
  2. clients/python/wraith/client.py:
    • Added WraithClient.status() (GET /status).
    • Added WraithClient.nft_transfers(...) (GET /nfts/transfers) and WraithClient.nft_owner(contract, token_id) (GET /nfts/owners/:contract/:token_id).
    • Added WraithClient.webhooks() (GET /webhooks), WraithClient.webhook_deliveries(webhook_id, ...) (GET /webhooks/:id/deliveries), WraithClient.create_webhook(...) (POST /webhooks), and WraithClient.delete_webhook(webhook_id) (DELETE /webhooks/:id).
  3. clients/python/tests/test_client.py & clients/python/README.md:
    • Added offline responses-stubbed unit tests covering /status, /nfts/transfers query serialization & pagination parsing, /nfts/owners/:contract/:token_id metadata parsing, /webhooks & /webhooks/:id/deliveries, and POST/DELETE webhook lifecycle.
    • Updated clients/python/README.md usage examples and coverage table.

Verification

  • pytest (clients/python): PASS (12/12 tests passing)

This branch has not been deployed

No deployments
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.

The Python client is three endpoints of an API with twenty

1 participant