feat: SAC detection on transfers and Python SDK client#140
Conversation
|
@BigNathan1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Miracle656
left a comment
There was a problem hiding this comment.
Reviewed — excellent PR, and thank you for catching the broken schema. Confirmed: IndexerCheckpoint on main was missing its closing brace + @@schema (a bad auto-merge when #133 landed), leaving the Prisma schema invalid. This PR restores it (verified: braces balance, all 11 models closed).
SAC detection (#136): sound approach — executableIsSac checks ContractExecutableStellarAsset vs Wasm, native-XLM SAC IDs are hardcoded to skip an RPC round-trip, status is cached per contract (immutable), and the instance fetcher is injectable for tests. The indexer tagging is correctly best-effort/non-blocking (.catch → defaults false, never blocks ingest). isSac column + migration look right.
Python client (#139): typed dataclasses, string amounts to preserve i128 precision, WraithAPIError on non-2xx, py.typed, and OIDC trusted-publishing workflow. Complete.
Summary
Adds SAC (Stellar Asset Contract) detection on transfers and a Python REST client.
closes #136
closes #139
#136 — SAC detection
src/indexer/sac-detect.tsclassifies a contract as a SAC by reading itscontract-instance ledger entry and checking whether the executable is the
built-in
ContractExecutableStellarAsset(a SAC wrapping a classic asset)rather than uploaded
Wasm(a native Soroban token).are cached per contract since SAC status is immutable; the instance fetcher is
injectable for testing.
isSacis exposed as a column onTokenTransfer(new Prisma field +migration) and is selectable via the transfers API. The indexer tags each
transfer during ingest as a best-effort step that never blocks indexing.
IndexerCheckpointmodel onmainwas missing its closing brace, sothe Prisma schema did not validate and no client could be generated. Closing
that model was required to ship the new column.
#139 — Python SDK client
clients/python/packagewraith-pywrapping the REST API in typeddataclasses (
Transfer,TransferPage,AccountSummary,AssetHolding,PopularAssets,PopularAsset). Amounts are kept as strings to preserve fulli128 precision.
WraithClientcovers transfers (incoming/outgoing/address/tx),accounts (
summary/transfers), and assets (popular). Non-2xx responsesraise
WraithAPIError. Ships apy.typedmarker for PEP 561.pyproject.tomlplus apublish-python-sdk.ymlworkflow thattests then publishes to PyPI via OIDC trusted publishing on
pyclient-v*tags.Testing
npx tsc --noEmit— cleannpx jest— all unit suites pass; newsacDetectsuite addedpytest(clients/python) — 7 passing