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