These schemas allow users to access information about tokens, including their basic information like name, denomination, and ID, as well as more detailed information like their addresses on different chains and extended information about the token. They also provide statistics about a token's performance in the market, including market cap and price changes over time. The paginated versions of these dataclasses enable users to view lists of tokens in a more organized and manageable way.
SimpleToken
export class SimpleToken {
token_id: string;
name: string;
denom: string;
image: string | undefined;
}
@dataclass
class SimpleToken:
token_id: str
name: str
denom: str
image: str | None = None
The SimpleToken
dataclass holds basic information about a token, including its name, denomination, and ID. The name
attribute holds the name of the token, while the denom
attribute holds its denomination. The id
attribute is optional and holds a unique identifier for the token. The image
attribute is also optional and holds a URL to an image representing the token.
BaseToken
export class BaseToken {
name: string;
denom: string;
id: string;
image: string | undefined;
latest_price: string | undefined;
price_24h_change: string | undefined;
}
@dataclass
class BaseToken:
name: str
denom: str
id: str
image: str | None = None
latest_price: str | None = None
price_24h_change: str | None = None
The BaseToken
dataclass extends SimpleToken
to include additional information such as the latest price and 24-hour price change. The latest_price
attribute holds the token's latest price, while the price_24h_change
attribute holds the percentage change in the token's price over the last 24 hours.
ExtendedToken
export class ExtendedToken extends BaseToken {
extended_information: ExtendedInformation | undefined;
addresses: Record<ChainKeys, TokenChain>;
}
@dataclass
class ExtendedToken(BaseToken):
extended_information: ExtendedInformation | None
addresses: dict[ChainKeys, TokenChain]
The ExtendedToken
dataclass extends BaseToken
to include more detailed information about the token, including the token's addresses on different chains and extended information about the token. The addresses
attribute holds a dictionary of TokenInChain
objects representing the token's addresses on different chains. The extended_information
attribute is optional and holds additional information about the token.
TokenStats
export class TokenStats {
market_cap: string;
total_liquidity: string | undefined;
price_oracles: Array<string>;
last_24_hour_price: string | undefined;
last_24_hour_change: string | undefined;
last_24_hour_change_percentage: string | undefined;
last_7_day_price: string | undefined;
last_7_day_change: string | undefined;
last_7_day_change_percentage: string | undefined;
}
@dataclass
class TokenStats:
market_cap: str
total_liquidity: str | None = None
price_oracles: list[str] | None = None
last_24_hour_price: str | None = None
last_24_hour_change: str | None = None
last_24_hour_change_percentage: str | None = None
last_7_day_price: str | None = None
last_7_day_change: str | None = None
last_7_day_change_percentage: str | None = None
TokenStats
is a dataclass that holds various statistics about a token's performance in the market, such as market cap, and various changes in the price in the last 24 hours and 7 days.
TokenWithStats
export class TokenWithStats {
token: ExtendedToken;
stats: TokenStats;
}
@dataclass
class TokenWithStats:
token: ExtendedToken
stats: TokenStats
TokenWithStats
is a dataclass that holds an ExtendedToken
object and a TokenStats
object. The ExtendedToken
object holds detailed information about a token, while the TokenStats
object holds statistics about the token's performance in the market, such as market cap, price change and percentage change.
PaginatedTokenWithStats
export class PaginatedTokenWithStats {
response: Array<TokenWithStats>;
total: number;
}
@dataclass
class PaginatedTokenWithStats:
response: list[TokenWithStats]
total: int
PaginatedTokenWithStats
is a dataclass that holds a paginated list of TokenWithStats
objects and the total number of tokens available. The response
attribute holds a list of TokenWithStats
objects, which contain an ExtendedToken
object and a TokenStats
object, while the total
attribute holds the total count of tokens.
TokenPriceTimeseries
export class TokenPriceTimeseries {
tier: TierKeys;
timeseries: Record<number, number | undefined>;
}
@dataclass
class TokenPriceTimeseries:
tier: TierKeys
timeseries: dict[str, float | None]
The TokenPriceTimeseries
dataclass holds a price timeseries for a specific time range. It includes a tier
attribute, which specifies the time range, and a timeseries
attribute, which is a dictionary that maps timestamps to token prices. The timestamps are Unix timestamps in seconds, and the token prices are represented as floats, or None
if the price is not available.
TokenAdvancedGlobalStats
export class TokenAdvancedGlobalStats {
price_timeseries: TokenPriceTimeseries | undefined;
market_cap_timeseries: Record<number, number | undefined> | undefined;
}
@dataclass
class TokenAdvancedGlobalStats:
price_timeseries: TokenPriceTimeseries | None = None
market_cap_timeseries: dict[int, float | None] | None = None
The TokenAdvancedGlobalStats
data class holds advanced statistics about a token, such as its price timeseries and market cap timeseries.
TokenExplore
export class TokenExplore extends TokenWithStats {
advanced_stats: TokenAdvancedGlobalStats;
}
@dataclass
class TokenExplore(TokenWithStats):
advanced_stats: TokenAdvancedGlobalStats
The TokenExplore
data class extends TokenWithStats
and adds an advanced_stats
attribute, which holds an instance of the TokenAdvancedGlobalStats
data class.
PaginatedTokenExplore
export class PaginatedTokenExplore {
response: Array<TokenExplore>;
total: number;
}
@dataclass
class PaginatedTokenExplore:
response: list[TokenExplore]
total: int
The PaginatedTokenExplore
data class is used to represent a paginated list of TokenExplore
objects. It includes a list of TokenExplore
objects and the total number of tokens available.