Repository navigation
feat(python-client): add status, nfts, and webhooks endpoints (#312) - #349
Open
phatloi0010 wants to merge 1 commit into
Open
phatloi0010 wants to merge 1 commit into
phatloi0010 wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
clients/python/wraith/models.py&clients/python/wraith/__init__.py:Status(ok,last_indexed_ledger,latest_ledger,lag_ledgers,started_at,uptime_seconds,total_indexed,status,network).NftTransfer(NFTTransfer),NftTransferPage(NFTTransferPage),NftOwner(NFTOwner), andNftMetadata(NFTMetadata).WebhookSubscription,WebhookSubscriptionList,WebhookDelivery, andWebhookDeliveryList(WebhookDeliveryPage).clients/python/wraith/client.py:WraithClient.status()(GET /status).WraithClient.nft_transfers(...)(GET /nfts/transfers) andWraithClient.nft_owner(contract, token_id)(GET /nfts/owners/:contract/:token_id).WraithClient.webhooks()(GET /webhooks),WraithClient.webhook_deliveries(webhook_id, ...)(GET /webhooks/:id/deliveries),WraithClient.create_webhook(...)(POST /webhooks), andWraithClient.delete_webhook(webhook_id)(DELETE /webhooks/:id).clients/python/tests/test_client.py&clients/python/README.md:responses-stubbed unit tests covering/status,/nfts/transfersquery serialization & pagination parsing,/nfts/owners/:contract/:token_idmetadata parsing,/webhooks&/webhooks/:id/deliveries, andPOST/DELETEwebhook lifecycle.clients/python/README.mdusage examples and coverage table.Verification
pytest(clients/python): PASS (12/12tests passing)