diff --git a/src/models/responses/bank/config.ts b/src/models/responses/bank/config.ts index 9ff4edb1..390be0ab 100644 --- a/src/models/responses/bank/config.ts +++ b/src/models/responses/bank/config.ts @@ -22,5 +22,5 @@ export interface BankConfigResponse { protocol: Protocol; version: Version; default_transaction_fee: number; - node_type: NodeType; + node_type: NodeType.bank; } diff --git a/src/models/responses/confirmation-validator/config.ts b/src/models/responses/confirmation-validator/config.ts index df00cdd8..9516dc74 100644 --- a/src/models/responses/confirmation-validator/config.ts +++ b/src/models/responses/confirmation-validator/config.ts @@ -26,5 +26,5 @@ export interface ConfirmationValidatorConfigResponse { root_account_file_hash: Hex; seed_block_identifier: Hex; daily_confirmation_rate: number; - node_type: NodeType; + node_type: NodeType.confirmationValidator; } diff --git a/src/models/responses/constants.ts b/src/models/responses/constants.ts index b6892535..675bbd7c 100644 --- a/src/models/responses/constants.ts +++ b/src/models/responses/constants.ts @@ -1,4 +1,8 @@ -export type NodeType = "BANK" | "CONFIRMATION_VALIDATOR" | "PRIMARY_VALIDATOR"; +export enum NodeType { + bank = "BANK", + confirmationValidator = "CONFIRMATION_VALIDATOR", + primaryValidator = "PRIMARY_VALIDATOR", +} export type Version = "v1.0"; export type Protocol = "http" | "https"; export type Port = number; diff --git a/src/models/responses/generic/clean.ts b/src/models/responses/generic/clean.ts index 937d8999..aef5a777 100644 --- a/src/models/responses/generic/clean.ts +++ b/src/models/responses/generic/clean.ts @@ -1,5 +1,11 @@ import type { Origin, Port, Protocol } from "../constants"; +export enum CleanStatus { + cleaning = "cleaning", + notCleaning = "not_cleaning", + stopRequested = "stop_requested", +} + /** The response model for a crawl request. */ export interface CleanResponse { clean_last_completed: string; diff --git a/src/models/responses/generic/crawl.ts b/src/models/responses/generic/crawl.ts index e0f17094..f367b94f 100644 --- a/src/models/responses/generic/crawl.ts +++ b/src/models/responses/generic/crawl.ts @@ -1,9 +1,15 @@ import type { Origin, Port, Protocol } from "../constants"; +export enum CrawlStatus { + crawling = "crawling", + notCrawling = "not_crawling", + stopRequested = "stop_requested", +} + /** The response model for a crawl request. */ export interface CrawlResponse { crawl_last_completed: string; - crawl_status: string; + crawl_status: CrawlStatus; ip_address: Origin; port: Port; protocol: Protocol; diff --git a/src/models/responses/primary-validator/config.ts b/src/models/responses/primary-validator/config.ts index 6226aea1..9f492459 100644 --- a/src/models/responses/primary-validator/config.ts +++ b/src/models/responses/primary-validator/config.ts @@ -1,4 +1,4 @@ -import type { Hex, Origin, Port, Protocol, Url, Trust, Version, NodeType } from "../constants"; +import type { Hex, Origin, Port, Protocol, Url, Version, NodeType } from "../constants"; export interface PrimaryValidatorConfigResponse { primary_validator: null; @@ -13,5 +13,5 @@ export interface PrimaryValidatorConfigResponse { root_account_file_hash: Hex; seed_block_identifier: Hex; daily_confirmation_rate: number; - node_type: NodeType; + node_type: NodeType.primaryValidator; }