-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: updated Taostats api call endpoints (#1206)
* refactor: updated taostats api call endpoints * fix: object key to match new api response "hot_key" -> "hotkey" * fix: apr type, add default
- Loading branch information
Showing
4 changed files
with
94 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,59 @@ | ||
export type ValidatorsData = { | ||
count: number | ||
validators: Validator[] | ||
type Pagination = { | ||
current_page: number | ||
per_page: number | ||
total_items: number | ||
total_pages: number | ||
next_page: number | null | ||
prev_page: number | null | ||
} | ||
|
||
// Key Type | ||
type Key = { | ||
ss58: string | ||
hex: string | ||
} | ||
|
||
type Validator = { | ||
// Subnet Dominance Type | ||
type SubnetDominance = { | ||
netuid: number | ||
dominance: string | ||
family_stake: string | ||
} | ||
|
||
// Validator Data Type | ||
type ValidatorData = { | ||
hotkey: Key | ||
coldkey: Key | ||
name: string | ||
block_number: number | ||
timestamp: string | ||
registered_at_time: string | ||
registered_at_block: number | ||
validator_stake: string | ||
amount: string | ||
timestamp: string // ISO date format string | ||
rank: number | ||
nominators: number | ||
amount_change: string | ||
nominator_change: number | ||
registrations: number[] | ||
validator_permits: number[] | ||
nominators_24_hr_change: number | ||
system_stake: string | ||
stake: string | ||
stake_24_hr_change: string | ||
dominance: string | ||
validator_stake: string | ||
take: string | ||
total_daily_return: string | ||
validator_return: string | ||
nominator_return_per_k: string | ||
apr: string | ||
nominator_return_per_k_7_day_average: string | ||
nominator_return_per_k_30_day_average: string | ||
apr_7_day_average: string | ||
apr_30_day_average: string | ||
hot_key: Key | ||
cold_key: Key | ||
take: string | ||
rank: number | ||
dominance: string | ||
system_total_stake: string | ||
nominator_7day_average: string | ||
nominator_30day_average: string | ||
pending_emission: string | ||
blocks_until_next_reward: number | ||
last_reward_block: number | ||
registrations: number[] | ||
permits: number[] | ||
subnet_dominance: SubnetDominance[] | ||
} | ||
|
||
type Key = { | ||
ss58: string | ||
hex: string | ||
} | ||
|
||
type SubnetDominance = { | ||
netuid: number | ||
dominance: string | ||
// API Response Type | ||
export type ValidatorsData = { | ||
pagination: Pagination | ||
data: ValidatorData[] | ||
} |