Skip to content

Add tokens and fiat-currencies resources#1

Open
hvasconcelos wants to merge 1 commit into
masterfrom
feat/tokens-fiat-canonical
Open

Add tokens and fiat-currencies resources#1
hvasconcelos wants to merge 1 commit into
masterfrom
feat/tokens-fiat-canonical

Conversation

@hvasconcelos
Copy link
Copy Markdown
Member

Summary

Adds public SDK support for the new Luzia /v1/tokens and /v1/fiat-currencies endpoints.

Changes

  • Token modelchain_id and address are now Optional[str] (chainless canonical tokens have both None). New fields:
    • id (composite, e.g. "crypto:USDC")
    • name
    • total_supply (str — uint256 doesn't fit in int)
    • logo_url
    • tags (tuple)
    • canonical_id (chainless crypto:SYMBOL row a chain-bound token mirrors)
  • New FiatCurrency, Pagination, TokenListResponse, FiatCurrencyListResponse models.
  • New TokensResource with list(search, chain_id, has_chain, page, limit) and get(token_id).
  • New FiatCurrenciesResource with list(search, enabled, page, limit) and get(code).
  • Both wired on the Luzia client as luzia.tokens and luzia.fiat_currencies.
  • Export the new types and EnabledFilter from the package root.

Test plan

  • uv run pytest -q — 49/49 pass (existing DEX-token tests still work since chain_id/address were always populated by the DEX response shape).
  • Smoke-tested live against the new public /v1/tokens and /v1/fiat-currencies API endpoints.

🤖 Generated with Claude Code

- Extend Token model: chain_id and address are now Optional (chainless
  canonical tokens have both None); new fields id, name, total_supply,
  logo_url, tags, canonical_id.
- New FiatCurrency, Pagination, TokenListResponse and FiatCurrencyListResponse
  models.
- New TokensResource (list / get) and FiatCurrenciesResource (list / get)
  exposed on the Luzia client as `luzia.tokens` and `luzia.fiat_currencies`.
- Wires the new public /v1/tokens and /v1/fiat-currencies API endpoints.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant