// Copyright © Endless // Copyright © Aptos Foundation // SPDX-License-Identifier: Apache-2.0 /** * RESPONSE TYPES FOR INDEXER REST APIS */ export interface GetCoinDataResponse { id: string; symbol: string; name: string; project_uri?: string | null; icon_uri?: string | null; decimals: number; supply: string; } export interface GetAccountCoinData { balance: string; frozen: boolean; metadata: GetCoinDataResponse; } export interface GetAccountCoinsDataResponse { data: GetAccountCoinData[]; page: number; pageSize: number; total: number; } export interface GetCreatedCoinDataResponse { data: GetCoinDataResponse[]; page: number; pageSize: number; total: number; } export interface GetAccountsCoinBalanceData { address: string; balance: string; frozen: boolean; } export type GetAccountsCoinBalanceResponse = GetAccountsCoinBalanceData[]; /** * A generic type that being passed by each function and holds an * array of properties we can sort the query by */ export type OrderBy = Array<{ [K in keyof T]?: OrderByValue }>; export type OrderByValue = | "asc" | "asc_nulls_first" | "asc_nulls_last" | "desc" | "desc_nulls_first" | "desc_nulls_last"; /** * Refers to the token standard we want to query for */ export type TokenStandard = "v1" | "v2"; /** * COIN & NFT API TYPES FROM API.JSON */ export interface AccountBalanceItem { coin: string; balance: string; frozen: boolean; } export interface AccountBalancesResponse { address: string; balances: AccountBalanceItem[]; } export interface CoinBalanceResponse { address: string; balance: string; frozen: boolean; } export interface FungibleAssetMetadataResponse { id: string; decimals: number; icon_uri?: string; name: string; project_uri?: string; symbol: string; supply: string; max_supply?: string; holders: string; } export interface CoinResponse { metadata: FungibleAssetMetadataResponse; balance: string; frozen: boolean; } export interface GetAccountsBalancesRequest { accounts: string[]; coins: string[]; } export interface HoldersItem { address: string; balance: string; } export interface PageableCoinResponse { total: number; page: number; pageSize: number; data: CoinResponse[]; } export interface PageableFungibleAssetMetadataResponse { total: number; page: number; pageSize: number; data: FungibleAssetMetadataResponse[]; } export interface PageableHoldersItem { total: number; page: number; pageSize: number; data: HoldersItem[]; } export interface Royalty { percent: string; payee_address: string; } export interface CollectionResponse { id: string; creator: string; description: string; name: string; uri: string; current_supply: number; total_minted: number; last_transaction_version: number; last_transaction_hash: string; holders: string; created_at: number; transfers: string; max_supply?: number | null; royalty?: Royalty | null; } export interface NftHistoryRecordToken { id: string; name: string; index: number; uri: string; } export interface NftCollectionHistoryRecord { token: NftHistoryRecordToken; version: number; type: string; timestamp: number; from?: string | null; to?: string | null; } export interface NftMetrics { total_collections: string; total_nfts: string; total_transfers: string; total_holders: string; } export interface NftOwnedCollectionResponse { collection: CollectionResponse; count: number; } export interface SearchResponse { name: string; address: string; type: string; symbol?: string | null; } export interface NftTokenHistoryRecord { version: number; type: string; timestamp: number; from?: string | null; to?: string | null; } export interface NftTokenResponse { id: string; name: string; index: number; description: string; uri: string; owner: string; properties: { [key: string]: string }; last_transaction_version: number; last_transaction_hash: string; collection?: CollectionResponse | null; } export interface PageableCollectionResponse { total: number; page: number; pageSize: number; data: CollectionResponse[]; } export interface PageableNftCollectionHistoryRecord { total: number; page: number; pageSize: number; data: NftCollectionHistoryRecord[]; } export interface PageableNftOwnedCollectionResponse { total: number; page: number; pageSize: number; data: NftOwnedCollectionResponse[]; } export interface PageableNftTokenHistoryRecord { total: number; page: number; pageSize: number; data: NftTokenHistoryRecord[]; } export interface PageableNftTokenResponse { total: number; page: number; pageSize: number; data: NftTokenResponse[]; } export interface Status { latest_version: number; tps: string; cache_size: string; synced: boolean; git_hash: string; } export interface PageableU64 { total: number; page: number; pageSize: number; data: number[]; } export interface DelegationPoolResponse { pool: string; owner: string; rewards: string; delegated: string; } export interface PoolRewardResponse { pool: string; rewards: string; } export interface DelegatedPoolResponse { pool: string; amount: string; }