Add tokens and fiat-currencies resources#1
Open
hvasconcelos wants to merge 1 commit into
Open
Conversation
- 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>
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
Adds public SDK support for the new Luzia
/v1/tokensand/v1/fiat-currenciesendpoints.Changes
Tokenmodel —chain_idandaddressare nowOptional[str](chainless canonical tokens have bothNone). New fields:id(composite, e.g."crypto:USDC")nametotal_supply(str — uint256 doesn't fit in int)logo_urltags(tuple)canonical_id(chainlesscrypto:SYMBOLrow a chain-bound token mirrors)FiatCurrency,Pagination,TokenListResponse,FiatCurrencyListResponsemodels.TokensResourcewithlist(search, chain_id, has_chain, page, limit)andget(token_id).FiatCurrenciesResourcewithlist(search, enabled, page, limit)andget(code).Luziaclient asluzia.tokensandluzia.fiat_currencies.EnabledFilterfrom the package root.Test plan
uv run pytest -q— 49/49 pass (existing DEX-token tests still work sincechain_id/addresswere always populated by the DEX response shape)./v1/tokensand/v1/fiat-currenciesAPI endpoints.🤖 Generated with Claude Code